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

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Apr 8 16:35:26 PDT 2011


Author: akirtzidis
Date: Fri Apr  8 18:35:25 2011
New Revision: 129169

URL: http://llvm.org/viewvc/llvm-project?rev=129169&view=rev
Log:
Properly traverse a ObjCMethodDecl in RecursiveASTVisitor.

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=129169&r1=129168&r2=129169&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Fri Apr  8 18:35:25 2011
@@ -1172,9 +1172,17 @@
   })
 
 DEF_TRAVERSE_DECL(ObjCMethodDecl, {
-    // We don't traverse nodes in param_begin()/param_end(), as they
-    // appear in decls_begin()/decls_end() and thus are handled.
-    TRY_TO(TraverseStmt(D->getBody()));
+    if (D->getResultTypeSourceInfo()) {
+      TRY_TO(TraverseTypeLoc(D->getResultTypeSourceInfo()->getTypeLoc()));
+    }
+    for (ObjCMethodDecl::param_iterator
+           I = D->param_begin(), E = D->param_end(); I != E; ++I) {
+      TRY_TO(TraverseDecl(*I));
+    }
+    if (D->isThisDeclarationADefinition()) {
+      TRY_TO(TraverseStmt(D->getBody()));
+    }
+    return true;
   })
 
 DEF_TRAVERSE_DECL(ObjCPropertyDecl, {





More information about the cfe-commits mailing list