Use LLVM-C APIs for getting/setting linkage

This commit is contained in:
Zalathar
2024-10-25 22:06:29 +11:00
parent ec41e6d1b0
commit 96993a9b5e
3 changed files with 24 additions and 93 deletions

View File

@@ -233,12 +233,12 @@ pub fn set_global_constant(llglobal: &Value, is_constant: bool) {
}
pub fn get_linkage(llglobal: &Value) -> Linkage {
unsafe { LLVMRustGetLinkage(llglobal) }
unsafe { LLVMGetLinkage(llglobal) }.to_rust()
}
pub fn set_linkage(llglobal: &Value, linkage: Linkage) {
unsafe {
LLVMRustSetLinkage(llglobal, linkage);
LLVMSetLinkage(llglobal, linkage);
}
}