[llvm] r290463 - llvm-lto2: Print diagnostics before exiting (NFC)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 23 15:54:17 PST 2016
Author: mehdi_amini
Date: Fri Dec 23 17:54:17 2016
New Revision: 290463
URL: http://llvm.org/viewvc/llvm-project?rev=290463&view=rev
Log:
llvm-lto2: Print diagnostics before exiting (NFC)
Modified:
llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp
Modified: llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp?rev=290463&r1=290462&r2=290463&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp (original)
+++ llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp Fri Dec 23 17:54:17 2016
@@ -18,6 +18,7 @@
#include "llvm/LTO/Caching.h"
#include "llvm/CodeGen/CommandFlags.h"
+#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/LTO/LTO.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/TargetSelect.h"
@@ -157,7 +158,10 @@ int main(int argc, char **argv) {
std::vector<std::unique_ptr<MemoryBuffer>> MBs;
Config Conf;
- Conf.DiagHandler = [](const DiagnosticInfo &) {
+ Conf.DiagHandler = [](const DiagnosticInfo &DI) {
+ DiagnosticPrinterRawOStream DP(errs());
+ DI.print(DP);
+ errs() << '\n';
exit(1);
};
More information about the llvm-commits
mailing list