LLVM: lib/SandboxIR/User.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
11
13
15
17 assert(Use.LLVMUse != nullptr && "Already at end!");
19 Use = User->getOperandUseInternal(Use.getOperandNo() + 1, false);
20 return *this;
21}
22
25
27 assert(LLVMUse != nullptr && "Already at end!");
28 LLVMUse = LLVMUse->getNext();
29 if (LLVMUse == nullptr) {
30 Use.Usr = nullptr;
31 return *this;
32 }
33 auto *Ctx = Use.Ctx;
34 auto *LLVMUser = LLVMUse->getUser();
36 return *this;
37}
38
41 Use.getOperandNo() + Num, true);
43}
44
46 assert(Use.getOperandNo() >= Num && "Out of bounds!");
48 Use.getOperandNo() - Num, true);
50}
51
54 int OtherOpNo = Other.Use.getOperandNo();
55 return ThisOpNo - OtherOpNo;
56}
57
64 else
66 return Use(LLVMUse, const_cast<User *>(this), Ctx);
67}
68
69#ifndef NDEBUG
72 "Use not found in this SBUser's operands!");
73}
74#endif
75
78#define DEF_VALUE(ID, CLASS)
79#define DEF_USER(ID, CLASS) \
80 case ClassID::ID: \
81 return true;
82#define DEF_INSTR(ID, OPC, CLASS) \
83 case ClassID::ID: \
84 return true;
85#include "llvm/SandboxIR/Values.def"
86 default:
87 return false;
88 }
89}
90
94 Ctx.getTracker().emplaceIfTracking<UseSet>(U);
95 Ctx.runSetUseCallbacks(U, Operand);
96
105 Ctx.runSetUseCallbacks(Use, ToV);
106 if (Tracker.isTracking())
107 Tracker.emplaceIfTracking(Use);
108 }
109 }
110
112}
113
114#ifndef NDEBUG
119#endif
120
121}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineInstr unsigned OpIdx
ppc ctr loops PowerPC CTR Loops Verify
A Use represents the edge between a Value definition and its users.
LLVM_ABI unsigned getOperandNo() const
Return the operand # of this use in its User.
User * getUser() const
Returns the User that contains this Use.
This class implements an extremely fast bulk output stream that can only output to a stream.
OperandUseIterator()=default
LLVM_ABI OperandUseIterator operator-(unsigned Num) const
Definition User.cpp:45
LLVM_ABI value_type operator*() const
Definition User.cpp:14
LLVM_ABI OperandUseIterator & operator++()
Definition User.cpp:16
LLVM_ABI OperandUseIterator operator+(unsigned Num) const
Definition User.cpp:39
The tracker collects all the change objects and implements the main API for saving / reverting / acce...
Tracks the change of the source Value of a sandboxir::Use.
Represents a Def-use/Use-def edge in SandboxIR.
class User * getUser() const
LLVM_ABI UserUseIterator & operator++()
Definition User.cpp:23
void verifyUserOfLLVMUse(const llvm::Use &Use) const
Definition User.cpp:70
virtual void setOperand(unsigned OperandIdx, Value *Operand)
Definition User.cpp:91
bool replaceUsesOfWith(Value *FromV, Value *ToV)
Replaces any operands that match FromV with ToV.
Definition User.cpp:100
Use getOperandUseDefault(unsigned OpIdx, bool Verify) const
\Returns the Use edge that corresponds to OpIdx.
Definition User.cpp:58
static bool classof(const Value *From)
For isa/dyn_cast.
Definition User.cpp:76
virtual Use getOperandUseInternal(unsigned OpIdx, bool Verify) const =0
\Returns the Use for the OpIdx'th operand.
void dumpCommonHeader(raw_ostream &OS) const final
Definition User.cpp:115
virtual unsigned getNumOperands() const
Use getOperandUse(unsigned OpIdx) const
\Returns the operand edge for OpIdx.
User(ClassID ID, llvm::Value *V, Context &Ctx)
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
virtual void dumpCommonHeader(raw_ostream &OS) const
ClassID getSubclassID() const
Context & Ctx
All values point to the context.
LLVM_ABI Value(ClassID SubclassID, llvm::Value *Val, Context &Ctx)
auto cast_or_null(const Y &Val)
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.