OSDN Git Service

Fix loop style
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 29 Mar 2013 18:48:42 +0000 (18:48 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 29 Mar 2013 18:48:42 +0000 (18:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 57bce84..2240e9d 100644 (file)
@@ -1136,7 +1136,7 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
 
         // Make sure to clean up the Visited map before continuing on to
         // PredTranslationFailure.
-        for (unsigned i = 0; i < PredList.size(); i++)
+        for (unsigned i = 0, n = PredList.size(); i < n; ++i)
           Visited.erase(PredList[i].first);
 
         goto PredTranslationFailure;
@@ -1148,7 +1148,7 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
     // any results for.  (getNonLocalPointerDepFromBB will modify our
     // datastructures in ways the code after the PredTranslationFailure label
     // doesn't expect.)
-    for (unsigned i = 0; i < PredList.size(); i++) {
+    for (unsigned i = 0, n = PredList.size(); i < n; ++i) {
       BasicBlock *Pred = PredList[i].first;
       PHITransAddr &PredPointer = PredList[i].second;
       Value *PredPtrVal = PredPointer.getAddr();