summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2017-01-08 00:30:27 +0000
committerMehdi Amini <mehdi.amini@apple.com>2017-01-08 00:30:27 +0000
commit83a807ebae495d012f1e2b36cb55994741257fb7 (patch)
tree78ca20776481f00dfbe6f8b95b25e2b2e0eca173 /llvm/lib/LTO
parent184d5d720bcabf6d66e0c8d2fca0a5aeb22173d5 (diff)
downloadbcm5719-llvm-83a807ebae495d012f1e2b36cb55994741257fb7.tar.gz
bcm5719-llvm-83a807ebae495d012f1e2b36cb55994741257fb7.zip
[ThinLTO] Expected<> return values need to be handled to avoid an assertion
llvm-svn: 291377
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r--llvm/lib/LTO/ThinLTOCodeGenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index 66ffe6db29d..928f69a17de 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -196,8 +196,15 @@ crossImportIntoModule(Module &TheModule, const ModuleSummaryIndex &Index,
};
FunctionImporter Importer(Index, Loader);
- if (!Importer.importFunctions(TheModule, ImportList))
+ Expected<bool> Result = Importer.importFunctions(TheModule, ImportList);
+ if (!Result) {
+ handleAllErrors(Result.takeError(), [&](ErrorInfoBase &EIB) {
+ SMDiagnostic Err = SMDiagnostic(TheModule.getModuleIdentifier(),
+ SourceMgr::DK_Error, EIB.message());
+ Err.print("ThinLTO", errs());
+ });
report_fatal_error("importFunctions failed");
+ }
}
static void optimizeModule(Module &TheModule, TargetMachine &TM,
OpenPOWER on IntegriCloud