summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto/llvm-lto.cpp
diff options
context:
space:
mode:
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2015-09-11 20:01:53 +0000
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2015-09-11 20:01:53 +0000
commit46261a74db3114e7035be0a3c5fb485fc3ec8ef6 (patch)
treebb4be61a28e30a15235e9e83a65730c2c4cd768c /llvm/tools/llvm-lto/llvm-lto.cpp
parent9c7b08e609115eef68b1155545a7bc8d9c6f45bc (diff)
downloadbcm5719-llvm-46261a74db3114e7035be0a3c5fb485fc3ec8ef6.tar.gz
bcm5719-llvm-46261a74db3114e7035be0a3c5fb485fc3ec8ef6.zip
Add a non-exiting diagnostic handler for LTO.
This is in order to give LTO clients a chance to do some clean-up before terminating the process. llvm-svn: 247461
Diffstat (limited to 'llvm/tools/llvm-lto/llvm-lto.cpp')
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
index ddde23175a3..cdb1bcaa6bc 100644
--- a/llvm/tools/llvm-lto/llvm-lto.cpp
+++ b/llvm/tools/llvm-lto/llvm-lto.cpp
@@ -216,8 +216,11 @@ int main(int argc, char **argv) {
if (SetMergedModule && i == BaseArg) {
// Transfer ownership to the code generator.
CodeGen.setModule(std::move(Module));
- } else if (!CodeGen.addModule(Module.get()))
+ } else if (!CodeGen.addModule(Module.get())) {
+ // Print a message here so that we know addModule() did not abort.
+ errs() << argv[0] << ": error adding file '" << InputFilenames[i] << "'\n";
return 1;
+ }
}
// Add all the exported symbols to the table of symbols to preserve.
OpenPOWER on IntegriCloud