diff options
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 4256704f906..c8587465e4b 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -99,26 +99,6 @@ static void computeCacheKey( Key = toHex(Hasher.result()); } -// Simple helper to load a module from bitcode -std::unique_ptr<Module> -llvm::loadModuleFromBuffer(const MemoryBufferRef &Buffer, LLVMContext &Context, - bool Lazy) { - SMDiagnostic Err; - Expected<std::unique_ptr<Module>> ModuleOrErr = - Lazy ? getLazyBitcodeModule(Buffer, Context, - /* ShouldLazyLoadMetadata */ true) - : parseBitcodeFile(Buffer, Context); - if (!ModuleOrErr) { - handleAllErrors(ModuleOrErr.takeError(), [&](ErrorInfoBase &EIB) { - SMDiagnostic Err = SMDiagnostic(Buffer.getBufferIdentifier(), - SourceMgr::DK_Error, EIB.message()); - Err.print("ThinLTO", errs()); - }); - report_fatal_error("Can't load module, abort."); - } - return std::move(ModuleOrErr.get()); -} - static void thinLTOResolveWeakForLinkerGUID( GlobalValueSummaryList &GVSummaryList, GlobalValue::GUID GUID, DenseSet<GlobalValueSummary *> &GlobalInvolvedWithAlias, |