diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-09-11 16:38:18 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-09-11 16:38:18 +0000 |
commit | cc9edace0cf5f496ee117ec41d1c448a7abc1280 (patch) | |
tree | c7dcbfb7b09b3054ff3f3b3db582fac8b6300418 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 085bbf1e2fb4f8c5924843426eaea99f64e84815 (diff) | |
download | llvm-cc9edace0cf5f496ee117ec41d1c448a7abc1280.zip llvm-cc9edace0cf5f496ee117ec41d1c448a7abc1280.tar.gz llvm-cc9edace0cf5f496ee117ec41d1c448a7abc1280.tar.bz2 |
CodeGen: Turn on sentinel tracking for MachineInstr iterators
This is a prep commit before fixing MachineBasicBlock::reverse_iterator
invalidation semantics, ala r281167 for ilist::reverse_iterator. This
changes MachineBasicBlock::Instructions to track which node is the
sentinel regardless of LLVM_ENABLE_ABI_BREAKING_CHECKS.
There's almost no functionality change (aside from ABI). However, in
the rare configuration:
#if !defined(NDEBUG) && !defined(LLVM_ENABLE_ABI_BREAKING_CHECKS)
the isKnownSentinel() assertions in ilist_iterator<>::operator* suddenly
have teeth for MachineInstr. If these assertions start firing for your
out-of-tree backend, have a look at the suggestions in the commit
message for r279314, and at some of the commits leading up to it that
avoid dereferencing the end() iterator.
llvm-svn: 281168
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index d50f4e7..d9eef55 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -118,9 +118,9 @@ void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr *N) { /// When moving a range of instructions from one MBB list to another, we need to /// update the parent pointers and the use/def lists. -void ilist_traits<MachineInstr>::transferNodesFromList( - ilist_traits &FromList, simple_ilist<MachineInstr>::iterator First, - simple_ilist<MachineInstr>::iterator Last) { +void ilist_traits<MachineInstr>::transferNodesFromList(ilist_traits &FromList, + instr_iterator First, + instr_iterator Last) { assert(Parent->getParent() == FromList.Parent->getParent() && "MachineInstr parent mismatch!"); assert(this != &FromList && "Called without a real transfer..."); |