Skip to content

Commit

Permalink
[ThinLTO] Expected<> return values need to be handled to avoid an ass…
Browse files Browse the repository at this point in the history
…ertion

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291377 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
joker-eph committed Jan 8, 2017
1 parent f83ef17 commit 1de89c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/LTO/ThinLTOCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1de89c2

Please sign in to comment.