layout
本頁內容尚未翻譯。
cfamily.Ty.complete
Section titled “cfamily.Ty.complete”def Ty.complete {L : Constructs} (ext : TypeExtension L) (tgt : Target) (g : Globals L) (t : Ty L) : Ty LCompletes a type: each struct or union name is looked up at most as many times as there are definitions.
cfamily.Ty.tagName
Section titled “cfamily.Ty.tagName”def Ty.tagName {L : Constructs} (t : Ty L) : StringThe name of a struct or union type (complete or not), else the empty string.
cfamily.Ty.roundUp
Section titled “cfamily.Ty.roundUp”def Ty.roundUp (x : Nat) (a : Nat) : Natx rounded up to a multiple of a (a is at least 1).
cfamily.BitField
Section titled “cfamily.BitField”record BitFieldA bit-field’s width and the width of its type’s unit.
cfamily.Ty.bitFieldOf
Section titled “cfamily.Ty.bitFieldOf”def Ty.bitFieldOf {L : Constructs} (tgt : Target) (t : Ty L) : Option BitFieldWhether a type is a bit-field’s: an integer type narrower than its rank’s (C11 6.7.2.1p10).
cfamily.Placement
Section titled “cfamily.Placement”data PlacementHow a struct member is placed: whole (size and alignment in bytes), or as a bit-field (width and unit in bits, and whether it is named: an unnamed one does not align the struct).
cfamily.Ty.bytesOf
Section titled “cfamily.Ty.bytesOf”def Ty.bytesOf (width : Nat) : NatThe bytes of a width in bits, at least 1 (bool is one byte).
cfamily.Ty.startOf
Section titled “cfamily.Ty.startOf”def Ty.startOf (offset : Nat) (m : Placement) : NatWhere a member placed after an offset in bits starts (the System V ABI): a whole member at its alignment; a bit-field where the last one ended unless it would cross its unit, then at the next unit; width 0 at the next unit.
cfamily.Placement.bits
Section titled “cfamily.Placement.bits”def Placement.bits (m : Placement) : NatThe bits a member takes: a whole member’s bytes, a bit-field’s width.
cfamily.Ty.placeAll
Section titled “cfamily.Ty.placeAll”def Ty.placeAll (offset : Nat) (members : List Placement) : NatThe end in bits of members placed in order from an offset in bits.
cfamily.Ty.startsFrom
Section titled “cfamily.Ty.startsFrom”def Ty.startsFrom (offset : Nat) (members : List Placement) : List NatWhere in bits each of the members placed in order from an offset starts.
cfamily.Placement.align
Section titled “cfamily.Placement.align”def Placement.align (m : Placement) : NatA member’s alignment in bytes (an unnamed bit-field’s is 1).
cfamily.Ty.maxAlign
Section titled “cfamily.Ty.maxAlign”def Ty.maxAlign (members : List (Nat * Nat)) : NatThe greatest alignment among members, at least 1.
cfamily.Ty.structLayout
Section titled “cfamily.Ty.structLayout”def Ty.structLayout (members : List Placement) : Nat * NatA struct’s layout: members in order, the size rounded up to the greatest alignment.
cfamily.Ty.unionLayout
Section titled “cfamily.Ty.unionLayout”def Ty.unionLayout (members : List (Nat * Nat)) : Nat * NatA union’s layout: the largest member, rounded up to the greatest alignment.
cfamily.Ty.layout
Section titled “cfamily.Ty.layout”def Ty.layout {L : Constructs} (ext : TypeExtension L) (tgt : Target) (g : Globals L) (t : Ty L) : Nat * NatThe size and alignment of a type: the dialect’s own layout if it has one for the type, else the C rules.
cfamily.Ty.size
Section titled “cfamily.Ty.size”def Ty.size {L : Constructs} (ext : TypeExtension L) (tgt : Target) (g : Globals L) (t : Ty L) : NatThe size of a type in bytes.
cfamily.Ty.align
Section titled “cfamily.Ty.align”def Ty.align {L : Constructs} (ext : TypeExtension L) (tgt : Target) (g : Globals L) (t : Ty L) : NatThe alignment of a type in bytes.