diff options
author | Kazu Hirata <kazu@google.com> | 2021-11-18 09:09:52 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-11-18 09:09:52 -0800 |
commit | 7ca14f6044bfa46efdbb4d4080e36c3265a09a78 (patch) | |
tree | 6fc08bc40f8f67dc5fd74e71109edd1d0bf764e7 /llvm/lib/Analysis/MemorySSAUpdater.cpp | |
parent | 7796d81ae8204289c6ea07f19e538cf287d3213f (diff) | |
download | llvm-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.cpp | 5 |
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; |