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]

Experiences using struct gcc_target


OK, I have a first version of sources modified to use the new
gcc_target struct to define target-specific builtins, and the
resulting compilers seem to work (exercising manually, in the
absence of tests for any of these builtins, ahem).  Here are
a couple things I ran into, that we should think about:

1. target.h has to be included manually everywhere, which is
a lot of file touching.  Perhaps it should be included from
tm.h or some such?  A fully filled-out target.h is going to
be needed by just about every source file.

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.

2. There are lots and lots of local variables named "target"
in the sources, and every one of them is going to mask the global
"target" that is the function vector.  I don't know whether it
makes more sense to change the global's name or to adjust each
function as conflicts occur.

Even with these little difficulties, I really like the new setup.
It will go a long way to cleaning up some of rat's nests of ifdefs
that have accumulated in the compiler	, and as a bonus, I don't have
to touch <arch>.h and do massive rebuilds over and over...

Stan


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