aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-08-30 18:00:45 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-08-30 18:00:45 +0000
commitb7668d516443231cba62e29786463587b61f90bb (patch)
tree8d1976971db0032d456bf94fac85fd95c14a1883 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent63f71057c0671ed3d06a9e939b7c360996d45623 (diff)
downloadllvm-b7668d516443231cba62e29786463587b61f90bb.zip
llvm-b7668d516443231cba62e29786463587b61f90bb.tar.gz
llvm-b7668d516443231cba62e29786463587b61f90bb.tar.bz2
ADT: Guarantee transferNodesFromList is only called on transfers
Guarantee that ilist_traits<T>::transferNodesFromList is only called when nodes are actually changing lists. I also moved all the callbacks to occur *first*, before the operation. This is the only choice for iplist<T>::merge, so we might as well be consistent. I expect this to have no effect in practice, although it simplifies the logic in both iplist<T>::transfer and iplist<T>::insert. llvm-svn: 280122
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 29f3594..8d34360 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -122,9 +122,8 @@ transferNodesFromList(ilist_traits<MachineInstr> &FromList,
ilist_iterator<MachineInstr> Last) {
assert(Parent->getParent() == FromList.Parent->getParent() &&
"MachineInstr parent mismatch!");
-
- // Splice within the same MBB -> no change.
- if (Parent == FromList.Parent) return;
+ assert(this != &FromList && "Called without a real transfer...");
+ assert(Parent != FromList.Parent && "Two lists have the same parent?");
// If splicing between two blocks within the same function, just update the
// parent pointers.