From b7668d516443231cba62e29786463587b61f90bb Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 30 Aug 2016 18:00:45 +0000 Subject: ADT: Guarantee transferNodesFromList is only called on transfers Guarantee that ilist_traits::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::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::transfer and iplist::insert. llvm-svn: 280122 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 29f3594ddae..8d34360b331 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -122,9 +122,8 @@ transferNodesFromList(ilist_traits &FromList, ilist_iterator 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. -- cgit v1.2.3