[Value] Mark getOperandNumber as Const (#189267)
This commit is contained in:
@@ -35,7 +35,7 @@ public:
|
||||
static IRObjectWithUseList<BlockOperand> *getUseList(Block *value);
|
||||
|
||||
/// Return which operand this is in the BlockOperand list of the Operation.
|
||||
unsigned getOperandNumber();
|
||||
unsigned getOperandNumber() const;
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
}
|
||||
|
||||
/// Return which operand this is in the OpOperand list of the Operation.
|
||||
unsigned getOperandNumber();
|
||||
unsigned getOperandNumber() const;
|
||||
|
||||
/// Set the current value being used by this operand.
|
||||
void assign(Value value) { set(value); }
|
||||
|
||||
@@ -214,7 +214,7 @@ IRObjectWithUseList<BlockOperand> *BlockOperand::getUseList(Block *value) {
|
||||
}
|
||||
|
||||
/// Return which operand this is in the operand list.
|
||||
unsigned BlockOperand::getOperandNumber() {
|
||||
unsigned BlockOperand::getOperandNumber() const {
|
||||
return this - &getOwner()->getBlockOperands()[0];
|
||||
}
|
||||
|
||||
@@ -223,6 +223,6 @@ unsigned BlockOperand::getOperandNumber() {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// Return which operand this is in the operand list.
|
||||
unsigned OpOperand::getOperandNumber() {
|
||||
unsigned OpOperand::getOperandNumber() const {
|
||||
return this - &getOwner()->getOpOperands()[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user