summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2015-11-11 19:59:08 +0000
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2015-11-11 19:59:08 +0000
commitea7b3a232078690ea57a45d37601fc7cfea6de3d (patch)
treec340fccb32d93b4b8081b12662e0e05b18867209 /llvm/lib
parent0c6a4f197fe6aa95435323cbdbc4fe23e3694205 (diff)
downloadbcm5719-llvm-ea7b3a232078690ea57a45d37601fc7cfea6de3d.tar.gz
bcm5719-llvm-ea7b3a232078690ea57a45d37601fc7cfea6de3d.zip
Add a libLTO diagnostic handler that supports lto_get_error_message API
This is a follow-up from the previous discussion on the thread: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307763.html The LibLTO lto_get_error_message() API reads error messages from a std::string sLastErrorString. Instead of passing this string around as an argument, this patch creates a diagnostic handler and then sends this handler to the constructor of LTOCodeGenerator. Differential Revision: http://reviews.llvm.org/D14313 llvm-svn: 252791
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 8dcc53c8033..56240502c02 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -64,23 +64,17 @@ 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(), handleLTODiagnostic) {
+ IRLinker(MergedModule.get()) {
initializeLTOPasses();
}
LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
: OwnedContext(std::move(Context)), Context(*OwnedContext),
MergedModule(new Module("ld-temp.o", *OwnedContext)),
- IRLinker(MergedModule.get(), handleLTODiagnostic) {
+ IRLinker(MergedModule.get()) {
initializeLTOPasses();
}
OpenPOWER on IntegriCloud