summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-07-06 23:35:33 +0000
committerAlexis Hunt <alercah@gmail.com>2011-07-06 23:35:33 +0000
commit197ec69ba78aff76dded2102b9a04cab141ccf12 (patch)
tree0987ed4d9060238d15d5c3fe90845f303efd1dae
parent92ca8fc9271d40a6eaee9262483c26e02a06ebe9 (diff)
downloadbcm5719-llvm-197ec69ba78aff76dded2102b9a04cab141ccf12.tar.gz
bcm5719-llvm-197ec69ba78aff76dded2102b9a04cab141ccf12.zip
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. llvm-svn: 134562
-rw-r--r--clang/include/clang/AST/RecursiveASTVisitor.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h
index 7cdb0adc65d..1982b351384 100644
--- a/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -1562,6 +1562,13 @@ bool RecursiveASTVisitor<Derived>::TraverseFunctionHelper(FunctionDecl *D) {
// 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(),
OpenPOWER on IntegriCloud