| OLD | NEW |
| 1 //===-- llvm/Bitcode/ReaderWriter.h - Bitcode reader/writers ----*- C++ -*-===// | 1 //===-- llvm/Bitcode/ReaderWriter.h - Bitcode reader/writers ----*- 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 header defines interfaces to read and write LLVM bitcode files/streams. | 10 // This header defines interfaces to read and write LLVM bitcode files/streams. |
| 11 // | 11 // |
| 12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
| 13 | 13 |
| 14 #ifndef LLVM_BITCODE_READERWRITER_H | 14 #ifndef LLVM_BITCODE_READERWRITER_H |
| 15 #define LLVM_BITCODE_READERWRITER_H | 15 #define LLVM_BITCODE_READERWRITER_H |
| 16 | 16 |
| 17 #include "llvm/Support/ErrorOr.h" | 17 #include "llvm/Support/ErrorOr.h" |
| 18 #include "llvm/Support/MemoryBuffer.h" | 18 #include "llvm/Support/MemoryBuffer.h" |
| 19 #include <memory> | 19 #include <memory> |
| 20 #include <string> | 20 #include <string> |
| 21 | 21 |
| 22 namespace llvm { | 22 namespace llvm { |
| 23 class BitstreamWriter; | 23 class BitstreamWriter; |
| 24 class DataStreamer; | |
| 25 class LLVMContext; | 24 class LLVMContext; |
| 26 class Module; | 25 class Module; |
| 27 class ModulePass; | 26 class ModulePass; |
| 27 class StreamingMemoryObject; // @LOCALMOD |
| 28 class raw_ostream; | 28 class raw_ostream; |
| 29 | 29 |
| 30 /// Read the header of the specified bitcode buffer and prepare for lazy | 30 /// Read the header of the specified bitcode buffer and prepare for lazy |
| 31 /// deserialization of function bodies. If successful, this moves Buffer. On | 31 /// deserialization of function bodies. If successful, this moves Buffer. On |
| 32 /// error, this *does not* move Buffer. | 32 /// error, this *does not* move Buffer. |
| 33 ErrorOr<Module *> getLazyBitcodeModule(std::unique_ptr<MemoryBuffer> &&Buffer, | 33 ErrorOr<Module *> getLazyBitcodeModule(std::unique_ptr<MemoryBuffer> &&Buffer, |
| 34 LLVMContext &Context); | 34 LLVMContext &Context); |
| 35 | 35 |
| 36 /// getStreamedBitcodeModule - Read the header of the specified stream | 36 /// getStreamedBitcodeModule - Read the header of the specified stream |
| 37 /// and prepare for lazy deserialization and streaming of function bodies. | 37 /// and prepare for lazy deserialization and streaming of function bodies. |
| 38 /// On error, this returns null, and fills in *ErrMsg with an error | 38 /// On error, this returns null, and fills in *ErrMsg with an error |
| 39 /// description if ErrMsg is non-null. | 39 /// description if ErrMsg is non-null. |
| 40 Module *getStreamedBitcodeModule(const std::string &name, | 40 Module *getStreamedBitcodeModule(const std::string &name, |
| 41 DataStreamer *streamer, | 41 // @LOCALMOD |
| 42 StreamingMemoryObject *streamer, |
| 42 LLVMContext &Context, | 43 LLVMContext &Context, |
| 43 std::string *ErrMsg = nullptr); | 44 std::string *ErrMsg = nullptr); |
| 44 | 45 |
| 45 /// Read the header of the specified bitcode buffer and extract just the | 46 /// Read the header of the specified bitcode buffer and extract just the |
| 46 /// triple information. If successful, this returns a string. On error, this | 47 /// triple information. If successful, this returns a string. On error, this |
| 47 /// returns "". | 48 /// returns "". |
| 48 std::string getBitcodeTargetTriple(MemoryBufferRef Buffer, | 49 std::string getBitcodeTargetTriple(MemoryBufferRef Buffer, |
| 49 LLVMContext &Context); | 50 LLVMContext &Context); |
| 50 | 51 |
| 51 /// Read the specified bitcode file, returning the module. | 52 /// Read the specified bitcode file, returning the module. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return std::error_code(static_cast<int>(E), BitcodeErrorCategory()); | 168 return std::error_code(static_cast<int>(E), BitcodeErrorCategory()); |
| 168 } | 169 } |
| 169 | 170 |
| 170 } // End llvm namespace | 171 } // End llvm namespace |
| 171 | 172 |
| 172 namespace std { | 173 namespace std { |
| 173 template <> struct is_error_code_enum<llvm::BitcodeError> : std::true_type {}; | 174 template <> struct is_error_code_enum<llvm::BitcodeError> : std::true_type {}; |
| 174 } | 175 } |
| 175 | 176 |
| 176 #endif | 177 #endif |
| OLD | NEW |