diff options
author | Kazu Hirata <kazu@google.com> | 2021-11-01 22:38:48 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-11-01 22:38:49 -0700 |
commit | 6bdb61c58a55a31f57e65804cc3477f94b0e53f4 (patch) | |
tree | 1e93bec2e55463b70d988b45d0fc609718fb48f9 /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | 57d34cb223127bc1e42c6f29f1fe6ae7190091f8 (diff) | |
download | llvm-6bdb61c58a55a31f57e65804cc3477f94b0e53f4.zip llvm-6bdb61c58a55a31f57e65804cc3477f94b0e53f4.tar.gz llvm-6bdb61c58a55a31f57e65804cc3477f94b0e53f4.tar.bz2 |
[CodeGen] Use make_early_inc_range (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index c929c1d..dcd546f 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -1294,13 +1294,9 @@ bool LDVImpl::runOnMachineFunction(MachineFunction &mf, bool InstrRef) { static void removeDebugInstrs(MachineFunction &mf) { for (MachineBasicBlock &MBB : mf) { - for (auto MBBI = MBB.begin(), MBBE = MBB.end(); MBBI != MBBE; ) { - if (!MBBI->isDebugInstr()) { - ++MBBI; - continue; - } - MBBI = MBB.erase(MBBI); - } + for (MachineInstr &MI : llvm::make_early_inc_range(MBB)) + if (MI.isDebugInstr()) + MBB.erase(&MI); } } |