diff options
Diffstat (limited to 'contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
| -rw-r--r-- | contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 66ffe6db29d6..928f69a17de9 100644 --- a/contrib/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/contrib/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, | 
