[cfe-commits] r134562 - /cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Sean Hunt scshunt at csclub.uwaterloo.ca
Wed Jul 6 16:35:33 PDT 2011


Author: coppro
Date: Wed Jul  6 18:35:33 2011
New Revision: 134562

URL: http://llvm.org/viewvc/llvm-project?rev=134562&view=rev
Log:
Ensure that we actually visit function parameter declarations with
RecursiveASTVisitor.

This deficiency was discovered while working with the AST matcher
framework and likely impacts other users of RecursiveASTMatcher who
previously weren't seeing these Decls in their visitation.

Patch reviewed by Chandler Carruth.

Modified:
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=134562&r1=134561&r2=134562&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Wed Jul  6 18:35:33 2011
@@ -1562,6 +1562,13 @@
   // including exception specifications.
   TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
 
+  // Parameter declarations
+  for (FunctionDecl::param_iterator I = D->param_begin(),
+                                    E = D->param_end();
+       I != E; ++I) {
+    TRY_TO(TraverseDecl(*I));
+  }
+
   if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
     // Constructor initializers.
     for (CXXConstructorDecl::init_iterator I = Ctor->init_begin(),





More information about the cfe-commits mailing list