Home | History | Annotate | Download | only in IR

Lines Matching defs:Use

1 //===- llvm/Use.h - Definition of the Use class -----------------*- C++ -*-===//
11 /// This defines the Use class. The Use class represents the operand of an
12 /// instruction or some other User instance which refers to a Value. The Use
13 /// class keeps the "use list" of the referenced value up to date.
15 /// Pointer tagging is used to efficiently find the User corresponding to a Use
16 /// without having to store a User pointer in every Use. A User is preceded in
18 /// one of the fields (Prev) of the Use class are used to encode offsets to be
19 /// able to find that User given a pointer to any Use. For details, see:
39 /// \brief A Use represents the edge between a Value definition and its users.
56 class Use {
58 Use(const Use &U) = delete;
60 /// \brief Provide a fast substitute to std::swap<Use>
62 void swap(Use &RHS);
65 /// use the LSB regardless of pointer alignment on different targets.
80 /// Pointer traits for the Prev PointerIntPair. This ensures we always use
83 static inline void *getAsVoidPointer(Use **P) { return P; }
85 static inline Use **getFromVoidPointer(void *P) {
86 return (Use **)P;
94 ~Use() {
102 Use(PrevPtrTag tag) { Prev.setInt(tag); }
110 /// \brief Returns the User that contains this Use.
119 inline const Use &operator=(const Use &RHS);
124 Use *getNext() const { return Next; }
126 /// \brief Return the operand # of this use in its User.
133 static Use *initTags(Use *Start, Use *Stop);
135 /// \brief Destroys Use operands when the number of operands of
137 static void zap(Use *Start, const Use *Stop, bool del = false);
140 const Use *getImpliedUser() const LLVM_READONLY;
143 Use *Next;
144 PointerIntPair<Use **, 2, PrevPtrTag, PrevPointerTraits> Prev;
146 void setPrev(Use **NewPrev) { Prev.setPointer(NewPrev); }
148 void addToList(Use **List) {
157 Use **StrippedPrev = Prev.getPointer();
166 template <> struct simplify_type<Use> {
169 static SimpleType getSimplifiedValue(Use &Val) { return Val.get(); }
171 template <> struct simplify_type<const Use> {
174 static SimpleType getSimplifiedValue(const Use &Val) { return Val.get(); }
178 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef)