MachineInstr::eraseFromParent fix for removing bundled instrs.
authorAndrew Trick <atrick@apple.com>
Tue, 5 Jun 2012 21:44:23 +0000 (21:44 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 5 Jun 2012 21:44:23 +0000 (21:44 +0000)
Patch by Ivan Llopard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158025 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index 2dfb299843ccf9aac1595df41dd6a6b0924413f5..a35978b5cde0657572172a31d47f22d6196391d0 100644 (file)
@@ -872,7 +872,8 @@ void MachineInstr::eraseFromParent() {
       MBB->erase(MI);
     }
   }
-  getParent()->erase(this);
+  // Erase the individual instruction, which may itself be inside a bundle.
+  getParent()->erase_instr(this);
 }