1
Fork 0

Add hotness data to LLVM remarks

This makes sure that if PGO is used, remarks generated using `-Zremark-dir` will include the `Hotness` attribute.
This commit is contained in:
Jakub Beránek 2023-08-03 23:24:58 +02:00
parent 2e6ac7fe5b
commit 93bdc01adf
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
3 changed files with 25 additions and 0 deletions

View file

@ -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,