diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2000-05-01 18:20:10 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-05-01 18:20:10 +0000 |
commit | a7abcbbf92b21842d774a96fae56122c95544f44 (patch) | |
tree | f86e627be1bd97d95d7ce2354cf47e7860868588 /gcc/cppinit.c | |
parent | b7fe530c1e209f8f7588ce369bae21725346a662 (diff) | |
download | gcc-a7abcbbf92b21842d774a96fae56122c95544f44.zip gcc-a7abcbbf92b21842d774a96fae56122c95544f44.tar.gz gcc-a7abcbbf92b21842d774a96fae56122c95544f44.tar.bz2 |
cpphash.c (_cpp_make_hashnode): Rename make_HASHNODE, now static.
* cpphash.c (_cpp_make_hashnode): Rename make_HASHNODE, now
static. Allocate the hashnode and its string in the same
block of memory.
(del_HASHNODE): Don't free h->name.
(_cpp_lookup): If there is no entry for this string, create
one, of type T_VOID.
(_cpp_lookup_slot): Delete.
* cpphash.h: Update prototypes.
* cpplex.c (maybe_macroexpand): Check for hp->type == T_VOID,
not hp == NULL.
* cpplib.c (do_define, do_undef, do_pragma_poison, do_assert,
do_unassert, cpp_defined): Use _cpp_lookup. Don't create a
node here, just fill in the value field properly. "Delete"
entries by setting the value field to T_VOID. Check for
hp->type == T_VOID, not hp == NULL.
* Makefile.in (cpplib.o): Don't depend on $(HASHTAB_H).
* cpperror.c, cppexp.c, cpplex.c, cpplib.c: Don't include
hashtab.h.
From-SVN: r33581
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 957e611..944dd59 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -679,10 +679,9 @@ initialize_builtins (pfile) val = b->value; len = strlen (b->name); - hp = _cpp_make_hashnode (b->name, len, b->type, - _cpp_calc_hash (b->name, len)); + hp = _cpp_lookup (pfile, b->name, len); hp->value.cpval = val; - *(htab_find_slot (pfile->hashtab, (void *) hp, INSERT)) = hp; + hp->type = b->type; if ((b->flags & DUMP) && CPP_OPTION (pfile, debug_output)) dump_special_to_buffer (pfile, b->name); |