aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-26 21:31:17 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-26 21:31:17 +0000
commitfb87b89fc9eb103e19fb8e4b925c23f0bd091b99 (patch)
tree1879da6f7c614cff39a0b716a078419b6a1c602f /lib/AST/Type.cpp
parent5512ba538f3f6b0576623f680fa7d930fa085ccd (diff)
Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to isStructureOrClassType() as needed (which is alsmost everywhere). Fixes the remaining failure in Boost.Utility/Swap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 27a277ddbc..d21890daf7 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -225,6 +225,11 @@ bool Type::isStructureType() const {
return RT->getDecl()->isStruct();
return false;
}
+bool Type::isStructureOrClassType() const {
+ if (const RecordType *RT = getAs<RecordType>())
+ return RT->getDecl()->isStruct() || RT->getDecl()->isClass();
+ return false;
+}
bool Type::isVoidPointerType() const {
if (const PointerType *PT = getAs<PointerType>())
return PT->getPointeeType()->isVoidType();