layouts
cpp.ClassLayout
Section titled “cpp.ClassLayout”record ClassLayoutA class’s size, alignment and data size (its size without the tail padding).
cpp.Layouts.depth
Section titled “cpp.Layouts.depth”def Layouts.depth : NatHow deep classes nest at most in a layout (a bound for the recursion over the hierarchy).
cpp.Layouts.plain
Section titled “cpp.Layouts.plain”def Layouts.plain (ext : TypeExtension Cpp.constructs) (tgt : Target) (t : Ty Cpp.constructs) : ClassLayoutThe layout of a type by C’s rules (its whole size its data).
cpp.Layouts.classNamed
Section titled “cpp.Layouts.classNamed”def Layouts.classNamed (g : Globals Cpp.constructs) (x : String) : Option ClassMembersThe class of a name in the tables, if it is one.
cpp.Layouts.isBase
Section titled “cpp.Layouts.isBase”def Layouts.isBase (f : FieldTy Cpp.constructs) : BoolWhether a field is a base subobject.
cpp.Layouts.isVirtualStorage
Section titled “cpp.Layouts.isVirtualStorage”def Layouts.isVirtualStorage (f : FieldTy Cpp.constructs) : BoolWhether a field is where a complete object keeps a virtual base.
cpp.Layouts.isHidden
Section titled “cpp.Layouts.isHidden”def Layouts.isHidden (f : FieldTy Cpp.constructs) : BoolWhether a field takes no room of its own: a pointer to a virtual base, or the construction contexts (the virtual table pointer stands for them).
cpp.Layouts.needsPointer
Section titled “cpp.Layouts.needsPointer”def Layouts.needsPointer (g : Globals Cpp.constructs) (cls : ClassMembers) (fs : List (FieldTy Cpp.constructs)) : BoolWhether a class (with its fields) needs a virtual table pointer it has no member for: it keeps virtual bases, has no dynamic type of its own, and its first base (non-virtual) has no virtual table to share.
cpp.Layouts.isWritten
Section titled “cpp.Layouts.isWritten”def Layouts.isWritten (f : FieldTy Cpp.constructs) : BoolWhether a field is a data member the program wrote (not a base, nor the dynamic type).
cpp.Layouts.nameOf
Section titled “cpp.Layouts.nameOf”def Layouts.nameOf (f : FieldTy Cpp.constructs) : StringA field’s name.
cpp.Layouts.typeOf
Section titled “cpp.Layouts.typeOf”def Layouts.typeOf (f : FieldTy Cpp.constructs) : Ty Cpp.constructsA field’s type.
cpp.Layouts.access
Section titled “cpp.Layouts.access”def Layouts.access (cls : ClassMembers) (f : FieldTy Cpp.constructs) : AccessA field’s access in its class (public when the class does not list it).
cpp.Layouts.sameAccess
Section titled “cpp.Layouts.sameAccess”def Layouts.sameAccess (a : Access) (b : Access) : BoolWhether two accesses are the same.
cpp.Layouts.isTrivial
Section titled “cpp.Layouts.isTrivial”def Layouts.isTrivial (cls : ClassMembers) : BoolWhether a class is trivial for the layout: no constructors, destructor, virtual functions or assignment operator.
cpp.Layouts.ofClass
Section titled “cpp.Layouts.ofClass”def Layouts.ofClass (ext : TypeExtension Cpp.constructs) (tgt : Target) (g : Globals Cpp.constructs) (t : Ty Cpp.constructs) : Option (Nat * Nat)A class’s size and alignment by the Itanium C++ ABI, for a dialect’s layout (none for a type that is not a class), given the extension that lays out C++’s own types.