Make llvm::set_section take a &CStr

This commit is contained in:
Zalathar 2024-10-18 21:43:37 +11:00
parent d68c327796
commit 3310419d35
3 changed files with 14 additions and 13 deletions

View file

@ -210,10 +210,9 @@ impl MemoryEffects {
}
}
pub fn set_section(llglobal: &Value, section_name: &str) {
let section_name_cstr = CString::new(section_name).expect("unexpected CString error");
pub fn set_section(llglobal: &Value, section_name: &CStr) {
unsafe {
LLVMSetSection(llglobal, section_name_cstr.as_ptr());
LLVMSetSection(llglobal, section_name.as_ptr());
}
}