diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-13 07:00:17 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-13 07:00:17 +0000 |
commit | d9445c49ad47c227f5981ad1f8f211dff9aaa9f1 (patch) | |
tree | 81677338f0d0d86208f35bc7cf3acbc898999a71 /llvm/lib/LTO/LTOBackend.cpp | |
parent | 8dff03911c5efa7a3abd6fb43f09233758075b20 (diff) | |
download | bcm5719-llvm-d9445c49ad47c227f5981ad1f8f211dff9aaa9f1.tar.gz bcm5719-llvm-d9445c49ad47c227f5981ad1f8f211dff9aaa9f1.zip |
Bitcode: Change module reader functions to return an llvm::Expected.
Differential Revision: https://reviews.llvm.org/D26562
llvm-svn: 286752
Diffstat (limited to 'llvm/lib/LTO/LTOBackend.cpp')
-rw-r--r-- | llvm/lib/LTO/LTOBackend.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 739d367f03e..be9009e19c3 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -237,7 +237,7 @@ void splitCodeGen(Config &C, TargetMachine *TM, AddStreamFn AddStream, CodegenThreadPool.async( [&](const SmallString<0> &BC, unsigned ThreadId) { LTOLLVMContext Ctx(C); - ErrorOr<std::unique_ptr<Module>> MOrErr = parseBitcodeFile( + Expected<std::unique_ptr<Module>> MOrErr = parseBitcodeFile( MemoryBufferRef(StringRef(BC.data(), BC.size()), "ld-temp.o"), Ctx); if (!MOrErr) @@ -353,10 +353,8 @@ Error lto::thinBackend(Config &Conf, unsigned Task, AddStreamFn AddStream, auto ModuleLoader = [&](StringRef Identifier) { assert(Mod.getContext().isODRUniquingDebugTypes() && "ODR Type uniquing should be enabled on the context"); - return std::move(getLazyBitcodeModule(ModuleMap[Identifier], - Mod.getContext(), - /*ShouldLazyLoadMetadata=*/true) - .get()); + return getLazyBitcodeModule(ModuleMap[Identifier], Mod.getContext(), + /*ShouldLazyLoadMetadata=*/true); }; FunctionImporter Importer(CombinedIndex, ModuleLoader); |