llvm-lto2: Print diagnostics before exiting (NFC)

llvm-svn: 290463
This commit is contained in:
Mehdi Amini 2016-12-23 23:54:17 +00:00
parent 4c80946850
commit 14f19bd012
1 changed files with 5 additions and 1 deletions

View File

@ -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);
};