about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2023-08-03 23:24:58 +0200
committerJakub Beránek <berykubik@gmail.com>2023-08-04 10:31:00 +0200
commit93bdc01adf7091e473e36620d3f748ce0481f880 (patch)
treebaa9159f649f10625a40aea5f033a8a186f5afe3 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent2e6ac7fe5bb96bcc2d8c0b3e20db7cf7d2baa241 (diff)
downloadrust-93bdc01adf7091e473e36620d3f748ce0481f880.tar.gz
rust-93bdc01adf7091e473e36620d3f748ce0481f880.zip
Add hotness data to LLVM remarks
This makes sure that if PGO is used, remarks generated using `-Zremark-dir` will include the `Hotness` attribute.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index 8ef39a6c866..8c04a430573 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -1967,6 +1967,9 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
   std::unique_ptr<LLVMRemarkStreamer> LlvmRemarkStreamer;
 
   if (RemarkFilePath != nullptr) {
+    // Enable PGO hotness data for remarks, if available
+    unwrap(C)->setDiagnosticsHotnessRequested(true);
+
     std::error_code EC;
     RemarkFile = std::make_unique<ToolOutputFile>(
       RemarkFilePath,