Consistently use safe wrapper function set_section
This commit is contained in:
parent
1e4f10ba64
commit
65ff2a6ad7
7 changed files with 18 additions and 18 deletions
|
@ -145,10 +145,8 @@ pub(crate) fn compile_codegen_unit(
|
|||
|
||||
pub(crate) fn set_link_section(llval: &Value, attrs: &CodegenFnAttrs) {
|
||||
let Some(sect) = attrs.link_section else { return };
|
||||
unsafe {
|
||||
let buf = SmallCStr::new(sect.as_str());
|
||||
llvm::LLVMSetSection(llval, buf.as_ptr());
|
||||
}
|
||||
let buf = SmallCStr::new(sect.as_str());
|
||||
llvm::set_section(llval, &buf);
|
||||
}
|
||||
|
||||
pub(crate) fn linkage_to_llvm(linkage: Linkage) -> llvm::Linkage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue