aboutsummaryrefslogtreecommitdiff
path: root/lib/LTO/LTOCodeGenerator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-25 14:25:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-25 14:25:49 +0000
commit2fe5752e3a7c345cdb59e869278d36af33c13fa4 (patch)
treedf68ca4b788599e14cbadaf19b704672393efccd /lib/LTO/LTOCodeGenerator.cpp
parent69156b4c20249e7800cc09e0eef0beb3d15ac1ad (diff)
Notes
Diffstat (limited to 'lib/LTO/LTOCodeGenerator.cpp')
-rw-r--r--lib/LTO/LTOCodeGenerator.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp
index 149ec6a4f372..25ae4ac76e3c 100644
--- a/lib/LTO/LTOCodeGenerator.cpp
+++ b/lib/LTO/LTOCodeGenerator.cpp
@@ -63,14 +63,21 @@ const char* LTOCodeGenerator::getVersionString() {
#endif
}
+static void handleLTODiagnostic(const DiagnosticInfo &DI) {
+ DiagnosticPrinterRawOStream DP(errs());
+ DI.print(DP);
+ errs() << "\n";
+}
+
LTOCodeGenerator::LTOCodeGenerator()
- : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context)) {
+ : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context),
+ handleLTODiagnostic) {
initializeLTOPasses();
}
LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
: OwnedContext(std::move(Context)), Context(*OwnedContext),
- IRLinker(new Module("ld-temp.o", *OwnedContext)) {
+ IRLinker(new Module("ld-temp.o", *OwnedContext), handleLTODiagnostic) {
initializeLTOPasses();
}