summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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/lib
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/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 51515b0de50..5dda8292bd6 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -64,17 +64,23 @@ const char* LTOCodeGenerator::getVersionString() {
#endif
}
+static void handleLTODiagnostic(const DiagnosticInfo &DI) {
+ DiagnosticPrinterRawOStream DP(errs());
+ DI.print(DP);
+ errs() << "\n";
+}
+
LTOCodeGenerator::LTOCodeGenerator()
: Context(getGlobalContext()),
MergedModule(new Module("ld-temp.o", Context)),
- IRLinker(MergedModule.get()) {
+ IRLinker(MergedModule.get(), handleLTODiagnostic) {
initializeLTOPasses();
}
LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
: OwnedContext(std::move(Context)), Context(*OwnedContext),
MergedModule(new Module("ld-temp.o", *OwnedContext)),
- IRLinker(MergedModule.get()) {
+ IRLinker(MergedModule.get(), handleLTODiagnostic) {
initializeLTOPasses();
}
OpenPOWER on IntegriCloud