Fix use after drop in self-profile with llvm events
This commit is contained in:
parent
50f9f7810c
commit
d90934ce87
1 changed files with 6 additions and 4 deletions
|
@ -405,13 +405,15 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let llvm_selfprofiler = if cgcx.prof.llvm_recording_enabled() {
|
let mut llvm_profiler = if cgcx.prof.llvm_recording_enabled() {
|
||||||
let mut llvm_profiler = LlvmSelfProfiler::new(cgcx.prof.get_self_profiler().unwrap());
|
Some(LlvmSelfProfiler::new(cgcx.prof.get_self_profiler().unwrap()))
|
||||||
&mut llvm_profiler as *mut _ as *mut c_void
|
|
||||||
} else {
|
} else {
|
||||||
std::ptr::null_mut()
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let llvm_selfprofiler =
|
||||||
|
llvm_profiler.as_mut().map(|s| s as *mut _ as *mut c_void).unwrap_or(std::ptr::null_mut());
|
||||||
|
|
||||||
let extra_passes = config.passes.join(",");
|
let extra_passes = config.passes.join(",");
|
||||||
|
|
||||||
// FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
|
// FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue