diff --git a/src/backend_x64/a32_emit_x64.cpp b/src/backend_x64/a32_emit_x64.cpp index fa62a484..d3dfd0ac 100644 --- a/src/backend_x64/a32_emit_x64.cpp +++ b/src/backend_x64/a32_emit_x64.cpp @@ -119,11 +119,11 @@ A32EmitX64::BlockDescriptor A32EmitX64::Emit(IR::Block& block) { EmitX64::EmitTerminal(block.GetTerminal(), block.Location()); code->int3(); - const A32::LocationDescriptor descriptor = block.Location(); + const A32::LocationDescriptor descriptor{block.Location()}; Patch(descriptor, entrypoint); const size_t size = static_cast(code->getCurr() - entrypoint); - const A32::LocationDescriptor end_location = block.EndLocation(); + const A32::LocationDescriptor end_location{block.EndLocation()}; const auto range = boost::icl::discrete_interval::closed(descriptor.PC(), end_location.PC() - 1); A32EmitX64::BlockDescriptor block_desc{entrypoint, size, block.Location(), range}; block_descriptors.emplace(descriptor.UniqueHash(), block_desc); @@ -1087,7 +1087,8 @@ void A32EmitX64::EmitTerminalImpl(IR::Term::ReturnToDispatch, IR::LocationDescri code->ReturnFromRunCode(); } -static u32 CalculateCpsr_et(const A32::LocationDescriptor& desc) { +static u32 CalculateCpsr_et(const IR::LocationDescriptor& arg) { + const A32::LocationDescriptor desc{arg}; u32 et = 0; et |= desc.EFlag() ? 2 : 0; et |= desc.TFlag() ? 1 : 0; diff --git a/src/backend_x64/a32_interface.cpp b/src/backend_x64/a32_interface.cpp index f7e38bd7..bf1f3e76 100644 --- a/src/backend_x64/a32_interface.cpp +++ b/src/backend_x64/a32_interface.cpp @@ -159,7 +159,7 @@ private: PerformCacheInvalidation(); } - IR::Block ir_block = A32::Translate(descriptor, callbacks.memory.ReadCode); + IR::Block ir_block = A32::Translate(A32::LocationDescriptor{descriptor}, callbacks.memory.ReadCode); Optimization::GetSetElimination(ir_block); Optimization::DeadCodeElimination(ir_block); Optimization::ConstantPropagation(ir_block, callbacks.memory); diff --git a/src/frontend/A32/location_descriptor.h b/src/frontend/A32/location_descriptor.h index 0b4fc4c5..065d9ebd 100644 --- a/src/frontend/A32/location_descriptor.h +++ b/src/frontend/A32/location_descriptor.h @@ -32,7 +32,7 @@ public: LocationDescriptor(u32 arm_pc, PSR cpsr, FPSCR fpscr) : arm_pc(arm_pc), cpsr(cpsr.Value() & CPSR_MODE_MASK), fpscr(fpscr.Value() & FPSCR_MODE_MASK) {} - /*implict*/ LocationDescriptor(const IR::LocationDescriptor& o) { + explicit LocationDescriptor(const IR::LocationDescriptor& o) { arm_pc = o.Value() >> 32; cpsr.T(o.Value() & 1); cpsr.E(o.Value() & 2);