From a9a9b193bb864b540b7db65be2663cd31cb3a793 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 8 Jul 2019 18:07:11 -0400 Subject: [PATCH] Common/DebugInterface: Use forward declarations where applicable We're allowed (by the standard) to forward declare types within std::vector, so we can replace direct includes with forward declarations and then include the types where they're directly needed. While we're at it, we can remove an unused inclusion of , given nothing in the header uses anything from it. This also revealed an indirect inclusion, which this also resolves. --- Source/Core/Common/DebugInterface.h | 15 +++++++++------ Source/Core/Core/Debugger/PPCDebugInterface.h | 2 ++ Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h | 2 ++ Source/Core/Core/PowerPC/PPCSymbolDB.cpp | 1 + 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/Core/Common/DebugInterface.h b/Source/Core/Common/DebugInterface.h index c17df7e908..4ae5fd4174 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -5,13 +5,16 @@ #pragma once #include -#include #include #include #include "Common/CommonTypes.h" -#include "Common/Debug/MemoryPatches.h" -#include "Common/Debug/Watches.h" + +namespace Common::Debug +{ +struct MemoryPatch; +struct Watch; +} // namespace Common::Debug namespace Common { @@ -23,8 +26,8 @@ protected: public: // Watches virtual std::size_t SetWatch(u32 address, std::string name = "") = 0; - virtual const Common::Debug::Watch& GetWatch(std::size_t index) const = 0; - virtual const std::vector& GetWatches() const = 0; + virtual const Debug::Watch& GetWatch(std::size_t index) const = 0; + virtual const std::vector& GetWatches() const = 0; virtual void UnsetWatch(u32 address) = 0; virtual void UpdateWatch(std::size_t index, u32 address, std::string name) = 0; virtual void UpdateWatchAddress(std::size_t index, u32 address) = 0; @@ -40,7 +43,7 @@ public: // Memory Patches virtual void SetPatch(u32 address, u32 value) = 0; virtual void SetPatch(u32 address, std::vector value) = 0; - virtual const std::vector& GetPatches() const = 0; + virtual const std::vector& GetPatches() const = 0; virtual void UnsetPatch(u32 address) = 0; virtual void EnablePatch(std::size_t index) = 0; virtual void DisablePatch(std::size_t index) = 0; diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index 16abb1b9df..b0536a4c6c 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -7,6 +7,8 @@ #include #include +#include "Common/Debug/MemoryPatches.h" +#include "Common/Debug/Watches.h" #include "Common/DebugInterface.h" class PPCPatches : public Common::Debug::MemoryPatches diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h index 5bc50bca3d..ab02f342bc 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h @@ -8,6 +8,8 @@ #include #include "Common/CommonTypes.h" +#include "Common/Debug/MemoryPatches.h" +#include "Common/Debug/Watches.h" #include "Common/DebugInterface.h" namespace DSP::LLE diff --git a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp index f5a84f2d07..1412533bf4 100644 --- a/Source/Core/Core/PowerPC/PPCSymbolDB.cpp +++ b/Source/Core/Core/PowerPC/PPCSymbolDB.cpp @@ -5,6 +5,7 @@ #include "Core/PowerPC/PPCSymbolDB.h" #include +#include #include #include #include