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

@@ -20,7 +20,7 @@ use tracing::debug;
use crate::consts::const_alloc_to_llvm;
pub(crate) use crate::context::CodegenCx;
use crate::context::{GenericCx, SCx};
use crate::llvm::{self, BasicBlock, Bool, ConstantInt, False, Metadata, True};
use crate::llvm::{self, BasicBlock, ConstantInt, False, Metadata, ToLlvmBool, True};
use crate::type_::Type;
use crate::value::Value;
@@ -392,7 +392,7 @@ fn struct_in_context<'ll>(
packed: bool,
) -> &'ll Value {
let len = c_uint::try_from(elts.len()).expect("LLVMConstStructInContext elements len overflow");
unsafe { llvm::LLVMConstStructInContext(llcx, elts.as_ptr(), len, packed as Bool) }
unsafe { llvm::LLVMConstStructInContext(llcx, elts.as_ptr(), len, packed.to_llvm_bool()) }
}
#[inline]