diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
commit | fed90b6d097d50881afb45e4d79f430db66dd741 (patch) | |
tree | 7ec1a6f6b2a8a37e054b84505502b3346c6680c7 /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | 80e051dfdede65678ac66f1552278338bc1a1b33 (diff) |
Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.
Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.
Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index d690732ec2..dbb12947f2 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -25,7 +25,8 @@ #include "llvm/ADT/iterator.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" -#include "llvm/ADT/alist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/Support/Allocator.h" @@ -43,6 +44,7 @@ class SDNode; class CompileUnitDesc; template <typename T> struct DenseMapInfo; template <typename T> struct simplify_type; +template <typename T> class ilist_traits; /// SDVTList - This represents a list of ValueType's that has been intern'd by /// a SelectionDAG. Instances of this simple value class are returned by @@ -1028,7 +1030,7 @@ public: /// SDNode - Represents one node in the SelectionDAG. /// -class SDNode : public FoldingSetNode { +class SDNode : public FoldingSetNode, public ilist_node<SDNode> { private: /// NodeType - The operation that this node performs. /// @@ -1268,6 +1270,7 @@ public: protected: friend class SelectionDAG; + friend class ilist_traits<SDNode>; /// getValueTypeList - Return a pointer to the specified value type. /// @@ -2236,27 +2239,10 @@ template <> struct GraphTraits<SDNode*> { /// typedef LoadSDNode LargestSDNode; -// alist_traits specialization for pool-allocating SDNodes. -template <> -class alist_traits<SDNode, LargestSDNode> { - typedef alist_iterator<SDNode, LargestSDNode> iterator; - -public: - // Pool-allocate and recycle SDNodes. - typedef RecyclingAllocator<BumpPtrAllocator, SDNode, LargestSDNode> - AllocatorType; - - // Allocate the allocator immediately inside the traits class. - AllocatorType Allocator; - - void addNodeToList(SDNode*) {} - void removeNodeFromList(SDNode*) {} - void transferNodesFromList(alist_traits &, iterator, iterator) {} - void deleteNode(SDNode *N) { - N->~SDNode(); - Allocator.Deallocate(N); - } -}; +/// MostAlignedSDNode - The SDNode class with the greatest alignment +/// requirement. +/// +typedef ConstantSDNode MostAlignedSDNode; namespace ISD { /// isNormalLoad - Returns true if the specified node is a non-extending |