aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-31 21:59:29 +0000
committerChris Lattner <sabre@nondot.org>2004-03-31 21:59:29 +0000
commit4f6410f5cb1c9ad8cbe4f5a96dd706023ff4dbc5 (patch)
tree5d35c10256a1c747fb181f18016e8269ac20b738 /lib/CodeGen/PHIElimination.cpp
parent0c58897d1c95d6b92c985010d62edfc2945ef22b (diff)
downloadexternal_llvm-4f6410f5cb1c9ad8cbe4f5a96dd706023ff4dbc5.zip
external_llvm-4f6410f5cb1c9ad8cbe4f5a96dd706023ff4dbc5.tar.gz
external_llvm-4f6410f5cb1c9ad8cbe4f5a96dd706023ff4dbc5.tar.bz2
MachineBasicBlock::remove should not modify the iterator passed in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 181fe46..324f4c4 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -71,8 +71,7 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
while (MBB.front().getOpcode() == TargetInstrInfo::PHI) {
// Unlink the PHI node from the basic block... but don't delete the PHI yet
- MachineBasicBlock::iterator begin = MBB.begin();
- MachineInstr *MI = MBB.remove(begin);
+ MachineInstr *MI = MBB.remove(MBB.begin());
assert(MRegisterInfo::isVirtualRegister(MI->getOperand(0).getReg()) &&
"PHI node doesn't write virt reg?");