This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Experiences using struct gcc_target


On Fri, Jul 06, 2001 at 12:12:06PM -0700, Stan Shebs wrote:
> Neil Booth wrote:
> > 
> > > 1a. Because expand_builtin gets rtxes as args, and because
> > > target.h is included in tree.c, I had to include rtl.h in tree.c.
> > > Although I don't think this is Evil(tm), it's certainly
> > > counterintuitive.
> > 
> > You shouldn't need to.  Your problem is rtx is a typedef.  Use a
> > (possibly predeclared) union rtx_def * (or whatever rtx really is).
> > You just have a pointer to the type, and not the type itself, so you
> > shouldn't need rtl.h.
> 
> I switched to struct rtx_def *, and added a forward definition
> of struct rtx_def to target.h.

The situation with the rtx and tree typedefs is really getting out of
hand.  It doesn't exactly belong, but I think we should put

struct rtx_def;
union tree_node;
typedef struct rtx_def *rtx;
typedef union tree_node *tree;

at the end of system.h, and (incrementally) change the existing places
that use 'struct rtx_def *' or 'union tree_node *' to use the typedefs
instead.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]