diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-23 23:49:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-23 23:49:00 +0000 |
commit | 79f83eda848b474a7839220bc98306ac8eb56c9f (patch) | |
tree | d32df6f4ff893e9c5f80ac484e74375327b63f96 /clang/lib/AST/ASTContext.cpp | |
parent | 91ade1419748a8b092a6e634d2a126a01fb05f2d (diff) | |
download | bcm5719-llvm-79f83eda848b474a7839220bc98306ac8eb56c9f.tar.gz bcm5719-llvm-79f83eda848b474a7839220bc98306ac8eb56c9f.zip |
This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!
llvm-svn: 76916
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 727dc4ee3d6..5572b7a3a09 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2107,6 +2107,18 @@ QualType ASTContext::getArrayDecayedType(QualType Ty) { return PtrTy.getQualifiedType(PrettyArrayType->getIndexTypeQualifier()); } +QualType ASTContext::getBaseElementType(QualType QT) { + QualifierSet qualifiers; + while (true) { + const Type *UT = qualifiers.strip(QT); + if (const ArrayType *AT = getAsArrayType(QualType(UT,0))) { + QT = AT->getElementType(); + }else { + return qualifiers.apply(QT, *this); + } + } +} + QualType ASTContext::getBaseElementType(const VariableArrayType *VAT) { QualType ElemTy = VAT->getElementType(); |