From 703a46ec99b065850811b91db13886a3ec8610df Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 18 Jul 2016 11:27:33 -0500 Subject: [PATCH] Pass the current IR::Block by reference to the emitter. This avoids calling the copy constructor more times than needed. --- src/backend_x64/emit_x64.cpp | 2 +- src/backend_x64/emit_x64.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index 9625e995..7500dcab 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -37,7 +37,7 @@ static IR::Inst* FindUseWithOpcode(IR::Inst* inst, IR::Opcode opcode) { return iter == uses.end() ? nullptr : reinterpret_cast(iter->get()); } -CodePtr EmitX64::Emit(const Arm::LocationDescriptor descriptor, Dynarmic::IR::Block block) { +CodePtr EmitX64::Emit(const Arm::LocationDescriptor descriptor, const Dynarmic::IR::Block& block) { inhibit_emission.clear(); reg_alloc.Reset(); diff --git a/src/backend_x64/emit_x64.h b/src/backend_x64/emit_x64.h index da19408a..8d5380c1 100644 --- a/src/backend_x64/emit_x64.h +++ b/src/backend_x64/emit_x64.h @@ -23,7 +23,7 @@ public: EmitX64(Gen::XEmitter* code, Routines* routines, UserCallbacks cb, Jit* jit_interface) : reg_alloc(code), code(code), routines(routines), cb(cb), jit_interface(jit_interface) {} - CodePtr Emit(const Arm::LocationDescriptor descriptor, IR::Block ir); + CodePtr Emit(const Arm::LocationDescriptor descriptor, const IR::Block& ir); CodePtr GetBasicBlock(Arm::LocationDescriptor descriptor) { auto iter = basic_blocks.find(descriptor);