Use c"lit" for CStrings without unwrap

This commit is contained in:
Kornel 2024-11-30 20:32:00 +00:00
parent 3bff51ea91
commit eadea7764e
No known key found for this signature in database
14 changed files with 38 additions and 50 deletions

View file

@ -148,7 +148,7 @@ fn prepare_lto(
// __llvm_profile_counter_bias is pulled in at link time by an undefined reference to
// __llvm_profile_runtime, therefore we won't know until link time if this symbol
// should have default visibility.
symbols_below_threshold.push(CString::new("__llvm_profile_counter_bias").unwrap());
symbols_below_threshold.push(c"__llvm_profile_counter_bias".to_owned());
Ok((symbols_below_threshold, upstream_modules))
}

View file

@ -509,7 +509,7 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option<CString> {
}
fn get_instr_profile_output_path(config: &ModuleConfig) -> Option<CString> {
config.instrument_coverage.then(|| CString::new("default_%m_%p.profraw").unwrap())
config.instrument_coverage.then(|| c"default_%m_%p.profraw".to_owned())
}
pub(crate) unsafe fn llvm_optimize(