pub fn abi_alignment(
ty: &AirType,
types: &BTreeMap<TypeId, AirType>,
) -> Option<u64>Expand description
Returns the ABI alignment in bytes for a type under System V AMD64 rules.
Uses a default pointer width of 8 bytes (64-bit). For target-aware layout,
use abi_alignment_with_ptr.
Returns None for Opaque types or types that reference unknown TypeIds.
ยงAlignment rules
Pointer/Reference-> 8Integer { bits }->min(ceil(bits/8), 16).next_power_of_two()(at least 1)Float { bits: 32 }-> 4Float { bits: 64 }-> 8Float { other }-> 8 (default for unusual float widths)Vector { element, lanes }->min(total_bytes.next_power_of_two(), 64)Array { element, .. }-> alignment of element typeStruct { fields, .. }-> max of all field alignmentsVoid-> 1Function { .. }-> 1 (function types have no meaningful alignment)Opaque->None