librustc_llvm: Show PGO diagnostics properly.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2018-03-12 18:11:59 +01:00
parent aaeb40ab3b
commit a95c8c66a7
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 16 additions and 2 deletions

View file

@ -498,8 +498,13 @@ unsafe extern "C" fn diagnostic_handler(info: DiagnosticInfoRef, user: *mut c_vo
opt.message));
}
}
_ => (),
llvm::diagnostic::PGO(diagnostic_ref) => {
let msg = llvm::build_string(|s| {
llvm::LLVMRustWriteDiagnosticInfoToString(diagnostic_ref, s)
}).expect("non-UTF8 PGO diagnostic");
diag_handler.note_without_error(&msg);
}
llvm::diagnostic::UnknownDiagnostic(..) => {},
}
}