diff options
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 18 | 
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 49eccde45f31..951e00e34142 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -1292,16 +1292,16 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(          if (InsertRes.first->second != Pointer.getAddr()) {            // Make sure to clean up the Visited map before continuing on to            // PredTranslationFailure. -          for (unsigned i = 0; i < NewBlocks.size(); i++) -            Visited.erase(NewBlocks[i]); +          for (auto *NewBlock : NewBlocks) +            Visited.erase(NewBlock);            goto PredTranslationFailure;          }        }        if (NewBlocks.size() > WorklistEntries) {          // Make sure to clean up the Visited map before continuing on to          // PredTranslationFailure. -        for (unsigned i = 0; i < NewBlocks.size(); i++) -          Visited.erase(NewBlocks[i]); +        for (auto *NewBlock : NewBlocks) +          Visited.erase(NewBlock);          GotWorklistLimit = true;          goto PredTranslationFailure;        } @@ -1359,8 +1359,8 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(          // Make sure to clean up the Visited map before continuing on to          // PredTranslationFailure. -        for (unsigned i = 0, n = PredList.size(); i < n; ++i) -          Visited.erase(PredList[i].first); +        for (const auto &Pred : PredList) +          Visited.erase(Pred.first);          goto PredTranslationFailure;        } @@ -1371,9 +1371,9 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(      // any results for.  (getNonLocalPointerDepFromBB will modify our      // datastructures in ways the code after the PredTranslationFailure label      // doesn't expect.) -    for (unsigned i = 0, n = PredList.size(); i < n; ++i) { -      BasicBlock *Pred = PredList[i].first; -      PHITransAddr &PredPointer = PredList[i].second; +    for (auto &I : PredList) { +      BasicBlock *Pred = I.first; +      PHITransAddr &PredPointer = I.second;        Value *PredPtrVal = PredPointer.getAddr();        bool CanTranslate = true;  | 
