Plane down the CPP builtins table a bit
Neil Booth
neil@daikokuya.demon.co.uk
Fri May 17 13:25:00 GMT 2002
Zack Weinberg wrote:-
> Recent rearrangement left the builtins table sporting a bunch of
> unnecessary fields, with associated junk code in init_builtins().
> This is a pure cleanup - no behavior changes should occur at all.
>
> A bit of explication: There were only two kinds of entries left in the
> builtins table, true special-case macros (__LINE__ etc) and C++ named
> operators (formerly "defined" was a named operator, but it is now
> handled elsewhere). I split the table in two, one for each kind; this
> allowed me to remove the flag field entirely. The value field was
> already unused. I combined the operator and builtin fields into one,
> which let me get rid of all but one of the remaining notation macros.
>
> It compiles cleanly; if it passes a bootstrap I will apply it.
>
> zw
>
> * cppinit.c (struct builtin): Remove unused fields.
> (CPLUS, BUILTIN, OPERATOR, O, builtin_array_end): Kill.
> (operator_array): New - was second half of builtin_array.
> (init_builtins): Simplify loop over builtin_array/operator_array.
LOL! I did an almost identical patch on my drive this morning. Never
mind.
So we don't cross over again, are you going to remove the remaining
builtins to c-common.c? I think the following can go, as they are
effectively properties of the front-end implementation, rather
than mandated by the standard:
__OBJC__ __CHAR_UNSIGNED__ __STRICT_ANSI__ and __ASSEMBLER__.
I favour leaving __cplusplus and __STDC_VERSION__ in cpplib, as these
are mandated by the standard, and so are a more natural part of a
stand-alone library.
I'll continue with traditional stuff, and maybe config/ gunk.
Neil.
[And, by similar logic, the code for __STDC__ in cppmacro.c should,
IMO, no longer use __STRICT_ANSI__ as a test, but test for one of the
three C standards directly.]
More information about the Gcc-patches
mailing list