pub fn const_struct(constant_vals: &[ValueRef], packed: bool) -> ValueRefExpand description
Create a ConstantStruct in the global Context.
This is the same as constStruct_in_context except it operates on the
global context.
§Details
Creates a constant struct value in the global LLVM context.
This function wraps the LLVMConstStruct function from the LLVM core library. It generates a constant
struct value using an array of constant values (constant_vals). The packed parameter allows you to specify
whether the struct should be packed, meaning that its fields are laid out without padding. This function operates
in the global LLVM context, as opposed to a specific context.
§Parameters
constant_vals: A slice of constant values &ValueRefthat will be used as the fields of the struct. Each element in this slice corresponds to a field in the struct.packed: A boolean value indicating whether the struct should be packed (truefor packed,falsefor unpacked). A packed struct has its fields tightly packed without padding.
§Returns
Returns an instance of ValueRef, which encapsulates the constant struct value created in the global context.