[cfe-commits] r149038 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp
Peter Collingbourne
peter at pcc.me.uk
Wed Jan 25 19:33:46 PST 2012
Author: pcc
Date: Wed Jan 25 21:33:46 2012
New Revision: 149038
URL: http://llvm.org/viewvc/llvm-project?rev=149038&view=rev
Log:
Simplify {Record,Enum}Type::classof.
Modified:
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/lib/AST/Type.cpp
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=149038&r1=149037&r2=149038&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Wed Jan 25 21:33:46 2012
@@ -3094,8 +3094,6 @@
return T->getTypeClass() >= TagFirst && T->getTypeClass() <= TagLast;
}
static bool classof(const TagType *) { return true; }
- static bool classof(const RecordType *) { return true; }
- static bool classof(const EnumType *) { return true; }
};
/// RecordType - This is a helper class that allows the use of isa/cast/dyncast
@@ -3121,10 +3119,7 @@
bool isSugared() const { return false; }
QualType desugar() const { return QualType(this, 0); }
- static bool classof(const TagType *T);
- static bool classof(const Type *T) {
- return isa<TagType>(T) && classof(cast<TagType>(T));
- }
+ static bool classof(const Type *T) { return T->getTypeClass() == Record; }
static bool classof(const RecordType *) { return true; }
};
@@ -3143,10 +3138,7 @@
bool isSugared() const { return false; }
QualType desugar() const { return QualType(this, 0); }
- static bool classof(const TagType *T);
- static bool classof(const Type *T) {
- return isa<TagType>(T) && classof(cast<TagType>(T));
- }
+ static bool classof(const Type *T) { return T->getTypeClass() == Enum; }
static bool classof(const EnumType *) { return true; }
};
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=149038&r1=149037&r2=149038&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Wed Jan 25 21:33:46 2012
@@ -1802,14 +1802,6 @@
return cast<CXXRecordDecl>(getInterestingTagDecl(Decl));
}
-bool RecordType::classof(const TagType *TT) {
- return isa<RecordDecl>(TT->getDecl());
-}
-
-bool EnumType::classof(const TagType *TT) {
- return isa<EnumDecl>(TT->getDecl());
-}
-
IdentifierInfo *TemplateTypeParmType::getIdentifier() const {
return isCanonicalUnqualified() ? 0 : getDecl()->getIdentifier();
}
More information about the cfe-commits
mailing list