diff options
author | Anders Carlsson <andersca@mac.com> | 2010-04-21 19:52:01 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-04-21 19:52:01 +0000 |
commit | 711f34adb886cce8ba86c7b1b6513a1eaaf63bb5 (patch) | |
tree | 2924029db55c4ce8e5e78220e02c7aca80c3c434 /lib/Sema/SemaInit.h | |
parent | 46c54fb8ec45765a475b7b709b9aee7f94c490c2 (diff) |
Keep tack of whether a base in an InitializedEntity is an inherited virtual base or not. Use this in CheckConstructorAccess.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.h')
-rw-r--r-- | lib/Sema/SemaInit.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Sema/SemaInit.h b/lib/Sema/SemaInit.h index db987ec296..bfbb0f4049 100644 --- a/lib/Sema/SemaInit.h +++ b/lib/Sema/SemaInit.h @@ -92,11 +92,12 @@ private: unsigned Location; /// \brief When Kind == EK_Base, the base specifier that provides the - /// base class. - CXXBaseSpecifier *Base; + /// base class. The lower bit specifies whether the base is an inherited + /// virtual base. + uintptr_t Base; - /// \brief When Kind = EK_ArrayElement or EK_VectorElement, the - /// index of the array or vector element being initialized. + /// \brief When Kind == EK_ArrayElement or EK_VectorElement, the + /// index of the array or vector element being initialized. unsigned Index; }; @@ -168,7 +169,8 @@ public: /// \brief Create the initialization entity for a base class subobject. static InitializedEntity InitializeBase(ASTContext &Context, - CXXBaseSpecifier *Base); + CXXBaseSpecifier *Base, + bool IsInheritedVirtualBase); /// \brief Create the initialization entity for a member subobject. static InitializedEntity InitializeMember(FieldDecl *Member, @@ -204,7 +206,13 @@ public: /// \brief Retrieve the base specifier. CXXBaseSpecifier *getBaseSpecifier() const { assert(getKind() == EK_Base && "Not a base specifier"); - return Base; + return reinterpret_cast<CXXBaseSpecifier *>(Base & ~0x1); + } + + /// \brief Return whether the base is an inherited virtual base. + bool isInheritedVirtualBase() const { + assert(getKind() == EK_Base && "Not a base specifier"); + return Base & 0x1; } /// \brief Determine the location of the 'return' keyword when initializing |