From 9d417d7c86259498855fc50ba0e853edbb13320d Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Mon, 7 Aug 2023 17:56:57 +0200 Subject: Only enable hotness information when PGO is available --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 8c04a430573..a701827e057 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1869,7 +1869,8 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler( LLVMContextRef C, LLVMDiagnosticHandlerTy DiagnosticHandlerCallback, void *DiagnosticHandlerContext, bool RemarkAllPasses, const char * const * RemarkPasses, size_t RemarkPassesLen, - const char * RemarkFilePath + const char * RemarkFilePath, + bool PGOAvailable ) { class RustDiagnosticHandler final : public DiagnosticHandler { @@ -1967,8 +1968,10 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler( std::unique_ptr LlvmRemarkStreamer; if (RemarkFilePath != nullptr) { - // Enable PGO hotness data for remarks, if available - unwrap(C)->setDiagnosticsHotnessRequested(true); + if (PGOAvailable) { + // Enable PGO hotness data for remarks, if available + unwrap(C)->setDiagnosticsHotnessRequested(true); + } std::error_code EC; RemarkFile = std::make_unique( -- cgit 1.4.1-3-g733a5