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
|
@ -320,6 +320,7 @@ impl<'a> DiagnosticHandlers<'a> {
|
|||
})
|
||||
.and_then(|dir| dir.to_str().and_then(|p| CString::new(p).ok()));
|
||||
|
||||
let pgo_available = cgcx.opts.cg.profile_use.is_some();
|
||||
let data = Box::into_raw(Box::new((cgcx, handler)));
|
||||
unsafe {
|
||||
let old_handler = llvm::LLVMRustContextGetDiagnosticHandler(llcx);
|
||||
|
@ -333,6 +334,7 @@ impl<'a> DiagnosticHandlers<'a> {
|
|||
// The `as_ref()` is important here, otherwise the `CString` will be dropped
|
||||
// too soon!
|
||||
remark_file.as_ref().map(|dir| dir.as_ptr()).unwrap_or(std::ptr::null()),
|
||||
pgo_available,
|
||||
);
|
||||
DiagnosticHandlers { data, llcx, old_handler }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue