17 assert(Use.LLVMUse !=
nullptr &&
"Already at end!");
19 Use =
User->getOperandUseInternal(Use.getOperandNo() + 1,
false);
27 assert(LLVMUse !=
nullptr &&
"Already at end!");
28 LLVMUse = LLVMUse->getNext();
29 if (LLVMUse ==
nullptr) {
34 auto *LLVMUser = LLVMUse->getUser();
41 Use.getOperandNo() + Num,
true);
46 assert(Use.getOperandNo() >= Num &&
"Out of bounds!");
48 Use.getOperandNo() - Num,
true);
53 int ThisOpNo = Use.getOperandNo();
54 int OtherOpNo =
Other.Use.getOperandNo();
55 return ThisOpNo - OtherOpNo;
66 return Use(LLVMUse,
const_cast<User *
>(
this),
Ctx);
72 "Use not found in this SBUser's operands!");
78#define DEF_VALUE(ID, CLASS)
79#define DEF_USER(ID, CLASS) \
82#define DEF_INSTR(ID, OPC, CLASS) \
85#include "llvm/SandboxIR/Values.def"
94 Ctx.getTracker().emplaceIfTracking<
UseSet>(U);
95 Ctx.runSetUseCallbacks(U, Operand);
105 Ctx.runSetUseCallbacks(
Use, ToV);
106 if (Tracker.isTracking())
107 Tracker.emplaceIfTracking<UseSet>(
Use);
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.
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
LLVM_ABI value_type operator*() const
LLVM_ABI OperandUseIterator & operator++()
LLVM_ABI OperandUseIterator operator+(unsigned Num) const
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++()
void verifyUserOfLLVMUse(const llvm::Use &Use) const
virtual void setOperand(unsigned OperandIdx, Value *Operand)
bool replaceUsesOfWith(Value *FromV, Value *ToV)
Replaces any operands that match FromV with ToV.
Use getOperandUseDefault(unsigned OpIdx, bool Verify) const
\Returns the Use edge that corresponds to OpIdx.
static bool classof(const Value *From)
For isa/dyn_cast.
virtual Use getOperandUseInternal(unsigned OpIdx, bool Verify) const =0
\Returns the Use for the OpIdx'th operand.
void dumpCommonHeader(raw_ostream &OS) const final
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<X> - 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<X> - 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.