[llvm] r257395 - Add a missing error handling to llvm-lto.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 14:08:22 PST 2016
Author: rafael
Date: Mon Jan 11 16:08:22 2016
New Revision: 257395
URL: http://llvm.org/viewvc/llvm-project?rev=257395&view=rev
Log:
Add a missing error handling to llvm-lto.
Added:
llvm/trunk/test/tools/llvm-lto/error.ll
Modified:
llvm/trunk/tools/llvm-lto/llvm-lto.cpp
Added: llvm/trunk/test/tools/llvm-lto/error.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lto/error.ll?rev=257395&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-lto/error.ll (added)
+++ llvm/trunk/test/tools/llvm-lto/error.ll Mon Jan 11 16:08:22 2016
@@ -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
Modified: llvm/trunk/tools/llvm-lto/llvm-lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto/llvm-lto.cpp?rev=257395&r1=257394&r2=257395&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lto/llvm-lto.cpp (original)
+++ llvm/trunk/tools/llvm-lto/llvm-lto.cpp Mon Jan 11 16:08:22 2016
@@ -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 = "";
More information about the llvm-commits
mailing list