OLD | NEW |
1 //===---- llvm/IRReader/IRReader.h - Reader for LLVM IR files ---*- C++ -*-===// | 1 //===---- llvm/IRReader/IRReader.h - Reader for LLVM IR files ---*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines functions for reading LLVM IR. They support both | 10 // This file defines functions for reading LLVM IR. They support both |
(...skipping 25 matching lines...) Expand all Loading... |
36 /// for it. Otherwise, attempt to parse it as LLVM Assembly and return | 36 /// for it. Otherwise, attempt to parse it as LLVM Assembly and return |
37 /// a Module for it. | 37 /// a Module for it. |
38 std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err, | 38 std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err, |
39 LLVMContext &Context); | 39 LLVMContext &Context); |
40 | 40 |
41 /// If the given file holds a bitcode image, return a Module for it. | 41 /// If the given file holds a bitcode image, return a Module for it. |
42 /// Otherwise, attempt to parse it as LLVM Assembly and return a Module | 42 /// Otherwise, attempt to parse it as LLVM Assembly and return a Module |
43 /// for it. | 43 /// for it. |
44 std::unique_ptr<Module> parseIRFile(StringRef Filename, SMDiagnostic &Err, | 44 std::unique_ptr<Module> parseIRFile(StringRef Filename, SMDiagnostic &Err, |
45 LLVMContext &Context); | 45 LLVMContext &Context); |
| 46 |
| 47 // @LOCALMOD-BEGIN |
| 48 class raw_ostream; |
| 49 |
| 50 // \brief Define the expected format of the file. |
| 51 enum NaClFileFormat { |
| 52 // LLVM IR source or bitcode file (as appropriate). |
| 53 LLVMFormat, |
| 54 // PNaCl bitcode file. |
| 55 PNaClFormat, |
| 56 // Autodetect if PNaCl or LLVM format. |
| 57 AutodetectFileFormat |
| 58 }; |
| 59 |
| 60 // \brief If the given MemoryBuffer holds a bitcode image, return a |
| 61 // Module for it. Otherwise, attempt to parse it as LLVM Assembly and |
| 62 // return a Module for it. When Format=PNaClFormat and Verbose |
| 63 // is non-null, more descriptive error messages are also written to |
| 64 // Verbose. |
| 65 std::unique_ptr<Module> NaClParseIR(MemoryBufferRef Buffer, |
| 66 NaClFileFormat Format, |
| 67 SMDiagnostic &Err, |
| 68 raw_ostream *Verbose, |
| 69 LLVMContext &Context); |
| 70 |
| 71 /// \brief If the given file holds a Bitcode image, read the file. |
| 72 /// Otherwise, attempt to parse it as LLVM assembly and return a |
| 73 /// Module for it. When Format=PNaClFormat and Verbose |
| 74 // is non-null, more descriptive error messages are also written to |
| 75 // Verbose. |
| 76 std::unique_ptr<Module> NaClParseIRFile(StringRef Filename, |
| 77 NaClFileFormat Format, |
| 78 SMDiagnostic &Err, |
| 79 raw_ostream *Verbose, |
| 80 LLVMContext &Context); |
| 81 // @LOCALMOD-END |
46 } | 82 } |
47 | 83 |
48 #endif | 84 #endif |
OLD | NEW |