diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:41:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:41:13 +0000 |
commit | cd01f17358dc8ef19338c0e2321138dd0a6160d9 (patch) | |
tree | 3bb2ffa1dab5333619e981ea97a2ddbb1857d6e3 /lib/AST/Type.cpp | |
parent | 68006af18fb880cd8547ce797152111b810aa0ba (diff) |
Introduce Type::getTypeClassName() that returns the string associated with the TypeClass enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index bda06ace1b..c3eade2cb9 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -668,6 +668,15 @@ bool Type::isSpecifierType() const { } } +const char *Type::getTypeClassName() const { + switch (TC) { + default: assert(0 && "Type class not in TypeNodes.def!"); +#define ABSTRACT_TYPE(Derived, Base) +#define TYPE(Derived, Base) case Derived: return #Derived; +#include "clang/AST/TypeNodes.def" + } +} + const char *BuiltinType::getName(const LangOptions &LO) const { switch (getKind()) { default: assert(0 && "Unknown builtin type!"); |