]> granicus.if.org Git - clang/commit
Add proper callbacks for DeclStmt -- we weren't recursing on
authorCraig Silverstein <csilvers2000@yahoo.com>
Wed, 28 Jul 2010 15:54:33 +0000 (15:54 +0000)
committerCraig Silverstein <csilvers2000@yahoo.com>
Wed, 28 Jul 2010 15:54:33 +0000 (15:54 +0000)
commitbe9aa9614f0f15f2182c9ac5c571a868263131ad
treeac2a5c703d77b5f320f467b3a519851888a08119
parent5ec85c6db6f7ea98a32c3c588fd2beda72424198
    Add proper callbacks for DeclStmt -- we weren't recursing on
        the decls.  This was just an oversight before; one we didn't
        catch because lots of information in a DeclStmt was also being
        traversed (redundantly) elsewhere.

        Once DeclStmt was cleaned up, I could clean up some of the
        redundant traversals found elswhere as well -- in particular,
        traversing the declarations inside a function as part of the
        function callback (instead of as part of the CompoundExpr
        callback that constitutes the body of the function).  The old
        way was really weird, and led to some parts of local variable
        declarations (but not all) being visited twice.  That is now
        resolved.  I also was able to simplify the traversers for
        IfStmt/WhileStmt/etc, which used to have redundant calls to
        work around the fact DeclStmt wasn't working properly.

        While in the area, I fixed up a few more recursion-ordering
        issues.  I try to hold to the principle that
        RecursiveASTVisitor visits objects in the source code in the
        same order they're typed.  So the return-type of a variable
        comes before the variable-name.  This still isn't perfect, but
        we're closer to that.

Reviewed by chandlerc and wan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109590 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/RecursiveASTVisitor.h