if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r)
This commit is contained in:
@@ -412,11 +412,7 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option<CString> {
|
||||
}
|
||||
|
||||
fn get_instr_profile_output_path(config: &ModuleConfig) -> Option<CString> {
|
||||
if config.instrument_coverage {
|
||||
Some(CString::new("default_%m_%p.profraw").unwrap())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
config.instrument_coverage.then(|| CString::new("default_%m_%p.profraw").unwrap())
|
||||
}
|
||||
|
||||
pub(crate) unsafe fn llvm_optimize(
|
||||
@@ -451,11 +447,10 @@ pub(crate) unsafe fn llvm_optimize(
|
||||
None
|
||||
};
|
||||
|
||||
let mut llvm_profiler = if cgcx.prof.llvm_recording_enabled() {
|
||||
Some(LlvmSelfProfiler::new(cgcx.prof.get_self_profiler().unwrap()))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let mut llvm_profiler = cgcx
|
||||
.prof
|
||||
.llvm_recording_enabled()
|
||||
.then(|| LlvmSelfProfiler::new(cgcx.prof.get_self_profiler().unwrap()));
|
||||
|
||||
let llvm_selfprofiler =
|
||||
llvm_profiler.as_mut().map(|s| s as *mut _ as *mut c_void).unwrap_or(std::ptr::null_mut());
|
||||
|
||||
Reference in New Issue
Block a user