From: Ted Kremenek Date: Sat, 13 Nov 2010 05:55:56 +0000 (+0000) Subject: Rewrite reverse iteration loop in a more natural countdown manner. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b8d8c90f2d8ac651d14b57f116d20b3c911ac7f;p=clang Rewrite reverse iteration loop in a more natural countdown manner. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118990 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 062a367291..72726e385a 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -1805,10 +1805,8 @@ void EnqueueVisitor::VisitCXXNewExpr(CXXNewExpr *E) { AddStmt(E->getPlacementArg(I-1)); } void EnqueueVisitor::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *CE) { - // Note that we enqueue things in reverse order so that - // they are visited correctly by the DFS. - for (unsigned I = 1, N = CE->getNumArgs(); I != N; ++I) - AddStmt(CE->getArg(N-I)); + for (unsigned I = CE->getNumArgs(); I > 1 /* Yes, this is 1 */; --I) + AddStmt(CE->getArg(I-1)); AddStmt(CE->getCallee()); AddStmt(CE->getArg(0)); }