cpplib: patch for special_symbol

Dave Brolley brolley@cygnus.com
Sun Feb 28 18:15:00 GMT 1999


OK.....go ahead an install this.

Dave

Zack Weinberg wrote:

> This patch is a rewrite of special_symbol.  The main point is that
> there are no longer individual special hashnode types for most of the
> builtin macros, so special_symbol gets simpler and the #ifdef mess and
> system dependent #define usage is confined to initialize_builtins.
> This will make it easier to split out the initialization code.  I also
> exorcised some old gunk relating to __STDC__ and __OBJC__ (behavior
> now matches cccp) and redid the handling of `defined' such that only
> cppexp.c has to worry about it.  (well, do_define has to not let you
> define defined, but that's easy).
>
> No regressions versus previous cpplib on x86-linux.  I see one
> regression vs cccp which appears to be a problem in the buffer
> stack handling, this was present before and is unrelated to this
> patch.  I will work on that regression next.
>
> zw
>
> 1999-02-04 17:18 -0500  Zack Weinberg  <zack@midnite.ec.rhno.columbia.edu>
>
>         * cpplib.c (special_symbol): Rewrite.  Don't copy things
>           multiple times.  Handle __STDC__ specially.  T_CONST
>           indicates a constant /string/.  Don't handle T_*_TYPE and
>           T_SPEC_DEFINED.  Use cpp_buf_line_and_col instead of
>           adjust_position.  Determine the file buffer only if needed.
>           (initialize_builtins): Handle __SIZE_TYPE__,
>           __PTRDIFF_TYPE__, __WCHAR_TYPE__, __USER_LABEL_PREFIX__, and
>           __REGISTER_PREFIX__ with T_CONST special hashtab entries.
>           Don't provide __OBJC__; the driver does that.  Provide
>           __STDC_VERSION__, using T_CONST.  Use T_STDC for
>           __STDC__.  Give install the length of all symbols defined.
>           (eval_if_expression): Drop code to insert and remove the
>           "defined" special symbol.
>
>         * cpplib.h: Remove SELF_DIR_DUMMY (obsolete for a long time
>           now).  Remove T_*_TYPE and T_SPEC_DEFINED from enum
>           node_type; add T_STDC.
>
>         * cpphash.c (install): Drop the `ivalue' parameter.
>           Constify the `value' parameter.  All callers changed.
>         * cpphash.h (install): Change prototype to match.
>           (union hashval): Remove `ival' member.
>         * cppexp.c (cpp_lex): Handle `defined' here.






More information about the Gcc-patches mailing list