]> granicus.if.org Git - clang/commitdiff
Introduce Type::getTypeClassName() that returns the string associated with the TypeCl...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 29 Sep 2009 19:41:13 +0000 (19:41 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 29 Sep 2009 19:41:13 +0000 (19:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83090 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Type.h
lib/AST/Type.cpp

index c3fe86ce3485d77ed6f98bf0b828a898d9b97d82..952671915f25a57e3576f7f70f1f55ec2765cf21 100644 (file)
@@ -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,
index bda06ace1bc9c3bb21c1c457eb25d94fdc6b4a5a..c3eade2cb9611dccae9f58e1313abb4abe4d52cf 100644 (file)
@@ -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!");