add a helper EnumType object for asking about tagtypes for enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49286 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 40b376b..c06b1d9 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -745,6 +745,12 @@
return false;
}
+bool EnumType::classof(const Type *T) {
+ if (const TagType *TT = dyn_cast<TagType>(T))
+ return isa<EnumDecl>(TT->getDecl());
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// Type Printing