// the same address space, and return that.
unsigned getAddressSpace() const { return 0; }
- static bool classof(const Type *T);
+ static bool classof(const TagType *T);
+ static bool classof(const Type *T) {
+ return isa<TagType>(T) && classof(cast<TagType>(T));
+ }
static bool classof(const RecordType *) { return true; }
};
return reinterpret_cast<EnumDecl*>(TagType::getDecl());
}
- static bool classof(const Type *T);
+ static bool classof(const TagType *T);
+ static bool classof(const Type *T) {
+ return isa<TagType>(T) && classof(cast<TagType>(T));
+ }
static bool classof(const EnumType *) { return true; }
};
}
}
-bool RecordType::classof(const Type *T) {
- if (const TagType *TT = dyn_cast<TagType>(T))
- return isa<RecordDecl>(TT->getDecl());
- return false;
+bool RecordType::classof(const TagType *TT) {
+ return isa<RecordDecl>(TT->getDecl());
}
-bool EnumType::classof(const Type *T) {
- if (const TagType *TT = dyn_cast<TagType>(T))
- return isa<EnumDecl>(TT->getDecl());
- return false;
+bool EnumType::classof(const TagType *TT) {
+ return isa<EnumDecl>(TT->getDecl());
}