diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-03 23:18:17 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-03 23:18:17 +0000 |
commit | 34374e6ce5710a91c478f69379220ff20c3e7f15 (patch) | |
tree | c8ba1e3883eafe3528fd4e84a04f1a5310f76a07 /include/clang | |
parent | 366200045fc30290795e037ab2cb417ddd3c9933 (diff) |
Patch to instantiate destructors used to destruct
base and data members when they are needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 37666d4c75..ce6e925a9a 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -1095,12 +1095,13 @@ public: /// }; /// @endcode class CXXDestructorDecl : public CXXMethodDecl { +public: enum KindOfObjectToDestroy { VBASE = 0x1, DRCTNONVBASE = 0x2, ANYBASE = 0x3 }; - +private: /// ImplicitlyDefined - Whether this destructor was implicitly /// defined by the compiler. When false, the destructor was defined /// by the user. In C++03, this flag will have the same value as @@ -1181,12 +1182,24 @@ public: return NumBaseOrMemberDestructions; } - /// getBaseOrMember - get the generic 'member' representing either the field - /// or a base class. + /// setNumBaseOrMemberDestructions - Set number of base and non-static members + /// to destroy. + void setNumBaseOrMemberDestructions(unsigned numBaseOrMemberDestructions) { + NumBaseOrMemberDestructions = numBaseOrMemberDestructions; + } + + /// getBaseOrMemberToDestroy - get the generic 'member' representing either + /// the field or a base class. uintptr_t* getBaseOrMemberToDestroy() const { return BaseOrMemberDestructions; } + /// setBaseOrMemberToDestroy - set the generic 'member' representing either + /// the field or a base class. + void setBaseOrMemberDestructions(uintptr_t* baseOrMemberDestructions) { + BaseOrMemberDestructions = baseOrMemberDestructions; + } + /// isVbaseToDestroy - returns true, if object is virtual base. bool isVbaseToDestroy(uintptr_t Vbase) const { return (Vbase & VBASE) != 0; @@ -1229,12 +1242,6 @@ public: return reinterpret_cast<Type*>(Base & ~0x02); return 0; } - - /// computeBaseOrMembersToDestroy - Compute information in current - /// destructor decl's AST of bases and non-static data members which will be - /// implicitly destroyed. We are storing the destruction in the order that - /// they should occur (which is the reverse of construction order). - void computeBaseOrMembersToDestroy(ASTContext &C); // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { |