diff options
author | Kazu Hirata <kazu@google.com> | 2021-02-07 09:49:36 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-02-07 09:49:36 -0800 |
commit | be23012d5a84fefdb6d0a267f9ffb4bafb4804d7 (patch) | |
tree | 286d9b13a8c93c76ae9566fd8e81380116f9c358 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 92a6055835e26254429b5c1bfc889ab1bb711d1d (diff) | |
download | llvm-be23012d5a84fefdb6d0a267f9ffb4bafb4804d7.zip llvm-be23012d5a84fefdb6d0a267f9ffb4bafb4804d7.tar.gz llvm-be23012d5a84fefdb6d0a267f9ffb4bafb4804d7.tar.bz2 |
[Transforms/Utils] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 51a4957..a953ba5 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -563,9 +563,8 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc, assert(NumPreds < PN->getNumIncomingValues()); // Count how many times each predecessor comes to this block. std::map<BasicBlock*, unsigned> PredCount; - for (pred_iterator PI = pred_begin(NewBB), E = pred_end(NewBB); - PI != E; ++PI) - --PredCount[*PI]; + for (BasicBlock *Pred : predecessors(NewBB)) + --PredCount[Pred]; // Figure out how many entries to remove from each PHI. for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) |