This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Language hooks
- To: Geert Bosch <bosch at gnat dot com>
- Subject: Re: Language hooks
- From: Neil Booth <neilb at earthling dot net>
- Date: Sun, 7 Jan 2001 14:28:16 +0000
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>,Tim Josling <tej at melbpc dot org dot au>
- References: <20010107141233.ECCEE34D80@nile.gnat.com>
Geert Bosch wrote:-
> Has something been changed already in this area? Our GNAT builds failed
Yes.
> with:
> ../toplev.o: In function `main':
> /tara.a/gnatmail-5/build-tara/gcc/gcc/toplev.c:4754: undefined reference to `lang_hooks'
> make[1]: *** [../gnat1] Error 1
> make[1]: Leaving directory `/tara.a/gnatmail-5/build-tara/objdir/gcc/ada'
> make: *** [gnat1] Error 2
>
> Can anyone tell me what has changed here, and what needs to be done
> to fix this?
Probably copy what's done in the java front end. Like java/lang.c:-
/* Each front end provides its own. */
struct lang_hooks lang_hooks = {NULL /* post_options */};
just provide a lang_hooks with a NULL handler as above, in a file that
#includes toplev.h.
I will be replacing various global functions as hooks over the next
week or so, things like lang_init (), lang_finish (),
lang_options_init () etc. etc. I think it's a small improvement to
collect all the fe-specific stuff into one place like this. It also
means front-ends can just give a NULL pointer rather than having to
supply empty functions for things they don't care about.
Neil.