summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitcc9edace0cf5f496ee117ec41d1c448a7abc1280 (patch)
treec7dcbfb7b09b3054ff3f3b3db582fac8b6300418 /llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
parent085bbf1e2fb4f8c5924843426eaea99f64e84815 (diff)
downloadbcm5719-llvm-cc9edace0cf5f496ee117ec41d1c448a7abc1280.tar.gz
bcm5719-llvm-cc9edace0cf5f496ee117ec41d1c448a7abc1280.zip
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/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp')
-rw-r--r--llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp b/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
index 857994a3b29..738d07d06a6 100644
--- a/llvm/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp
+++ b/llvm/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; }
};
OpenPOWER on IntegriCloud