From c7f6b8c5d40e17bf43fd3a1549d7d89c9da735e1 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 4 Mar 2009 06:57:48 +0000 Subject: "Ghostify" embedded sentinels. This is a real win in all cases because less bytes are allocated and subobject construction is gone. For reference how it works, see BasicBlock.h. Btw. it is very assuring to see that somebody has invented this ilist-embedded sentinel technique before me :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66026 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineBasicBlock.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/llvm/CodeGen/MachineBasicBlock.h') diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 54ac47008f..5a9f3991f2 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); -- cgit v1.2.3-18-g5258