This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add target hook in C front end
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Dec 2001 15:09:32 -0800
- Subject: Re: [PATCH] Add target hook in C front end
- References: <20011218223641.A691@daikokuya.demon.co.uk>
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