diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-12-23 23:54:17 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-12-23 23:54:17 +0000 |
commit | de4b9a37d441526b6a7ce5712c33b5f19bbbddff (patch) | |
tree | 886085ff242615cb9902ea63c8cf68f41bbee6b4 /tools/llvm-lto2 | |
parent | cda4dc6c3dba4cb52fa2e0b91722998eb1d64988 (diff) |
llvm-lto2: Print diagnostics before exiting (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290463 91177308-0d34-0410-b5e6-96231b3b80d8
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); }; |