From 22804dc6a595abfa5e81ae94be11a40365743834 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 29 Jan 2017 22:53:46 +0000 Subject: [PATCH] microinstruction: Arguments of Inst::Use and Inst::UndoUse should be const --- src/frontend/ir/microinstruction.cpp | 4 ++-- src/frontend/ir/microinstruction.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/ir/microinstruction.cpp b/src/frontend/ir/microinstruction.cpp index c0416023..1356d7ae 100644 --- a/src/frontend/ir/microinstruction.cpp +++ b/src/frontend/ir/microinstruction.cpp @@ -312,7 +312,7 @@ void Inst::ReplaceUsesWith(Value replacement) { args[0] = replacement; } -void Inst::Use(Value& value) { +void Inst::Use(const Value& value) { value.GetInst()->use_count++; 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--; switch (op){ diff --git a/src/frontend/ir/microinstruction.h b/src/frontend/ir/microinstruction.h index 54462671..fb5ab473 100644 --- a/src/frontend/ir/microinstruction.h +++ b/src/frontend/ir/microinstruction.h @@ -98,8 +98,8 @@ public: void ReplaceUsesWith(Value replacement); private: - void Use(Value& value); - void UndoUse(Value& value); + void Use(const Value& value); + void UndoUse(const Value& value); Opcode op; size_t use_count = 0;