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 | |
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
-rw-r--r-- | include/clang/AST/Type.h | 2 | ||||
-rw-r--r-- | lib/AST/Type.cpp | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index c3fe86ce34..952671915f 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -874,6 +874,8 @@ public: /// set of type specifiers. bool isSpecifierType() const; + const char *getTypeClassName() const; + QualType getCanonicalTypeInternal() const { return CanonicalType; } void dump() const; virtual void getAsStringInternal(std::string &InnerString, 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!"); |