Standardize header file comments
[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 "llvm/ModuleProvider.h"
16 #include <string>
17 #include <vector>
18
19 /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
20 ///
21 AbstractModuleProvider*
22 getBytecodeModuleProvider(const std::string &Filename);
23
24 /// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a
25 /// buffer
26 ///
27 AbstractModuleProvider* 
28 getBytecodeBufferModuleProvider(const unsigned char *Buffer,
29                                 unsigned BufferSize,
30                                 const std::string &ModuleID = "");
31
32 /// ParseBytecodeFile - Parse the given bytecode file
33 ///
34 Module* ParseBytecodeFile(const std::string &Filename,
35                           std::string *ErrorStr = 0);
36
37 /// ParseBytecodeBuffer - Parse a given bytecode buffer
38 ///
39 Module* ParseBytecodeBuffer(const unsigned char *Buffer,
40                             unsigned BufferSize,
41                             const std::string &ModuleID = "",
42                             std::string *ErrorStr = 0);
43
44 /// ReadArchiveFile - Read bytecode files from the specfied .a file, returning
45 /// true on error, or false on success.
46 ///
47 bool ReadArchiveFile(const std::string &Filename,
48                      std::vector<Module*> &Objects,
49                      std::string *ErrorStr = 0);
50
51 #endif