diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-16 22:27:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-16 22:27:55 +0000 |
commit | dcd1dca275595bfabbd4abfdf0df6419f0f95a53 (patch) | |
tree | 8d97c3fa45635159b605f80e9a6ccb7272625eb5 /llvm/lib/IRReader | |
parent | 5293379374f46f670305a75dd3df667f04292dc9 (diff) | |
download | llvm-dcd1dca275595bfabbd4abfdf0df6419f0f95a53.zip llvm-dcd1dca275595bfabbd4abfdf0df6419f0f95a53.tar.gz llvm-dcd1dca275595bfabbd4abfdf0df6419f0f95a53.tar.bz2 |
Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC.
llvm-svn: 239858
Diffstat (limited to 'llvm/lib/IRReader')
-rw-r--r-- | llvm/lib/IRReader/IRReader.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IRReader/IRReader.cpp b/llvm/lib/IRReader/IRReader.cpp index 7bc6f07..43fee65 100644 --- a/llvm/lib/IRReader/IRReader.cpp +++ b/llvm/lib/IRReader/IRReader.cpp @@ -34,14 +34,14 @@ getLazyIRModule(std::unique_ptr<MemoryBuffer> Buffer, SMDiagnostic &Err, LLVMContext &Context) { if (isBitcode((const unsigned char *)Buffer->getBufferStart(), (const unsigned char *)Buffer->getBufferEnd())) { - ErrorOr<Module *> ModuleOrErr = + ErrorOr<std::unique_ptr<Module>> ModuleOrErr = getLazyBitcodeModule(std::move(Buffer), Context); if (std::error_code EC = ModuleOrErr.getError()) { Err = SMDiagnostic(Buffer->getBufferIdentifier(), SourceMgr::DK_Error, EC.message()); return nullptr; } - return std::unique_ptr<Module>(ModuleOrErr.get()); + return std::move(ModuleOrErr.get()); } return parseAssembly(Buffer->getMemBufferRef(), Err, Context); @@ -67,13 +67,14 @@ std::unique_ptr<Module> llvm::parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err, TimePassesIsEnabled); if (isBitcode((const unsigned char *)Buffer.getBufferStart(), (const unsigned char *)Buffer.getBufferEnd())) { - ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(Buffer, Context); + ErrorOr<std::unique_ptr<Module>> ModuleOrErr = + parseBitcodeFile(Buffer, Context); if (std::error_code EC = ModuleOrErr.getError()) { Err = SMDiagnostic(Buffer.getBufferIdentifier(), SourceMgr::DK_Error, EC.message()); return nullptr; } - return std::unique_ptr<Module>(ModuleOrErr.get()); + return std::move(ModuleOrErr.get()); } return parseAssembly(Buffer, Err, Context); |