This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Experiences using struct gcc_target
- To: Stan Shebs <shebs at apple dot com>
- Subject: Re: Experiences using struct gcc_target
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Fri, 6 Jul 2001 12:24:58 -0700
- Cc: Neil Booth <neil at daikokuya dot demon dot co dot uk>, gcc at gcc dot gnu dot org
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