21void ASTRecordLayout::Destroy(
ASTContext &Ctx) {
23 CXXInfo->~CXXRecordLayoutInfo();
37 :
Size(size), DataSize(datasize), Alignment(alignment),
38 PreferredAlignment(preferredAlignment),
39 UnadjustedAlignment(unadjustedAlignment),
40 RequiredAlignment(requiredAlignment) {
41 FieldOffsets.append(Ctx, fieldoffsets.begin(), fieldoffsets.end());
45ASTRecordLayout::ASTRecordLayout(
48 CharUnits requiredAlignment,
bool hasOwnVFPtr,
bool hasExtendableVFPtr,
53 const CXXRecordDecl *BaseSharingVBPtr,
bool EndsWithZeroSizedObject,
54 bool LeadsWithZeroSizedBase,
const BaseOffsetsMapTy &BaseOffsets,
55 const VBaseOffsetsMapTy &VBaseOffsets)
56 :
Size(size), DataSize(datasize), Alignment(alignment),
57 PreferredAlignment(preferredAlignment),
58 UnadjustedAlignment(unadjustedAlignment),
59 RequiredAlignment(requiredAlignment),
60 CXXInfo(new (Ctx) CXXRecordLayoutInfo) {
61 FieldOffsets.append(Ctx, fieldoffsets.begin(), fieldoffsets.end());
63 CXXInfo->PrimaryBase.setPointer(PrimaryBase);
64 CXXInfo->PrimaryBase.setInt(IsPrimaryBaseVirtual);
65 CXXInfo->NonVirtualSize = nonvirtualsize;
66 CXXInfo->NonVirtualAlignment = nonvirtualalignment;
67 CXXInfo->PreferredNVAlignment = preferrednvalignment;
68 CXXInfo->SizeOfLargestEmptySubobject = SizeOfLargestEmptySubobject;
69 CXXInfo->BaseOffsets = BaseOffsets;
70 CXXInfo->VBaseOffsets = VBaseOffsets;
71 CXXInfo->HasOwnVFPtr = hasOwnVFPtr;
72 CXXInfo->VBPtrOffset = vbptroffset;
73 CXXInfo->HasExtendableVFPtr = hasExtendableVFPtr;
74 CXXInfo->BaseSharingVBPtr = BaseSharingVBPtr;
75 CXXInfo->EndsWithZeroSizedObject = EndsWithZeroSizedObject;
76 CXXInfo->LeadsWithZeroSizedBase = LeadsWithZeroSizedBase;
80 if (isPrimaryBaseVirtual()) {
82 assert(getVBaseClassOffset(PrimaryBase).isZero() &&
83 "Primary virtual base must be at offset 0!");
86 assert(getBaseClassOffset(PrimaryBase).isZero() &&
87 "Primary base must be at offset 0!");
Defines the clang::ASTContext interface.
Defines the TargetCXXABI class, which abstracts details of the C++ ABI that we're targeting.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void Deallocate(void *Ptr) const
const TargetInfo & getTargetInfo() const
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Represents a C++ struct/union/class.
CharUnits - This is an opaque type for sizes expressed in character units.
bool hasPrimaryVBases() const
Does this ABI allow virtual bases to be primary base classes?
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.