diff options
author | Warren Hunt <whunt@google.com> | 2013-12-06 19:54:25 +0000 |
---|---|---|
committer | Warren Hunt <whunt@google.com> | 2013-12-06 19:54:25 +0000 |
commit | 049f673dae1f0949219f072489c2f9e96f235c43 (patch) | |
tree | 5839b5adc1da7a2ec6f4dd105a349e30f3df6d2e /clang/lib/AST/RecordLayout.cpp | |
parent | 4f623205a9bcf6999ed8bf1594ab5fe97e38cdb5 (diff) | |
download | bcm5719-llvm-049f673dae1f0949219f072489c2f9e96f235c43.tar.gz bcm5719-llvm-049f673dae1f0949219f072489c2f9e96f235c43.zip |
[MS-ABI] Fix alias-avoidance padding between bases
Adds padding between bases or virtual bases in an attempt to avoid
aliasing of zero-sized sub-objects. The approach used by the ABI adds
two more bits of state. Detailed comments are in the code. Test cases
included.
Differential Revision: http://llvm-reviews.chandlerc.com/D2258
llvm-svn: 196602
Diffstat (limited to 'clang/lib/AST/RecordLayout.cpp')
-rw-r--r-- | clang/lib/AST/RecordLayout.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/RecordLayout.cpp b/clang/lib/AST/RecordLayout.cpp index a4a59c4f330..d72d5dcce0d 100644 --- a/clang/lib/AST/RecordLayout.cpp +++ b/clang/lib/AST/RecordLayout.cpp @@ -58,6 +58,8 @@ ASTRecordLayout::ASTRecordLayout(const ASTContext &Ctx, const CXXRecordDecl *PrimaryBase, bool IsPrimaryBaseVirtual, const CXXRecordDecl *BaseSharingVBPtr, + bool HasZeroSizedSubObject, + bool LeadsWithZeroSizedBase, const BaseOffsetsMapTy& BaseOffsets, const VBaseOffsetsMapTy& VBaseOffsets) : Size(size), DataSize(datasize), Alignment(alignment), @@ -80,6 +82,8 @@ ASTRecordLayout::ASTRecordLayout(const ASTContext &Ctx, CXXInfo->VBPtrOffset = vbptroffset; CXXInfo->HasExtendableVFPtr = hasExtendableVFPtr; CXXInfo->BaseSharingVBPtr = BaseSharingVBPtr; + CXXInfo->HasZeroSizedSubObject = HasZeroSizedSubObject; + CXXInfo->LeadsWithZeroSizedBase = LeadsWithZeroSizedBase; #ifndef NDEBUG |