Modernize the getStreamedBitcodeModule interface a bit. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-12-18 05:08:43 +00:00
parent 633948975c
commit d15bca6859
4 changed files with 29 additions and 33 deletions

View File

@ -61,9 +61,8 @@ public:
init(Start, End);
}
BitstreamReader(MemoryObject *bytes) : IgnoreBlockInfoNames(true) {
BitcodeBytes.reset(bytes);
}
BitstreamReader(std::unique_ptr<MemoryObject> BitcodeBytes)
: BitcodeBytes(std::move(BitcodeBytes)), IgnoreBlockInfoNames(true) {}
BitstreamReader(BitstreamReader &&Other) {
*this = std::move(Other);

View File

@ -33,14 +33,11 @@ namespace llvm {
ErrorOr<Module *> getLazyBitcodeModule(std::unique_ptr<MemoryBuffer> &&Buffer,
LLVMContext &Context);
/// getStreamedBitcodeModule - Read the header of the specified stream
/// and prepare for lazy deserialization and streaming of function bodies.
/// On error, this returns null, and fills in *ErrMsg with an error
/// description if ErrMsg is non-null.
Module *getStreamedBitcodeModule(const std::string &name,
DataStreamer *streamer,
LLVMContext &Context,
std::string *ErrMsg = nullptr);
/// Read the header of the specified stream and prepare for lazy
/// deserialization and streaming of function bodies.
ErrorOr<std::unique_ptr<Module>>
getStreamedBitcodeModule(StringRef Name, DataStreamer *Streamer,
LLVMContext &Context);
/// Read the header of the specified bitcode buffer and extract just the
/// triple information. If successful, this returns a string. On error, this