File tree 1 file changed +6
-4
lines changed
compiler/rustc_codegen_llvm/src/back
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(
405
405
None
406
406
} ;
407
407
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 ( ) ) )
411
410
} else {
412
- std :: ptr :: null_mut ( )
411
+ None
413
412
} ;
414
413
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
+
415
417
let extra_passes = config. passes . join ( "," ) ;
416
418
417
419
// FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
You can’t perform that action at this time.
0 commit comments