-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; }
+
+
+ /// zap - This is used to destroy Use operands when the number of operands of
+ /// a User changes.
+ static void zap(Use *Start, const Use *Stop, bool del = false);
+
+ /// getPrefix - Return deletable pointer if appropriate
+ Use *getPrefix();
+private:
+ const Use* getImpliedUser() const;
+ static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
+
+ Value *Val;
+ Use *Next;
+ PointerIntPair<Use**, 2, PrevPtrTag> Prev;
+
+ 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);
+ }