assert(i < Operands.size() && "setOperand() out of range!");
Operands[i] = Val;
}
+ inline void eraseOperand(unsigned i) {
+ assert(i < Operands.size() && "setOperand() out of range!");
+ Operands.erase(Operands.begin() + i);
+ }
inline unsigned getNumOperands() const { return Operands.size(); }
// ---------------------------------------------------------------------------
Value *getPointerOperand() { return getOperand(0); }
const Value *getPointerOperand() const { return getOperand(0); }
+ static unsigned getPointerOperandIndex() { return 0U; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const LoadInst *) { return true; }
Value *getPointerOperand() { return getOperand(1); }
const Value *getPointerOperand() const { return getOperand(1); }
+ static unsigned getPointerOperandIndex() { return 1U; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const StoreInst *) { return true; }
const Value *getPointerOperand() const {
return getOperand(0);
}
-
+ static unsigned getPointerOperandIndex() {
+ return 0U; // get index for modifying correct operand
+ }
+
inline unsigned getNumIndices() const { // Note: always non-negative
return getNumOperands() - 1;
}
void setIncomingValue(unsigned i, Value *V) {
Operands[i*2] = V;
}
+ inline unsigned getOperandNumForIncomingValue(unsigned i) {
+ return i*2;
+ }
/// getIncomingBlock - Return incoming basic block #x
const BasicBlock *getIncomingBlock(unsigned i) const {
inline void setIncomingBlock(unsigned i, BasicBlock *BB) {
Operands[i*2+1] = (Value*)BB;
}
+ inline unsigned getOperandNumForIncomingBlock(unsigned i) {
+ return i*2+1;
+ }
/// addIncoming - Add an incoming value to the end of the PHI list
void addIncoming(Value *D, BasicBlock *BB);