microinstruction: Arguments of Inst::Use and Inst::UndoUse should be const
This commit is contained in:
parent
1d4446cad5
commit
22804dc6a5
2 changed files with 4 additions and 4 deletions
|
@ -312,7 +312,7 @@ void Inst::ReplaceUsesWith(Value replacement) {
|
||||||
args[0] = replacement;
|
args[0] = replacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inst::Use(Value& value) {
|
void Inst::Use(const Value& value) {
|
||||||
value.GetInst()->use_count++;
|
value.GetInst()->use_count++;
|
||||||
|
|
||||||
switch (op){
|
switch (op){
|
||||||
|
@ -333,7 +333,7 @@ void Inst::Use(Value& value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inst::UndoUse(Value& value) {
|
void Inst::UndoUse(const Value& value) {
|
||||||
value.GetInst()->use_count--;
|
value.GetInst()->use_count--;
|
||||||
|
|
||||||
switch (op){
|
switch (op){
|
||||||
|
|
|
@ -98,8 +98,8 @@ public:
|
||||||
void ReplaceUsesWith(Value replacement);
|
void ReplaceUsesWith(Value replacement);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Use(Value& value);
|
void Use(const Value& value);
|
||||||
void UndoUse(Value& value);
|
void UndoUse(const Value& value);
|
||||||
|
|
||||||
Opcode op;
|
Opcode op;
|
||||||
size_t use_count = 0;
|
size_t use_count = 0;
|
||||||
|
|
Loading…
Reference in a new issue