From 523ae542f4509ed0e8e873ac975aa5f53a7b1700 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 4 Apr 2017 13:10:50 +0100 Subject: [PATCH] microinstruction: Implement HasAssociatedPseudoOperation --- src/frontend/ir/microinstruction.cpp | 4 ++++ src/frontend/ir/microinstruction.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/frontend/ir/microinstruction.cpp b/src/frontend/ir/microinstruction.cpp index 7ed7dc34..e0fd0e68 100644 --- a/src/frontend/ir/microinstruction.cpp +++ b/src/frontend/ir/microinstruction.cpp @@ -251,6 +251,10 @@ void Inst::DecrementRemainingUses() { use_count--; } +bool Inst::HasAssociatedPseudoOperation() const { + return carry_inst || overflow_inst || ge_inst; +} + Inst* Inst::GetAssociatedPseudoOperation(Opcode opcode) { // This is faster than doing a search through the block. switch (opcode) { diff --git a/src/frontend/ir/microinstruction.h b/src/frontend/ir/microinstruction.h index c898426b..ead1b904 100644 --- a/src/frontend/ir/microinstruction.h +++ b/src/frontend/ir/microinstruction.h @@ -83,6 +83,8 @@ public: bool HasUses() const { return use_count > 0; } void DecrementRemainingUses(); + /// Determines if there is a pseudo-operation associated with this instruction. + bool HasAssociatedPseudoOperation() const; /// Gets a pseudo-operation associated with this instruction. Inst* GetAssociatedPseudoOperation(Opcode opcode);