Replace the llvm::Bool typedef with a proper newtype

This commit is contained in:
Zalathar
2025-08-24 15:05:26 +10:00
parent 4eedad3126
commit 455a67bd4f
8 changed files with 75 additions and 34 deletions

View File

@@ -215,7 +215,7 @@ pub(crate) fn set_initializer(llglobal: &Value, constant_val: &Value) {
}
pub(crate) fn set_global_constant(llglobal: &Value, is_constant: bool) {
LLVMSetGlobalConstant(llglobal, if is_constant { ffi::True } else { ffi::False });
LLVMSetGlobalConstant(llglobal, is_constant.to_llvm_bool());
}
pub(crate) fn get_linkage(llglobal: &Value) -> Linkage {
@@ -229,7 +229,7 @@ pub(crate) fn set_linkage(llglobal: &Value, linkage: Linkage) {
}
pub(crate) fn is_declaration(llglobal: &Value) -> bool {
unsafe { LLVMIsDeclaration(llglobal) == ffi::True }
unsafe { LLVMIsDeclaration(llglobal) }.is_true()
}
pub(crate) fn get_visibility(llglobal: &Value) -> Visibility {