[cfe-commits] r83090 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Tue Sep 29 12:41:13 PDT 2009


Author: akirtzidis
Date: Tue Sep 29 14:41:13 2009
New Revision: 83090

URL: http://llvm.org/viewvc/llvm-project?rev=83090&view=rev
Log:
Introduce Type::getTypeClassName() that returns the string associated with the TypeClass enum.

Modified:
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/lib/AST/Type.cpp

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=83090&r1=83089&r2=83090&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Sep 29 14:41:13 2009
@@ -874,6 +874,8 @@
   /// 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,

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=83090&r1=83089&r2=83090&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Tue Sep 29 14:41:13 2009
@@ -668,6 +668,15 @@
   }
 }
 
+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!");





More information about the cfe-commits mailing list