forked from OSchip/llvm-project
Do not allow a user to set the operand for a constant.
llvm-svn: 58335
This commit is contained in:
parent
7b747ef017
commit
e660fa88ee
|
@ -95,6 +95,9 @@ public:
|
||||||
}
|
}
|
||||||
void setOperand(unsigned i, Value *Val) {
|
void setOperand(unsigned i, Value *Val) {
|
||||||
assert(i < NumOperands && "setOperand() out of range!");
|
assert(i < NumOperands && "setOperand() out of range!");
|
||||||
|
assert((!isa<Constant>((const Value*)this) ||
|
||||||
|
isa<GlobalValue>((const Value*)this)) &&
|
||||||
|
"Cannot mutate a constant with setOperand!");
|
||||||
OperandList[i] = Val;
|
OperandList[i] = Val;
|
||||||
}
|
}
|
||||||
unsigned getNumOperands() const { return NumOperands; }
|
unsigned getNumOperands() const { return NumOperands; }
|
||||||
|
|
Loading…
Reference in New Issue