summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-08-13 06:57:26 -0400
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>2014-08-13 06:57:26 -0400
commit25f5a6733cbca02f0db9839a00dec30f9751b462 (patch)
tree704352cb9c2ccb8d4cd4c2ae396f88096c736466 /src
parent43f1e41c02cd37c2ae565876d219e6e3621bcd6b (diff)
downloadgem5-25f5a6733cbca02f0db9839a00dec30f9751b462.tar.xz
cpu: Don't forward declare RefCountingPtr
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.
Diffstat (limited to 'src')
-rw-r--r--src/base/types.hh3
-rw-r--r--src/cpu/static_inst_fwd.hh3
-rw-r--r--src/sim/fault_fwd.hh3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/base/types.hh b/src/base/types.hh
index ad9ac766e..9ef362fa1 100644
--- a/src/base/types.hh
+++ b/src/base/types.hh
@@ -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__
diff --git a/src/cpu/static_inst_fwd.hh b/src/cpu/static_inst_fwd.hh
index 7e2172f72..554de4928 100644
--- a/src/cpu/static_inst_fwd.hh
+++ b/src/cpu/static_inst_fwd.hh
@@ -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__
diff --git a/src/sim/fault_fwd.hh b/src/sim/fault_fwd.hh
index 64ccd4b15..3fd90caeb 100644
--- a/src/sim/fault_fwd.hh
+++ b/src/sim/fault_fwd.hh
@@ -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;