Document some safety constraints and use more safe wrappers

This commit is contained in:
Oli Scherer
2025-01-14 12:25:16 +00:00
parent 4b83038d63
commit dcf1e4d72b
11 changed files with 50 additions and 59 deletions

View File

@@ -241,6 +241,10 @@ pub fn set_linkage(llglobal: &Value, linkage: Linkage) {
}
}
pub fn is_declaration(llglobal: &Value) -> bool {
unsafe { LLVMIsDeclaration(llglobal) == ffi::True }
}
pub fn get_visibility(llglobal: &Value) -> Visibility {
unsafe { LLVMGetVisibility(llglobal) }.to_rust()
}