Make llvm::set_section
take a &CStr
This commit is contained in:
parent
d68c327796
commit
3310419d35
3 changed files with 14 additions and 13 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue