[cfe-commits] r62153 - /cfe/trunk/Driver/ASTConsumers.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Jan 12 22:25:33 PST 2009


Author: zhongxingxu
Date: Tue Jan 13 00:25:33 2009
New Revision: 62153

URL: http://llvm.org/viewvc/llvm-project?rev=62153&view=rev
Log:
Print function parameters in DeclContextPrinter.

Modified:
    cfe/trunk/Driver/ASTConsumers.cpp

Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=62153&r1=62152&r2=62153&view=diff

==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Tue Jan 13 00:25:33 2009
@@ -644,6 +644,18 @@
     else
       Out << "<function> ";
     Out << FD->getNameAsString();
+    // Print the parameters.
+    Out << "(";
+    bool PrintComma = false;
+    for (FunctionDecl::param_const_iterator I = FD->param_begin(), 
+           E = FD->param_end(); I != E; ++I) {
+      if (PrintComma)
+        Out << ", ";
+      else
+        PrintComma = true;
+      Out << (*I)->getNameAsString();
+    }
+    Out << ")";
     break;
   }
   case Decl::CXXMethod: {
@@ -655,6 +667,18 @@
     else
       Out << "<c++ method> ";
     Out << D->getNameAsString();
+    // Print the parameters.
+    Out << "(";
+    bool PrintComma = false;
+    for (FunctionDecl::param_const_iterator I = D->param_begin(), 
+           E = D->param_end(); I != E; ++I) {
+      if (PrintComma)
+        Out << ", ";
+      else
+        PrintComma = true;
+      Out << (*I)->getNameAsString();
+    }
+    Out << ")";
 
     // Check the semantic DeclContext.
     DeclContext* SemaDC = D->getDeclContext();
@@ -673,6 +697,19 @@
     else
       Out << "<c++ ctor> ";
     Out << D->getNameAsString();
+    // Print the parameters.
+    Out << "(";
+    bool PrintComma = false;
+    for (FunctionDecl::param_const_iterator I = D->param_begin(), 
+           E = D->param_end(); I != E; ++I) {
+      if (PrintComma)
+        Out << ", ";
+      else
+        PrintComma = true;
+      Out << (*I)->getNameAsString();
+    }
+    Out << ")";
+
     // Check the semantic DC.
     DeclContext* SemaDC = D->getDeclContext();
     DeclContext* LexicalDC = D->getLexicalDeclContext();





More information about the cfe-commits mailing list