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:
36 class Use;
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);
70 ~Use() {
78 Use(PrevPtrTag tag) : Val(nullptr) { Prev.setInt(tag); }
84 /// \brief Returns the User that contains this Use.
93 inline const Use &operator=(const Use &RHS);
98 Use *getNext() const { return Next; }
100 /// \brief Return the operand # of this use in its User.
107 static Use *initTags(Use *Start, Use *Stop);
109 /// \brief Destroys Use operands when the number of operands of
111 static void zap(Use *Start, const Use *Stop, bool del = false);
114 const Use *getImpliedUser() const LLVM_READONLY;
117 Use *Next;
118 PointerIntPair<Use **, 2, PrevPtrTag> Prev;
120 void setPrev(Use **NewPrev) { Prev.setPointer(NewPrev); }
122 void addToList(Use **List) {
131 Use **StrippedPrev = Prev.getPointer();
142 template <> struct simplify_type<Use> {
144 static SimpleType getSimplifiedValue(Use &Val) { return Val.get(); }
146 template <> struct simplify_type<const Use> {
148 static SimpleType getSimplifiedValue(const Use &Val) { return Val.get(); }
152 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef)