diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2017-01-08 00:30:27 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2017-01-08 00:30:27 +0000 |
| commit | 83a807ebae495d012f1e2b36cb55994741257fb7 (patch) | |
| tree | 78ca20776481f00dfbe6f8b95b25e2b2e0eca173 /llvm/lib/LTO | |
| parent | 184d5d720bcabf6d66e0c8d2fca0a5aeb22173d5 (diff) | |
| download | bcm5719-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.cpp | 9 |
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, |

