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/SymbolTableListTraits.h | |
parent | 80e051dfdede65678ac66f1552278338bc1a1b33 (diff) | |
download | external_llvm-fed90b6d097d50881afb45e4d79f430db66dd741.zip external_llvm-fed90b6d097d50881afb45e4d79f430db66dd741.tar.gz external_llvm-fed90b6d097d50881afb45e4d79f430db66dd741.tar.bz2 |
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/SymbolTableListTraits.h')
-rw-r--r-- | include/llvm/SymbolTableListTraits.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/include/llvm/SymbolTableListTraits.h b/include/llvm/SymbolTableListTraits.h index 7d747d4..911d1ce 100644 --- a/include/llvm/SymbolTableListTraits.h +++ b/include/llvm/SymbolTableListTraits.h @@ -25,6 +25,8 @@ #ifndef LLVM_SYMBOLTABLELISTTRAITS_H #define LLVM_SYMBOLTABLELISTTRAITS_H +#include "llvm/ADT/ilist.h" + namespace llvm { template<typename NodeTy> class ilist_iterator; @@ -37,7 +39,7 @@ template<typename Ty> struct ilist_traits; // inherit from ilist_traits<ValueSubClass> // template<typename ValueSubClass, typename ItemParentClass> -class SymbolTableListTraits { +class SymbolTableListTraits : public ilist_default_traits<ValueSubClass> { typedef ilist_traits<ValueSubClass> TraitsClass; public: SymbolTableListTraits() {} @@ -48,26 +50,14 @@ public: return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(this)- TraitsClass::getListOffset()); } - static ValueSubClass *getPrev(ValueSubClass *V) { return V->getPrev(); } - static ValueSubClass *getNext(ValueSubClass *V) { return V->getNext(); } - static const ValueSubClass *getPrev(const ValueSubClass *V) { - return V->getPrev(); - } - static const ValueSubClass *getNext(const ValueSubClass *V) { - return V->getNext(); - } void deleteNode(ValueSubClass *V) { delete V; } - static void setPrev(ValueSubClass *V, ValueSubClass *P) { V->setPrev(P); } - static void setNext(ValueSubClass *V, ValueSubClass *N) { V->setNext(N); } - void addNodeToList(ValueSubClass *V); void removeNodeFromList(ValueSubClass *V); - void transferNodesFromList(iplist<ValueSubClass, - ilist_traits<ValueSubClass> > &L2, + void transferNodesFromList(ilist_traits<ValueSubClass> &L2, ilist_iterator<ValueSubClass> first, ilist_iterator<ValueSubClass> last); //private: |