[Value] Mark getOperandNumber as Const (#189267)

This commit is contained in:
Michael Marjieh
2026-03-30 13:27:11 +03:00
committed by GitHub
parent d3f1e0dde0
commit ccb64cb53e
3 changed files with 4 additions and 4 deletions

View File

@@ -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;
};
//===----------------------------------------------------------------------===//

View File

@@ -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); }

View File

@@ -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];
}