9#ifndef LLVM_SANDBOXIR_USER_H
10#define LLVM_SANDBOXIR_USER_H
24class OperandUseIterator {
29#define DEF_INSTR(ID, OPC, CLASS) friend class CLASS;
30#include "llvm/SandboxIR/Values.def"
48 return Use ==
Other.Use;
51 return !(*
this ==
Other);
77 return Use.LLVMUse->getOperandNo();
133 virtual void setOperand(
unsigned OperandIdx,
Value *Operand);
136 bool replaceUsesOfWith(
Value *FromV,
Value *ToV);
142 void dumpCommonHeader(
raw_ostream &OS)
const final;
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 Value Representation.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Iterator for the Use edges of a User's operands.
OperandUseIterator()=default
std::ptrdiff_t difference_type
std::input_iterator_tag iterator_category
OperandUseIterator operator++(int)
bool operator!=(const OperandUseIterator &Other) const
bool operator==(const OperandUseIterator &Other) const
LLVM_ABI OperandUseIterator operator-(unsigned Num) const
LLVM_ABI value_type operator*() const
LLVM_ABI OperandUseIterator & operator++()
sandboxir::Use value_type
LLVM_ABI OperandUseIterator operator+(unsigned Num) const
Represents a Def-use/Use-def edge in SandboxIR.
LLVM_ABI unsigned getOperandNo() const
virtual op_iterator op_begin()
void dumpOS(raw_ostream &OS) const override
friend class OperandUseIterator
Value * getOperand(unsigned OpIdx) const
virtual unsigned getUseOperandNo(const Use &Use) const =0
\Returns the operand index of Use.
unsigned getUseOperandNoDefault(const Use &Use) const
The default implementation works only for single-LLVMIR-instruction Users and only if they match exac...
virtual const_op_iterator op_end() const
OperandUseIterator const_op_iterator
void verify() const override
Should crash if there is something wrong with the instruction.
OperandUseIterator op_iterator
const_op_range operands() const
virtual Use getOperandUseInternal(unsigned OpIdx, bool Verify) const =0
\Returns the Use for the OpIdx'th operand.
void swapOperandsInternal(unsigned OpIdxA, unsigned OpIdxB)
virtual unsigned getNumOperands() const
virtual const_op_iterator op_begin() const
Use getOperandUse(unsigned OpIdx) const
\Returns the operand edge for OpIdx.
iterator_range< const_op_iterator > const_op_range
virtual op_iterator op_end()
iterator_range< op_iterator > op_range
User(ClassID ID, llvm::Value *V, Context &Ctx)
A SandboxIR Value has users. This is the base class.
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
Context & Ctx
All values point to the context.
LLVM_ABI Value(ClassID SubclassID, llvm::Value *Val, Context &Ctx)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
static bool classof(const Value *From)
For isa/dyn_cast.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
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.