This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Move more predefined macros
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 May 2002 07:19:22 +0100
- Subject: Re: Move more predefined macros
- References: <20020516060540.GI572@codesourcery.com>
Zack Weinberg wrote:-
> This patch moves the definition of __REGISTER_PREFIX__,
> __USER_LABEL_PREFIX__, and __VERSION__ into c-common.c, and eliminates
> __HAVE_BUILTIN_SETJMP__. It also adjusts the way the
> STDC_0_IN_SYSTEM_HEADERS hack works so that it does not require
> #ifdeffage in cpplib.
Nice.
> No target-specific code is affected. Neil, I'd like your opinion on
> the aesthetics of the change to builtin_define_with_value; should the
> flag parameter be two separate functions instead?
It's not pretty, but OK for now I guess. Probably two functions would
be better.
> Future potential changes along these lines are: move the
> builtin_define_* routines from c-common to cpplib (they are
> semi-duplicates of internal cpplib routines); move the definitions of
> __cplusplus etc to c-common. I'd appreciate opinions on both.
I'm thinking of having a new interface in cpplib that takes the
macro and its expansion separately. At present, we just burn cycles
copying the string, replacing the first '=', and then letting the
lexer separate them out again.
It might be nicer to just to a cpp_lookup() on the name and jump
straight into lexing the definition.
Neil.