diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-06 21:58:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-06 21:58:47 +0000 |
commit | 5edb8bfe8472e7d7bf6a82386394ef27359eb846 (patch) | |
tree | 1823bf52b6856781ecb13418c66a0cbe84b765d4 /lib/AST/Type.cpp | |
parent | 984d0b414bc76d3530b9bc55a5a55834ba76c607 (diff) |
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
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 40b376bbd9..c06b1d9914 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -745,6 +745,12 @@ bool RecordType::classof(const Type *T) { 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 |