[cfe-commits] r41796 - /cfe/trunk/AST/StmtDumper.cpp

Ted Kremenek kremenek at apple.com
Mon Sep 10 10:32:56 PDT 2007


Author: kremenek
Date: Mon Sep 10 12:32:55 2007
New Revision: 41796

URL: http://llvm.org/viewvc/llvm-project?rev=41796&view=rev
Log:
Modified dumping of Decl information to including the Decl type.

Modified:
    cfe/trunk/AST/StmtDumper.cpp

Modified: cfe/trunk/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtDumper.cpp?rev=41796&r1=41795&r2=41796&view=diff

==============================================================================
--- cfe/trunk/AST/StmtDumper.cpp (original)
+++ cfe/trunk/AST/StmtDumper.cpp Mon Sep 10 12:32:55 2007
@@ -256,8 +256,25 @@
 
 void StmtDumper::VisitDeclRefExpr(DeclRefExpr *Node) {
   DumpExpr(Node);
-  fprintf(F, " Decl='%s' %p", Node->getDecl()->getName(),
-          (void*)Node->getDecl());
+
+  fprintf(F, " ");
+  switch (Node->getDecl()->getKind()) {
+    case Decl::Function: fprintf(F,"FunctionDecl"); break;
+    case Decl::BlockVariable: fprintf(F,"BlockVariable"); break;
+    case Decl::FileVariable: fprintf(F,"FileVariable"); break;
+    case Decl::ParmVariable: fprintf(F,"ParmVariable"); break;
+    case Decl::EnumConstant: fprintf(F,"EnumConstant"); break;
+    case Decl::Typedef: fprintf(F,"Typedef"); break;
+    case Decl::Struct: fprintf(F,"Struct"); break;
+    case Decl::Union: fprintf(F,"Union"); break;
+    case Decl::Class: fprintf(F,"Class"); break;
+    case Decl::Enum: fprintf(F,"Enum"); break;
+    case Decl::ObjcInterface: fprintf(F,"ObjcInterface"); break;
+    case Decl::ObjcClass: fprintf(F,"ObjcClass"); break;
+    default: fprintf(F,"Decl"); break;
+  }
+  
+  fprintf(F, "='%s' %p", Node->getDecl()->getName(), (void*)Node->getDecl());
 }
 
 void StmtDumper::VisitPreDefinedExpr(PreDefinedExpr *Node) {





More information about the cfe-commits mailing list