summaryrefslogtreecommitdiff
path: root/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
commitff2b99afc8cbc6cfa73181072888e0f9f07deb7e (patch)
tree05569eb1e6e4b27731f81088a79f4290d3cf4ac5 /lib/CodeGen/MachineBasicBlock.cpp
parentdf1c637ac4b6f6587c037be55cafed665c732d8f (diff)
downloadllvm-ff2b99afc8cbc6cfa73181072888e0f9f07deb7e.tar.gz
llvm-ff2b99afc8cbc6cfa73181072888e0f9f07deb7e.tar.bz2
llvm-ff2b99afc8cbc6cfa73181072888e0f9f07deb7e.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index f361d1ac29..151b402168 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/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);