File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/rustc_codegen_llvm/src/back Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -405,13 +405,15 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
405405 None
406406 } ;
407407
408- let llvm_selfprofiler = if cgcx. prof . llvm_recording_enabled ( ) {
409- let mut llvm_profiler = LlvmSelfProfiler :: new ( cgcx. prof . get_self_profiler ( ) . unwrap ( ) ) ;
410- & mut llvm_profiler as * mut _ as * mut c_void
408+ let mut llvm_profiler = if cgcx. prof . llvm_recording_enabled ( ) {
409+ Some ( LlvmSelfProfiler :: new ( cgcx. prof . get_self_profiler ( ) . unwrap ( ) ) )
411410 } else {
412- std :: ptr :: null_mut ( )
411+ None
413412 } ;
414413
414+ let llvm_selfprofiler =
415+ llvm_profiler. as_mut ( ) . map ( |s| s as * mut _ as * mut c_void ) . unwrap_or ( std:: ptr:: null_mut ( ) ) ;
416+
415417 let extra_passes = config. passes . join ( "," ) ;
416418
417419 // FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
You can’t perform that action at this time.
0 commit comments