diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-09-11 20:01:53 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2015-09-11 20:01:53 +0000 |
commit | 7ba3323aff198a93d9f6ba50c11152e1007fdf3b (patch) | |
tree | 4fc3e08c496d67e141eaa2600f057d36653d3dd2 /tools/llvm-lto | |
parent | 4d5d1dcf1d63047f162c4a43898ad6d847d7b661 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-lto')
-rw-r--r-- | tools/llvm-lto/llvm-lto.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp index ddde23175a3..cdb1bcaa6bc 100644 --- a/tools/llvm-lto/llvm-lto.cpp +++ b/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. |