diff options
author | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
commit | 0d70d71ccbc4f7f59cadb759f61b7172a149676c (patch) | |
tree | 027a6fb58fc309c2111963092aef4742f3cdf731 /include/clang/AST/Type.h | |
parent | e3c8c64e7735c3589e1a34e6000c93183a55920c (diff) |
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic. Fixes PR 9197.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Type.h')
-rw-r--r-- | include/clang/AST/Type.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 7d7c8b02ec..8a983fb8a1 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -692,6 +692,19 @@ public: return getObjCGCAttr() == Qualifiers::Strong; } + enum DestructionKind { + DK_none, + DK_cxx_destructor + }; + + /// isDestructedType - nonzero if objects of this type require + /// non-trivial work to clean up after. Non-zero because it's + /// conceivable that qualifiers (objc_gc(weak)?) could make + /// something require destruction. + DestructionKind isDestructedType() const { + return isDestructedTypeImpl(*this); + } + private: // These methods are implemented in a separate translation unit; // "static"-ize them to avoid creating temporary QualTypes in the @@ -701,6 +714,7 @@ private: static SplitQualType getSplitDesugaredType(QualType T); static SplitQualType getSplitUnqualifiedTypeImpl(QualType type); static QualType IgnoreParens(QualType T); + static DestructionKind isDestructedTypeImpl(QualType type); }; } // end clang. |