This is the mail archive of the gcc-patches@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: Language hooks


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.

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