//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#ifndef LLVM_SYMBOLTABLELISTTRAITS_H
#define LLVM_SYMBOLTABLELISTTRAITS_H
+#include "llvm/ADT/ilist.h"
+
namespace llvm {
template<typename NodeTy> class ilist_iterator;
// 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() {}
/// getListOwner - Return the object that owns this list. If this is a list
/// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() {
- return reinterpret_cast<ItemParentClass*>((char*)this-
+ 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();
- }
- static void setPrev(ValueSubClass *V, ValueSubClass *P) { V->setPrev(P); }
- static void setNext(ValueSubClass *V, ValueSubClass *N) { V->setNext(N); }
+ void deleteNode(ValueSubClass *V) {
+ delete V;
+ }
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: