Add a missing error handling to llvm-lto.

llvm-svn: 257395
This commit is contained in:
Rafael Espindola 2016-01-11 22:08:22 +00:00
parent f225a63849
commit 5a7756044f
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1,2 @@
; RUN: not llvm-lto foobar 2>&1 | FileCheck %s
; CHECK: llvm-lto: error loading file 'foobar': No such file or directory

View File

@ -289,6 +289,7 @@ int main(int argc, char **argv) {
CurrentActivity = "loading file '" + InputFilenames[i] + "'";
ErrorOr<std::unique_ptr<LTOModule>> ModuleOrErr =
LTOModule::createFromFile(Context, InputFilenames[i].c_str(), Options);
error(ModuleOrErr, "error " + CurrentActivity);
std::unique_ptr<LTOModule> &Module = *ModuleOrErr;
CurrentActivity = "";