diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-08 20:27:27 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-08 20:27:27 +0000 |
commit | 963e5f16de1a3f9a79b4a5949626f83868e513a0 (patch) | |
tree | c079b4e9cc9eae1f223a405bc08b6a1cd358fb74 /gcc/cpphash.c | |
parent | ad215e603877fbc4248417d6ff2355b50a05b9d4 (diff) | |
download | gcc-963e5f16de1a3f9a79b4a5949626f83868e513a0.tar.gz |
1999-02-08 23:25 -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 (no longer used). 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r-- | gcc/cpphash.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c index 2ce8a3c1300..bb0b46d5d2f 100644 --- a/gcc/cpphash.c +++ b/gcc/cpphash.c @@ -131,8 +131,8 @@ delete_macro (hp) } /* Install a name in the main hash table, even if it is already there. - name stops with first non alphanumeric, except leading '#'. - caller must check against redefinition if that is desired. + Name stops with first non alphanumeric, except leading '#'. + Caller must check against redefinition if that is desired. delete_macro () removes things installed by install () in fifo order. this is important because of the `defined' special symbol used in #if, and also if pushdef/popdef directives are ever implemented. @@ -144,12 +144,11 @@ delete_macro (hp) Otherwise, compute the hash code. */ HASHNODE * -install (name, len, type, ivalue, value, hash) +install (name, len, type, value, hash) U_CHAR *name; int len; enum node_type type; - int ivalue; - char *value; + const char *value; int hash; { register HASHNODE *hp; @@ -177,10 +176,7 @@ install (name, len, type, ivalue, value, hash) hp->next->prev = hp; hp->type = type; hp->length = len; - if (hp->type == T_CONST) - hp->value.ival = ivalue; - else - hp->value.cpval = value; + hp->value.cpval = value; hp->name = ((U_CHAR *) hp) + sizeof (HASHNODE); bcopy (name, hp->name, len); hp->name[len] = 0; |