backend_x64/callback: Default virtual destructor in the cpp file

Prevents the vtable being generated in each translation unit that includes the header (and silences -Wweak-vtables warnings)
This commit is contained in:
Lioncash 2018-05-01 09:10:49 -04:00 committed by MerryMage
parent edd0b5c8c7
commit 4efbd40ea4
2 changed files with 3 additions and 5 deletions

View file

@ -9,6 +9,8 @@
namespace Dynarmic::BackendX64 { namespace Dynarmic::BackendX64 {
Callback::~Callback() = default;
void SimpleCallback::EmitCall(BlockOfCode& code, std::function<void(RegList)> l) const { void SimpleCallback::EmitCall(BlockOfCode& code, std::function<void(RegList)> l) const {
l({code.ABI_PARAM1, code.ABI_PARAM2, code.ABI_PARAM3, code.ABI_PARAM4}); l({code.ABI_PARAM1, code.ABI_PARAM2, code.ABI_PARAM3, code.ABI_PARAM4});
code.CallFunction(fn); code.CallFunction(fn);

View file

@ -21,7 +21,7 @@ class BlockOfCode;
class Callback { class Callback {
public: public:
virtual ~Callback() = default; virtual ~Callback();
virtual void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const = 0; virtual void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const = 0;
virtual void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const = 0; virtual void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const = 0;
@ -32,8 +32,6 @@ public:
template <typename Function> template <typename Function>
SimpleCallback(Function fn) : fn(reinterpret_cast<void(*)()>(fn)) {} SimpleCallback(Function fn) : fn(reinterpret_cast<void(*)()>(fn)) {}
~SimpleCallback() override = default;
void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const override; void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const override;
void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const override; void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const override;
@ -46,8 +44,6 @@ public:
template <typename Function> template <typename Function>
ArgCallback(Function fn, u64 arg) : fn(reinterpret_cast<void(*)()>(fn)), arg(arg) {} ArgCallback(Function fn, u64 arg) : fn(reinterpret_cast<void(*)()>(fn)), arg(arg) {}
~ArgCallback() override = default;
void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const override; void EmitCall(BlockOfCode& code, std::function<void(RegList)> fn = [](RegList){}) const override;
void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const override; void EmitCallWithReturnPointer(BlockOfCode& code, std::function<void(Xbyak::Reg64, RegList)> fn) const override;