aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-03-05 21:05:09 +0000
committerHeejin Ahn <aheejin@gmail.com>2019-03-05 21:05:09 +0000
commit5c644c9bcaacd3da1d9a0f220427033a94d456c8 (patch)
tree8b3a06fd48ce0ff4bcfbc09793e04ded81d726cc /llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
parentd15f3b188bf728e0e7bff64163e29dfbee030965 (diff)
downloadllvm-5c644c9bcaacd3da1d9a0f220427033a94d456c8.zip
llvm-5c644c9bcaacd3da1d9a0f220427033a94d456c8.tar.gz
llvm-5c644c9bcaacd3da1d9a0f220427033a94d456c8.tar.bz2
[WebAssembly] Simplify iterator navigations (NFC)
Summary: - Replaces some uses of `MachineFunction::iterator(MBB)` with `MBB->getIterator()` and `MachineBasicBlock::iterator(MI)` with `MI->getIterator()`, which are simpler. - Replaces some uses of `std::prev` of `std::next` that takes a MachineFunction or MachineBasicBlock iterator with `getPrevNode` and `getNextNode`, which are also simpler. Reviewers: sbc100 Subscribers: dschuff, sunfish, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58913 llvm-svn: 355444
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
index 17fb8e1..f648154 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
@@ -319,8 +319,7 @@ bool LoopFixer::run() {
// This is a successor we need to rewrite.
MachineBasicBlock *Split = MF.CreateMachineBasicBlock();
- MF.insert(MBB->isLayoutSuccessor(Succ) ? MachineFunction::iterator(Succ)
- : MF.end(),
+ MF.insert(MBB->isLayoutSuccessor(Succ) ? Succ->getIterator() : MF.end(),
Split);
MLI.changeLoopFor(Split, Loop);