-template<>
-struct ilist_traits<Use> {
- static Use *getPrev(Use *N) { return N->Prev; }
- static Use *getNext(Use *N) { return N->Next; }
- static const Use *getPrev(const Use *N) { return N->Prev; }
- static const Use *getNext(const Use *N) { return N->Next; }
- static void setPrev(Use *N, Use *Prev) { N->Prev = Prev; }
- static void setNext(Use *N, Use *Next) { N->Next = Next; }
-
- // createNode - this is used to create the end marker for the use list
- static Use *createNode() { return new Use(0,0); }
-
- void addNodeToList(Use *NTy) {}
- void removeNodeFromList(Use *NTy) {}
- void transferNodesFromList(iplist<Use, ilist_traits> &L2,
- ilist_iterator<Use> first,
- ilist_iterator<Use> last) {}
-};
+ Use *getNext() const { return Next; }
+private:
+ Use *Next, **Prev;
+ Value *Val;
+ User *U;
+
+ void addToList(Use **List) {
+ Next = *List;
+ if (Next) Next->Prev = &Next;
+ Prev = List;
+ *List = this;
+ }
+ void removeFromList() {
+ *Prev = Next;
+ if (Next) Next->Prev = Prev;
+ }