diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index 8a46f7d8..6bebd3cc 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -45,7 +45,9 @@ static void EraseInstruction(IR::Block& block, IR::Inst* inst) { block.Instructions().erase(block.Instructions().iterator_to(*inst)); } -EmitX64::BlockDescriptor EmitX64::Emit(const Arm::LocationDescriptor descriptor, Dynarmic::IR::Block& block) { +EmitX64::BlockDescriptor EmitX64::Emit(IR::Block& block) { + const Arm::LocationDescriptor& descriptor = block.Location(); + reg_alloc.Reset(); code->int3(); diff --git a/src/backend_x64/emit_x64.h b/src/backend_x64/emit_x64.h index 40b7ef04..839feed1 100644 --- a/src/backend_x64/emit_x64.h +++ b/src/backend_x64/emit_x64.h @@ -34,8 +34,11 @@ public: size_t size; ///< Length in bytes of emitted code }; - /// Emit host machine code for a basic block starting at `descriptor` with intermediate representation `ir`. - BlockDescriptor Emit(const Arm::LocationDescriptor descriptor, IR::Block& ir); + /** + * Emit host machine code for a basic block with intermediate representation `ir`. + * @note ir is modified. + */ + BlockDescriptor Emit(IR::Block& ir); /// Looks up an emitted host block in the cache. boost::optional GetBasicBlock(Arm::LocationDescriptor descriptor) { diff --git a/src/backend_x64/interface_x64.cpp b/src/backend_x64/interface_x64.cpp index a485a5ba..e6baf808 100644 --- a/src/backend_x64/interface_x64.cpp +++ b/src/backend_x64/interface_x64.cpp @@ -100,7 +100,7 @@ private: Optimization::GetSetElimination(ir_block); Optimization::DeadCodeElimination(ir_block); Optimization::VerificationPass(ir_block); - return emitter.Emit(descriptor, ir_block); + return emitter.Emit(ir_block); } };