start defining codes for instructions
[oota-llvm.git] / include / llvm / Bitcode / ReaderWriter.h
1 //===-- llvm/Bitcode/ReaderWriter.h - Bitcode reader/writers ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header defines interfaces to read and write LLVM bitcode files/streams.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_BITCODE_H
15 #define LLVM_BITCODE_H
16
17 #include <iosfwd>
18 #include <string>
19
20 namespace llvm {
21   class Module;
22   class ModuleProvider;
23   
24   ModuleProvider *getBitcodeModuleProvider(const std::string &Filename,
25                                            std::string *ErrMsg = 0);
26
27   
28   /// ParseBitcodeFile - Read the specified bitcode file, returning the module.
29   /// If an error occurs, return null and fill in *ErrMsg if non-null.
30   Module *ParseBitcodeFile(const std::string &Filename,
31                            std::string *ErrMsg = 0);
32   
33   /// WriteBitcodeToFile - Write the specified module to the specified output
34   /// stream.
35   void WriteBitcodeToFile(const Module *M, std::ostream &Out);
36 } // End llvm namespace
37
38 #endif