From ee973f13c7096e9c62484c3fe74e227f2e45dd28 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 5 Feb 2019 20:18:25 -0500 Subject: [PATCH] frontend/A32/ir_emitter: Mark PC() and AlignPC() as const-qualified member functions These don't modify instance state, so they can be const-qualified member functions. --- src/frontend/A32/ir_emitter.cpp | 8 ++++---- src/frontend/A32/ir_emitter.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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);