diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 54ac47008f2..5a9f3991f2c 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -26,14 +26,16 @@ class MachineFunction; template <> struct ilist_traits : public ilist_default_traits { private: - mutable MachineInstr Sentinel; + mutable ilist_node Sentinel; // this is only set by the MachineBasicBlock owning the LiveList friend class MachineBasicBlock; MachineBasicBlock* Parent; public: - MachineInstr *createSentinel() const { return &Sentinel; } + MachineInstr *createSentinel() const { + return static_cast(&Sentinel); + } void destroySentinel(MachineInstr *) const {} void addNodeToList(MachineInstr* N); diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 689e4357b1d..1371f1d0cdf 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -37,9 +37,11 @@ class TargetMachine; template <> struct ilist_traits : public ilist_default_traits { - mutable MachineBasicBlock Sentinel; + mutable ilist_node Sentinel; public: - MachineBasicBlock *createSentinel() const { return &Sentinel; } + MachineBasicBlock *createSentinel() const { + return static_cast(&Sentinel); + } void destroySentinel(MachineBasicBlock *) const {} void addNodeToList(MachineBasicBlock* MBB); diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 9ecba590dd4..fe89fe05460 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -39,13 +39,10 @@ class FunctionLoweringInfo; template<> struct ilist_traits : public ilist_default_traits { private: - mutable SDNode Sentinel; + mutable ilist_node Sentinel; public: - ilist_traits() : Sentinel(ISD::DELETED_NODE, DebugLoc::getUnknownLoc(), - SDVTList()) {} - SDNode *createSentinel() const { - return &Sentinel; + return static_cast(&Sentinel); } static void destroySentinel(SDNode *) {}