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

Argyrios Kyrtzidis kyrtzidis at apple.com
Wed Jul 6 22:49:16 PDT 2011


On Jul 6, 2011, at 4:35 PM, Sean Hunt wrote:

> 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));
> +  }
> +

Parameter declarations were visited through TypeLoc visitation, see "DEF_TRAVERSE_TYPELOC(FunctionProtoType" at RecursiveASTVisitor.h:938.
Now parameters are visited twice.

>   if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
>     // Constructor initializers.
>     for (CXXConstructorDecl::init_iterator I = Ctor->init_begin(),
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list