From: Dan Gohman Date: Thu, 18 Aug 2011 21:27:42 +0000 (+0000) Subject: Make it clear that this code is iterating in reverse order through the array. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b48ef3a3ec7f527b0c76e7fbb37bbaac63b7c6aa;p=oota-llvm.git Make it clear that this code is iterating in reverse order through the array. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137985 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp index c74c353e81a..5e878cf459a 100644 --- a/lib/Transforms/Scalar/ObjCARC.cpp +++ b/lib/Transforms/Scalar/ObjCARC.cpp @@ -2596,8 +2596,9 @@ ObjCARCOpt::Visit(Function &F, Order.push_back(Stack.pop_back_val().first); } bool BottomUpNestingDetected = false; - while (!Order.empty()) { - BasicBlock *BB = Order.pop_back_val(); + for (SmallVectorImpl::const_reverse_iterator I = + Order.rbegin(), E = Order.rend(); I != E; ++I) { + BasicBlock *BB = *I; BottomUpNestingDetected |= VisitBottomUp(BB, BBStates, Retains); }