aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemorySSAUpdater.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-18 09:09:52 -0800
committerKazu Hirata <kazu@google.com>2021-11-18 09:09:52 -0800
commit7ca14f6044bfa46efdbb4d4080e36c3265a09a78 (patch)
tree6fc08bc40f8f67dc5fd74e71109edd1d0bf764e7 /llvm/lib/Analysis/MemorySSAUpdater.cpp
parent7796d81ae8204289c6ea07f19e538cf287d3213f (diff)
downloadllvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.zip
llvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.tar.gz
llvm-7ca14f6044bfa46efdbb4d4080e36c3265a09a78.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/Analysis/MemorySSAUpdater.cpp')
-rw-r--r--llvm/lib/Analysis/MemorySSAUpdater.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp b/llvm/lib/Analysis/MemorySSAUpdater.cpp
index 8de0adc..9c84188 100644
--- a/llvm/lib/Analysis/MemorySSAUpdater.cpp
+++ b/llvm/lib/Analysis/MemorySSAUpdater.cpp
@@ -296,9 +296,8 @@ static void setMemoryPhiValueForBlock(MemoryPhi *MP, const BasicBlock *BB,
assert(i != -1 && "Should have found the basic block in the phi");
// We can't just compare i against getNumOperands since one is signed and the
// other not. So use it to index into the block iterator.
- for (auto BBIter = MP->block_begin() + i; BBIter != MP->block_end();
- ++BBIter) {
- if (*BBIter != BB)
+ for (const BasicBlock *BlockBB : llvm::drop_begin(MP->blocks(), i)) {
+ if (BlockBB != BB)
break;
MP->setIncomingValue(i, NewDef);
++i;