summaryrefslogtreecommitdiff
path: root/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-09-11 16:38:18 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-09-11 16:38:18 +0000
commit6037e199c8a061b2e9cb22c434644a0eac659fb9 (patch)
tree14b905cf97823bf2ecd81e44f403938417c76e9d /unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
parentb4bd34e805fff0799122c67cc11c1b786a5f5a5c (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/CodeGen/MachineInstrBundleIteratorTest.cpp')
-rw-r--r--unittests/CodeGen/MachineInstrBundleIteratorTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp b/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
index 857994a3b29..738d07d06a6 100644
--- a/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
+++ b/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
@@ -15,7 +15,8 @@ using namespace llvm;
namespace {
-struct MyBundledInstr : public ilist_node<MyBundledInstr> {
+struct MyBundledInstr
+ : public ilist_node<MyBundledInstr, ilist_sentinel_tracking<true>> {
bool isBundledWithPred() const { return true; }
bool isBundledWithSucc() const { return true; }
};