summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/LTO.cpp5
-rw-r--r--llvm/lib/LTO/LTOBackend.cpp3
-rw-r--r--llvm/lib/LTO/LTOModule.cpp6
3 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 20da6d9f018..ed95ac6598c 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -105,9 +105,8 @@ llvm::loadModuleFromBuffer(const MemoryBufferRef &Buffer, LLVMContext &Context,
SMDiagnostic Err;
ErrorOr<std::unique_ptr<Module>> ModuleOrErr(nullptr);
if (Lazy) {
- ModuleOrErr =
- getLazyBitcodeModule(MemoryBuffer::getMemBuffer(Buffer, false), Context,
- /* ShouldLazyLoadMetadata */ Lazy);
+ ModuleOrErr = getLazyBitcodeModule(Buffer, Context,
+ /* ShouldLazyLoadMetadata */ Lazy);
} else {
ModuleOrErr = parseBitcodeFile(Buffer, Context);
}
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index b00c37f7254..0885c0b8484 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -352,8 +352,7 @@ 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(MemoryBuffer::getMemBuffer(
- ModuleMap[Identifier], false),
+ return std::move(getLazyBitcodeModule(ModuleMap[Identifier],
Mod.getContext(),
/*ShouldLazyLoadMetadata=*/true)
.get());
diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
index 5b46feb15b9..96a88241cc9 100644
--- a/llvm/lib/LTO/LTOModule.cpp
+++ b/llvm/lib/LTO/LTOModule.cpp
@@ -185,10 +185,8 @@ parseBitcodeFileImpl(MemoryBufferRef Buffer, LLVMContext &Context,
}
// Parse lazily.
- std::unique_ptr<MemoryBuffer> LightweightBuf =
- MemoryBuffer::getMemBuffer(*MBOrErr, false);
- ErrorOr<std::unique_ptr<Module>> M = getLazyBitcodeModule(
- std::move(LightweightBuf), Context, true /*ShouldLazyLoadMetadata*/);
+ ErrorOr<std::unique_ptr<Module>> M =
+ getLazyBitcodeModule(*MBOrErr, Context, true /*ShouldLazyLoadMetadata*/);
if (std::error_code EC = M.getError())
return EC;
return std::move(*M);
OpenPOWER on IntegriCloud