Add information about the module source
[oota-llvm.git] / include / llvm / Bytecode / Reader.h
1 //===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=//
2 //
3 // This functionality is implemented by the lib/Bytecode/Reader library.
4 // This library is used to read VM bytecode files from an iostream.
5 //
6 // Note that performance of this library is _crucial_ for performance of the
7 // JIT type applications, so we have designed the bytecode format to support
8 // quick reading.
9 //
10 //===----------------------------------------------------------------------===//
11
12 #ifndef LLVM_BYTECODE_READER_H
13 #define LLVM_BYTECODE_READER_H
14
15 #include <string>
16 #include <vector>
17
18 class Module;
19
20 // Parse and return a class...
21 //
22 Module *ParseBytecodeFile(const std::string &Filename,
23                           std::string *ErrorStr = 0);
24 Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize,
25                             const std::string &ModuleID,
26                             std::string *ErrorStr = 0);
27
28 // ReadArchiveFile - Read bytecode files from the specfied .a file, returning
29 // true on error, or false on success.
30 //
31 bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
32                      std::string *ErrorStr = 0);
33
34 #endif