Only enable hotness information when PGO is available
This commit is contained in:
parent
93bdc01adf
commit
9d417d7c86
4 changed files with 13 additions and 3 deletions
|
@ -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> 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<ToolOutputFile>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue