changeset 4cbfdcdb2144 in /z/repo/gem5 details: http://repo.gem5.org/gem5?cmd=changeset;node=4cbfdcdb2144 description: 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: src/base/types.hh | 3 ++- src/cpu/static_inst_fwd.hh | 3 ++- src/sim/fault_fwd.hh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diffs (48 lines): diff -r 84b4d6af0ecc -r 4cbfdcdb2144 src/base/types.hh --- a/src/base/types.hh Wed Aug 13 06:57:25 2014 -0400 +++ b/src/base/types.hh Wed Aug 13 06:57:26 2014 -0400 @@ -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 @@ const PortID InvalidPortID = (PortID)-1; class FaultBase; -template <class T> class RefCountingPtr; typedef RefCountingPtr<FaultBase> Fault; #endif // __BASE_TYPES_HH__ diff -r 84b4d6af0ecc -r 4cbfdcdb2144 src/cpu/static_inst_fwd.hh --- a/src/cpu/static_inst_fwd.hh Wed Aug 13 06:57:25 2014 -0400 +++ b/src/cpu/static_inst_fwd.hh Wed Aug 13 06:57:26 2014 -0400 @@ -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 -r 84b4d6af0ecc -r 4cbfdcdb2144 src/sim/fault_fwd.hh --- a/src/sim/fault_fwd.hh Wed Aug 13 06:57:25 2014 -0400 +++ b/src/sim/fault_fwd.hh Wed Aug 13 06:57:26 2014 -0400 @@ -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; _______________________________________________ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev