LLVM API Documentation

Bytecode/Writer.h

Go to the documentation of this file.
00001 //===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This functionality is implemented by the lib/BytecodeWriter library.
00011 // This library is used to write VM bytecode files to an iostream.  First, you
00012 // have to make a BytecodeStream object, which you can then put a class into
00013 // by using operator <<.
00014 //
00015 // This library uses the Analysis library to figure out offsets for
00016 // variables in the method tables...
00017 //
00018 // Note that performance of this library is not as crucial as performance of the
00019 // bytecode reader (which is to be used in JIT type applications), so we have
00020 // designed the bytecode format to support quick reading.
00021 //
00022 //===----------------------------------------------------------------------===//
00023 
00024 #ifndef LLVM_BYTECODE_WRITER_H
00025 #define LLVM_BYTECODE_WRITER_H
00026 
00027 #include <iosfwd>
00028 
00029 namespace llvm {
00030   class Module;
00031   /// WriteBytecodeToFile - Write the specified module to the specified output
00032   /// stream.  If compress is set to true, try to use compression when writing
00033   /// out the file.  This throws an std::string if there is an error writing
00034   /// the file.
00035   void WriteBytecodeToFile(const Module *M, std::ostream &Out,
00036                            bool compress = true);
00037 } // End llvm namespace
00038 
00039 #endif