diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-11-13 05:55:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-11-13 05:55:56 +0000 |
commit | 8b8d8c90f2d8ac651d14b57f116d20b3c911ac7f (patch) | |
tree | 707c36f2c7d30ee83f37308d1f90a591e80e0810 | |
parent | 11b8e3e7fa67795acc968a9d5ebfd687feaf2b2c (diff) |
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
-rw-r--r-- | tools/libclang/CIndex.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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)); } |