diff --git a/src/frontend/A32/ir_emitter.cpp b/src/frontend/A32/ir_emitter.cpp index 481e2dbe..24566532 100644 --- a/src/frontend/A32/ir_emitter.cpp +++ b/src/frontend/A32/ir_emitter.cpp @@ -12,13 +12,13 @@ namespace Dynarmic::A32 { using Opcode = IR::Opcode; -u32 IREmitter::PC() { - u32 offset = current_location.TFlag() ? 4 : 8; +u32 IREmitter::PC() const { + const u32 offset = current_location.TFlag() ? 4 : 8; return current_location.PC() + offset; } -u32 IREmitter::AlignPC(size_t alignment) { - u32 pc = PC(); +u32 IREmitter::AlignPC(size_t alignment) const { + const u32 pc = PC(); return static_cast(pc - pc % alignment); } diff --git a/src/frontend/A32/ir_emitter.h b/src/frontend/A32/ir_emitter.h index e9ccc248..ef9d958f 100644 --- a/src/frontend/A32/ir_emitter.h +++ b/src/frontend/A32/ir_emitter.h @@ -31,8 +31,8 @@ public: LocationDescriptor current_location; - u32 PC(); - u32 AlignPC(size_t alignment); + u32 PC() const; + u32 AlignPC(size_t alignment) const; IR::U32 GetRegister(Reg source_reg); IR::U32U64 GetExtendedRegister(ExtReg source_reg); diff --git a/src/frontend/A64/ir_emitter.cpp b/src/frontend/A64/ir_emitter.cpp index e01fa988..3a274b96 100644 --- a/src/frontend/A64/ir_emitter.cpp +++ b/src/frontend/A64/ir_emitter.cpp @@ -12,12 +12,12 @@ namespace Dynarmic::A64 { using Opcode = IR::Opcode; -u64 IREmitter::PC() { +u64 IREmitter::PC() const { return current_location->PC(); } -u64 IREmitter::AlignPC(size_t alignment) { - u64 pc = PC(); +u64 IREmitter::AlignPC(size_t alignment) const { + const u64 pc = PC(); return static_cast(pc - pc % alignment); } diff --git a/src/frontend/A64/ir_emitter.h b/src/frontend/A64/ir_emitter.h index e0d63a91..9983f4b4 100644 --- a/src/frontend/A64/ir_emitter.h +++ b/src/frontend/A64/ir_emitter.h @@ -31,8 +31,8 @@ public: std::optional current_location; - u64 PC(); - u64 AlignPC(size_t alignment); + u64 PC() const; + u64 AlignPC(size_t alignment) const; void SetCheckBit(const IR::U1& value); IR::U1 GetCFlag();