friend class MachineBasicBlock; // Set by the owning MachineBasicBlock.
MachineBasicBlock *Parent;
+ typedef simple_ilist<MachineInstr, ilist_sentinel_tracking<true>>::iterator
+ instr_iterator;
+
public:
void addNodeToList(MachineInstr *N);
void removeNodeFromList(MachineInstr *N);
- void transferNodesFromList(ilist_traits &OldList,
- simple_ilist<MachineInstr>::iterator First,
- simple_ilist<MachineInstr>::iterator Last);
+ void transferNodesFromList(ilist_traits &OldList, instr_iterator First,
+ instr_iterator Last);
void deleteNode(MachineInstr *MI);
// Leave out createNode...
};
private:
- typedef ilist<MachineInstr> Instructions;
+ typedef ilist<MachineInstr, ilist_sentinel_tracking<true>> Instructions;
Instructions Insts;
const BasicBlock *BB;
int Number;
/// without having their destructor called.
///
class MachineInstr
- : public ilist_node_with_parent<MachineInstr, MachineBasicBlock> {
+ : public ilist_node_with_parent<MachineInstr, MachineBasicBlock,
+ ilist_sentinel_tracking<true>> {
public:
typedef MachineMemOperand **mmo_iterator;
namespace llvm {
template <class T> struct MachineInstrBundleIteratorTraits {
- typedef simple_ilist<T> list_type;
+ typedef simple_ilist<T, ilist_sentinel_tracking<true>> list_type;
typedef typename list_type::iterator instr_iterator;
typedef typename list_type::iterator nonconst_instr_iterator;
};
template <class T> struct MachineInstrBundleIteratorTraits<const T> {
- typedef simple_ilist<T> list_type;
+ typedef simple_ilist<T, ilist_sentinel_tracking<true>> list_type;
typedef typename list_type::const_iterator instr_iterator;
typedef typename list_type::iterator nonconst_instr_iterator;
};
/// 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...");
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; }
};