[PATCH] Add target hook in C front end

Zack Weinberg zack@codesourcery.com
Tue Dec 18 15:18:00 GMT 2001


On Tue, Dec 18, 2001 at 10:36:41PM +0000, Neil Booth wrote:
> > Add two new entries to struct cpp_callbacks in cpplib.h.  One gets
> > called in cpp_handle_option, when you encounter an -m switch.  (You'll
> > need to treat -m rather like -W.)  The other gets called from
> > cpp_start_read right before we process -D switches.
> 
> Is this necessary?  I suspect we can handle this without touching
> cpplib at all.
> 
> The -m switches in the front ends are handled, to the best of my
> knowledge, by toplev.c's independent_decode_option().  This in turn
> passes it on to set_target_switch().

Which could indeed perfectly well call cpp_define, yes, but then (in the
present setup) -save-temps would not work at all.  You'd have
__SIZE_TYPE__ passed through to the .i file, and cc1 wouldn't do
anything with it either since macro expansion is off with
-fpreprocessed.

zw



More information about the Gcc-patches mailing list