]> granicus.if.org Git - clang/commitdiff
Modified dumping of Decl information to including the Decl type.
authorTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2007 17:32:55 +0000 (17:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2007 17:32:55 +0000 (17:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41796 91177308-0d34-0410-b5e6-96231b3b80d8

AST/StmtDumper.cpp

index ea43ad72a193cba652f19be38c1657fd6460312a..332931b414e0bac09ddeaa309cd7ddbce37844c2 100644 (file)
@@ -256,8 +256,25 @@ void StmtDumper::VisitExpr(Expr *Node) {
 
 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) {