aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-09 22:49:37 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-09 22:49:37 +0000
commitc4102d49024f75f94777a5e10872fde4230f1857 (patch)
tree4ed061d17ab0666d6cd51b4ed990a34cb41f8c62 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentb7596f60153895dfbf177c5c3a28f33e40e44ab8 (diff)
downloadllvm-c4102d49024f75f94777a5e10872fde4230f1857.zip
llvm-c4102d49024f75f94777a5e10872fde4230f1857.tar.gz
llvm-c4102d49024f75f94777a5e10872fde4230f1857.tar.bz2
Move use list management into MachineRegisterInfo.
Register MachineOperands are kept in linked lists accessible via MRI's reg_iterator interfaces. The linked list management was handled partly by MachineOperand methods, partly by MRI methods. Move all of the list management into MRI, delete MO::AddRegOperandToRegInfo() and MO::RemoveRegOperandFromRegInfo(). Be more explicit about handling the cases where an MRI pointer isn't available. llvm-svn: 161632
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index f361d1a..151b402 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -109,7 +109,8 @@ void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr *N) {
assert(N->getParent() != 0 && "machine instruction not in a basic block");
// Remove from the use/def lists.
- N->RemoveRegOperandsFromUseLists();
+ if (MachineFunction *MF = N->getParent()->getParent())
+ N->RemoveRegOperandsFromUseLists(MF->getRegInfo());
N->setParent(0);