19 #ifndef LLVM_IR_USER_H
20 #define LLVM_IR_USER_H
38 virtual void anchor();
51 void *
operator new(
size_t s,
unsigned Us);
66 void operator delete(
void *Usr);
76 template <
int Idx,
typename U>
static Use &
OpFrom(
const U *that) {
82 return OpFrom<Idx>(
this);
84 template <
int Idx>
const Use &
Op()
const {
85 return OpFrom<Idx>(
this);
89 assert(i <
NumOperands &&
"getOperand() out of range!");
93 assert(i <
NumOperands &&
"setOperand() out of range!");
94 assert((!isa<Constant>((
const Value*)
this) ||
95 isa<GlobalValue>((
const Value*)
this)) &&
96 "Cannot mutate a constant with setOperand!");
100 assert(i <
NumOperands &&
"getOperandUse() out of range!");
104 assert(i <
NumOperands &&
"getOperandUse() out of range!");
180 return isa<Instruction>(V) || isa<Constant>(V);
198 template<
typename UserTy>
200 return U - U->getUser()->op_begin();
static Use & OpFrom(const U *that)
const Use & getOperandUse(unsigned i) const
Value * operator*() const
Retrieve a pointer to the current Value.
unsigned getNumOperands() const
value_op_iterator(Use *U)
value_op_iterator value_op_begin()
Use & getOperandUse(unsigned i)
value_op_iterator value_op_end()
static bool classof(const Value *V)
#define llvm_unreachable(msg)
const_op_iterator op_end() const
const_op_iterator op_begin() const
bool operator==(const value_op_iterator &x) const
void replaceUsesOfWith(Value *From, Value *To)
value_op_iterator & operator++()
Iterator traversal: forward iteration only.
Value * getOperand(unsigned i) const
unsigned getOperandNo() const
static SimpleType getSimplifiedValue(User::const_op_iterator &Val)
void setOperand(unsigned i, Value *Val)
#define LLVM_DELETED_FUNCTION
User(Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
LLVM Value Representation.
bool operator!=(const value_op_iterator &x) const
Use * allocHungoffUses(unsigned) const
value_op_iterator operator++(int)
static SimpleType getSimplifiedValue(User::op_iterator &Val)
Value * operator->() const
static void zap(Use *Start, const Use *Stop, bool del=false)
const Use * const_op_iterator