From: Alp Toker Date: Sun, 18 May 2014 18:38:28 +0000 (+0000) Subject: Ongoing RAV reunification X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6ad4257fd5dabd075514011a8e6a2f068c4de66;p=clang Ongoing RAV reunification * Shuffle around code to reduce delta between the two RAVs. * Merge r189185 that was applied only to one of the RAVs and became apparent during the unification work. * Fix Enqueue data recursion typo. Our delta is down to +-579! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209093 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DataRecursiveASTVisitor.h b/include/clang/AST/DataRecursiveASTVisitor.h index 27d78a75d1..e326bd4af0 100644 --- a/include/clang/AST/DataRecursiveASTVisitor.h +++ b/include/clang/AST/DataRecursiveASTVisitor.h @@ -107,7 +107,7 @@ namespace clang { /// Note that since WalkUpFromFoo() calls WalkUpFromBar() (where Bar /// is Foo's super class) before calling VisitFoo(), the result is /// that the Visit*() methods for a given node are called in the -/// top-down order (e.g. for a node of type NamedDecl, the order will +/// top-down order (e.g. for a node of type NamespaceDecl, the order will /// be VisitDecl(), VisitNamedDecl(), and then VisitNamespaceDecl()). /// /// This scheme guarantees that all Visit*() calls for the same AST @@ -462,16 +462,16 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { if (!S) return true; - StmtsTy Queue, StmtsToEnqueu; + StmtsTy Queue, StmtsToEnqueue; Queue.push_back(S); - NewQueueRAII NQ(StmtsToEnqueu, *this); + NewQueueRAII NQ(StmtsToEnqueue, *this); while (!Queue.empty()) { S = Queue.pop_back_val(); if (!S) continue; - StmtsToEnqueu.clear(); + StmtsToEnqueue.clear(); #define DISPATCH_STMT(NAME, CLASS, VAR) \ TRY_TO(Traverse##NAME(static_cast(VAR))); \ @@ -522,8 +522,8 @@ bool RecursiveASTVisitor::TraverseStmt(Stmt *S) { } } - for (SmallVectorImpl::reverse_iterator RI = StmtsToEnqueu.rbegin(), - RE = StmtsToEnqueu.rend(); + for (SmallVectorImpl::reverse_iterator RI = StmtsToEnqueue.rbegin(), + RE = StmtsToEnqueue.rend(); RI != RE; ++RI) Queue.push_back(*RI); } @@ -810,10 +810,10 @@ DEF_TRAVERSE_TYPE(MemberPointerType, { TRY_TO(TraverseType(T->getPointeeType())); }) -DEF_TRAVERSE_TYPE(DecayedType, { TRY_TO(TraverseType(T->getOriginalType())); }) - DEF_TRAVERSE_TYPE(AdjustedType, { TRY_TO(TraverseType(T->getOriginalType())); }) +DEF_TRAVERSE_TYPE(DecayedType, { TRY_TO(TraverseType(T->getOriginalType())); }) + DEF_TRAVERSE_TYPE(ConstantArrayType, { TRY_TO(TraverseType(T->getElementType())); }) @@ -1637,6 +1637,8 @@ bool RecursiveASTVisitor::TraverseDeclaratorHelper(DeclaratorDecl *D) { return true; } +DEF_TRAVERSE_DECL(MSPropertyDecl, { TRY_TO(TraverseDeclaratorHelper(D)); }) + DEF_TRAVERSE_DECL(FieldDecl, { TRY_TO(TraverseDeclaratorHelper(D)); if (D->isBitField()) @@ -1645,8 +1647,6 @@ DEF_TRAVERSE_DECL(FieldDecl, { TRY_TO(TraverseStmt(D->getInClassInitializer())); }) -DEF_TRAVERSE_DECL(MSPropertyDecl, { TRY_TO(TraverseDeclaratorHelper(D)); }) - DEF_TRAVERSE_DECL(ObjCAtDefsFieldDecl, { TRY_TO(TraverseDeclaratorHelper(D)); if (D->isBitField())