diff options
Diffstat (limited to 'tools/llvm-lto2')
-rw-r--r-- | tools/llvm-lto2/llvm-lto2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvm-lto2/llvm-lto2.cpp b/tools/llvm-lto2/llvm-lto2.cpp index e8bf7a397f2..1fa22a01bea 100644 --- a/tools/llvm-lto2/llvm-lto2.cpp +++ b/tools/llvm-lto2/llvm-lto2.cpp @@ -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); }; |