Review Board 2.0.15


CPU: Trim unnecessary includes from some common files.

Review Request #242 - Created Aug. 31, 2010 and submitted

Information
Gabe Black
gem5
Reviewers
Default
CPU: Trim unnecessary includes from some common files.

This reduces the scope of those includes and makes it less likely for there to
be a dependency loop. This also moves the hashing functions associated with
ExtMachInst objects to be with the ExtMachInst definitions and out of
utility.hh.

   
Ship it!
Posted (Sept. 8, 2010, 1:58 p.m.)
Seems reasonable.  I'm not quite sure why the various hash functions moved from utility to arch/types.hh, but I'll accept that you have a good reason for that.  (i.e. a good reason might be that utility.hh is used in many places and arch/types.hh is not and you just need some place to stick the hash function).
  1. Basically, if you're going to be hashing the ExtMachInst type you need to have access to the ExtMachInst type in the first place, so you've already included arch/types.hh. If you're working with the ExtMachInst type you may want to hash it, and this way the function is already available. It just groups the little support functions necessary to get full use of the ExtMachInst type with its definition which is the only place they'd be needed.
  2. That's one way to look at it.  I look at it from a different direction.  Whenever you need a definition of ExtMachInst, you get the hash function for it as well and #include a couple of files.  This of course impacts compile time.  It's probably not too big a deal though.