This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
main() in toplev.c
On 07-Jan-2001, Phil Edwards <pedwards@disaster.jaj.com> wrote:
> (In general, changing the top-level front-end files like gcc.c and toplev.c,
> to make adding new front-ends easier, is something I'd be quite interested
> in but wouldn't be able to do alone.)
One issue with the Mercury front-end is that both GCC (toplev.c)
and the existing Mercury compiler want to be in control at the top
level -- to define main(), to handle argument passing, and so forth.
It would be a lot easier if toplev.c didn't define main(), but instead
defined say toplev_main(), and main() was instead defined in a new file,
called say main.c, to just call toplev_main(). Then I could build the gcc
back-end as a library. This would make it a lot easier to integrate
this back-end into the rest of the Mercury implementation's infrastructure.
Would such a change be acceptable?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.