From b1b9c6aa1e8c04a89f2d6e08960e67665bcabda2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 8 Jul 2019 17:44:56 -0400 Subject: [PATCH] Common/DebugInterface: Default virtual destructor While we're at it, we can also default the constructor and destructor of inheriting classes in their respective cpp file to prevent the construction and destruction of non-trivial types being inlined into other regions of code. --- Source/Core/Common/DebugInterface.h | 2 +- Source/Core/Core/Debugger/PPCDebugInterface.cpp | 3 +++ Source/Core/Core/Debugger/PPCDebugInterface.h | 4 +++- Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp | 3 +++ Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h | 4 +++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/DebugInterface.h b/Source/Core/Common/DebugInterface.h index 0368f55f1e..28312e4bb7 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -18,7 +18,7 @@ namespace Common class DebugInterface { protected: - virtual ~DebugInterface() {} + virtual ~DebugInterface() = default; public: // Watches diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index d8840b5e14..497ebdb7d6 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -44,6 +44,9 @@ void PPCPatches::Patch(std::size_t index) } } +PPCDebugInterface::PPCDebugInterface() = default; +PPCDebugInterface::~PPCDebugInterface() = default; + std::size_t PPCDebugInterface::SetWatch(u32 address, std::string name) { return m_watches.SetWatch(address, std::move(name)); diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index 36ff0f9c32..ed86a70592 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -20,7 +20,9 @@ private: class PPCDebugInterface final : public Common::DebugInterface { public: - PPCDebugInterface() {} + PPCDebugInterface(); + ~PPCDebugInterface() override; + // Watches std::size_t SetWatch(u32 address, std::string name = "") override; const Common::Debug::Watch& GetWatch(std::size_t index) const override; diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp index 3a5d2b8c14..7fbad5dfd9 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp @@ -20,6 +20,9 @@ void DSPPatches::Patch(std::size_t index) PanicAlert("Patch functionality not supported in DSP module."); } +DSPDebugInterface::DSPDebugInterface() = default; +DSPDebugInterface::~DSPDebugInterface() = default; + std::size_t DSPDebugInterface::SetWatch(u32 address, std::string name) { return m_watches.SetWatch(address, std::move(name)); diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h index c1cd0507cf..2f373408d3 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h @@ -21,7 +21,9 @@ private: class DSPDebugInterface final : public Common::DebugInterface { public: - DSPDebugInterface() {} + DSPDebugInterface(); + ~DSPDebugInterface() override; + // Watches std::size_t SetWatch(u32 address, std::string name = "") override; const Common::Debug::Watch& GetWatch(std::size_t index) const override;