cpu: Don't forward declare RefCountingPtr
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>
Wed, 13 Aug 2014 10:57:26 +0000 (06:57 -0400)
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>
Wed, 13 Aug 2014 10:57:26 +0000 (06:57 -0400)
RefCountingPtr is sometimes forward declared to avoid having to
include refcnt.hh. This does not work since we typically return
instances of RefCountingPtr rather than references to instances. The
only reason this currently works is that we include refcnt.hh in
cprintf.hh, which "leaks" the header to most other source files. This
changeset replaces such forward declarations with an include of
refcnt.hh.

src/base/types.hh
src/cpu/static_inst_fwd.hh
src/sim/fault_fwd.hh

index ad9ac766e935943ecf7d63a4e8b3be808abf2788..9ef362fa1a1c81220ab3a60b1c95b75ceabd788d 100644 (file)
@@ -42,6 +42,8 @@
 #include <cassert>
 #include <ostream>
 
+#include "base/refcnt.hh"
+
 /** uint64_t constant */
 #define ULL(N)          ((uint64_t)N##ULL)
 /** int64_t constant */
@@ -177,7 +179,6 @@ typedef int16_t PortID;
 const PortID InvalidPortID = (PortID)-1;
 
 class FaultBase;
-template <class T> class RefCountingPtr;
 typedef RefCountingPtr<FaultBase> Fault;
 
 #endif // __BASE_TYPES_HH__
index 7e2172f72d857e0737e915fec45e8a9859748961..554de49286b9945bc81a95a0a31554ccb985493b 100644 (file)
@@ -31,8 +31,9 @@
 #ifndef __CPU_STATIC_INST_FWD_HH__
 #define __CPU_STATIC_INST_FWD_HH__
 
+#include "base/refcnt.hh"
+
 class StaticInst;
-template <class T> class RefCountingPtr;
 typedef RefCountingPtr<StaticInst> StaticInstPtr;
 
 #endif // __CPU_STATIC_INST_FWD_HH__
index 64ccd4b15eca84117b52f07e8c68a7bb28446710..3fd90caebabfce10b1ff38275f9206815ed4101a 100644 (file)
@@ -31,8 +31,9 @@
 #ifndef __SIM_FAULT_FWD_HH__
 #define __SIM_FAULT_FWD_HH__
 
+#include "base/refcnt.hh"
+
 class FaultBase;
-template <class T> class RefCountingPtr;
 typedef RefCountingPtr<FaultBase> Fault;
 
 FaultBase * const NoFault = 0;