diff --git a/FEXCore/Source/Interface/IR/IREmitter.cpp b/FEXCore/Source/Interface/IR/IREmitter.cpp index 8eab63541..a0b265166 100644 --- a/FEXCore/Source/Interface/IR/IREmitter.cpp +++ b/FEXCore/Source/Interface/IR/IREmitter.cpp @@ -33,7 +33,7 @@ bool IsBlockExit(FEXCore::IR::IROps Op) { } } -RegClass IREmitter::WalkFindRegClass(Ref Node) { +RegClass IREmitter::WalkFindRegClass(Ref Node) const { auto Class = GetOpRegClass(Node); switch (Class) { case RegClass::GPR: @@ -45,9 +45,8 @@ RegClass IREmitter::WalkFindRegClass(Ref Node) { } // Complex case, needs to be handled on an op by op basis - uintptr_t DataBegin = DualListData.DataBegin(); - - FEXCore::IR::IROp_Header* IROp = Node->Op(DataBegin); + const uintptr_t DataBegin = DualListData.DataBegin(); + const auto* IROp = Node->Op(DataBegin); switch (IROp->Op) { case IROps::OP_LOADREGISTER: { diff --git a/FEXCore/Source/Interface/IR/IREmitter.h b/FEXCore/Source/Interface/IR/IREmitter.h index 061d99c0b..f2a04b40a 100644 --- a/FEXCore/Source/Interface/IR/IREmitter.h +++ b/FEXCore/Source/Interface/IR/IREmitter.h @@ -45,7 +45,7 @@ public: * * @{ */ - RegClass WalkFindRegClass(Ref Node); + RegClass WalkFindRegClass(Ref Node) const; // These inlining helpers are used by IRDefines.inc so define first. Ref InlineMem(OpSize Size, Ref Offset, MemOffsetType OffsetType, uint8_t& OffsetScale, bool TSO = false) { @@ -310,14 +310,14 @@ public: } /** @} */ - RegClass WalkFindRegClass(OrderedNodeWrapper ssa) { - Ref RealNode = ssa.GetNode(DualListData.ListBegin()); + RegClass WalkFindRegClass(OrderedNodeWrapper ssa) const { + auto RealNode = ssa.GetNode(DualListData.ListBegin()); return WalkFindRegClass(RealNode); } - bool IsValueConstant(OrderedNodeWrapper ssa, uint64_t* Constant = nullptr) { - Ref RealNode = ssa.GetNode(DualListData.ListBegin()); - FEXCore::IR::IROp_Header* IROp = RealNode->Op(DualListData.DataBegin()); + bool IsValueConstant(OrderedNodeWrapper ssa, uint64_t* Constant = nullptr) const { + auto RealNode = ssa.GetNode(DualListData.ListBegin()); + const auto* IROp = RealNode->Op(DualListData.DataBegin()); if (IROp->Op == OP_CONSTANT) { auto Op = IROp->C(); if (Constant) { @@ -328,9 +328,9 @@ public: return false; } - bool IsValueInlineConstant(OrderedNodeWrapper ssa) { - Ref RealNode = ssa.GetNode(DualListData.ListBegin()); - FEXCore::IR::IROp_Header* IROp = RealNode->Op(DualListData.DataBegin()); + bool IsValueInlineConstant(OrderedNodeWrapper ssa) const { + auto RealNode = ssa.GetNode(DualListData.ListBegin()); + const auto* IROp = RealNode->Op(DualListData.DataBegin()); if (IROp->Op == OP_INLINECONSTANT) { return true; }