-template<>
-struct ilist_traits<Use> {
- static Use *getPrev(Use *N) { return N->UseLinks.Prev; }
- static Use *getNext(Use *N) { return N->UseLinks.Next; }
- static const Use *getPrev(const Use *N) { return N->UseLinks.Prev; }
- static const Use *getNext(const Use *N) { return N->UseLinks.Next; }
- static void setPrev(Use *N, Use *Prev) { N->UseLinks.Prev = Prev; }
- static void setNext(Use *N, Use *Next) { N->UseLinks.Next = Next; }
-
- /// createSentinel - this is used to create the end marker for the use list.
- /// Note that we only allocate a UseLinks structure, which is just enough to
- /// hold the next/prev pointers. This saves us 8 bytes of memory for every
- /// Value allocated.
- static Use *createSentinel() { return (Use*)new Use::NextPrevPtrs(); }
- static void destroySentinel(Use *S) { delete (Use::NextPrevPtrs*)S; }
-
- void addNodeToList(Use *NTy) {}
- void removeNodeFromList(Use *NTy) {}
- void transferNodesFromList(iplist<Use, ilist_traits> &L2,
- ilist_iterator<Use> first,
- ilist_iterator<Use> last) {}
-};
+ void setPrev(Use **NewPrev) {
+ Prev.setPointer(NewPrev);
+ }
+ void addToList(Use **List) {
+ Next = *List;
+ if (Next) Next->setPrev(&Next);
+ setPrev(List);
+ *List = this;
+ }
+ void removeFromList() {
+ Use **StrippedPrev = Prev.getPointer();
+ *StrippedPrev = Next;
+ if (Next) Next->setPrev(StrippedPrev);
+ }