aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-04-18 20:42:00 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-04-18 16:42:00 -0400
commite38992e8d312b679eb3f4b9973567805a96511cb (patch)
tree83c55501d7538240d73d1cd61690beae93dbce4b /gcc
parent0d9eb3ba2922a07d68c27170de0195f5b96b4b0c (diff)
downloadgcc-e38992e8d312b679eb3f4b9973567805a96511cb.zip
gcc-e38992e8d312b679eb3f4b9973567805a96511cb.tar.gz
gcc-e38992e8d312b679eb3f4b9973567805a96511cb.tar.bz2
conflict.c (conflict_graph_add): Pass enum type to htab_find_slot.
* gcc/conflict.c (conflict_graph_add): Pass enum type to htab_find_slot. * gcc/cpperror.c (hashtab.h): Now include. * gcc/cppexp.c (hashtab.h): Likewise. * gcc/cpplex.c (hashtab.h): Likewise. * gcc/cppfiles.c (hashtab.h): Likewise. (find_include_file, _cpp_calc_hash, cpp_read_file): Pass enum type to htab_find_slot_with_hash. * gcc/cpphash.c (hashtab.h): Now include. (_cpp_lookup_slot): INSERT is now enum insert_option. * gcc/cpphash.h (_cpp_lookup_slot): Likewise. * gcc/cppinit.c (hashtab.h): Include earlier. (initialize_builtins): Pass enum to htab_find_slot. * gcc/cpplib.c (hashtab.h): Now include. (do_define, do_undef): Pass enum type to _cpp_lookup_slot. (do_pragma_poison, do_assert): Likewise. * gcc/emit-rtl.c (gen_rtx_CONST_INT): Pass enum to htab_find_slot_with_hash. * gcc/simplify-rtx.c (cselib_lookup_mem, cselib_lookup): Likewise. * gcc/tree.c (type_hash_add): Likewise. (build1): Minor cleanup. * include/hashtab.h (enum insert_option): New type. (htab_find_slot, htab_find_slot_with_hash): Use it. * libiberty/hashtab.c: Various minor cleanups. (htab_find_slot_with_hash): INSERT is now enum insert_option. (htab_find_slot): Likewise. From-SVN: r33236
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog55
-rw-r--r--gcc/cpperror.c1
-rw-r--r--gcc/cppexp.c10
-rw-r--r--gcc/cppfiles.c20
-rw-r--r--gcc/cpphash.c12
-rw-r--r--gcc/cpphash.h3
-rw-r--r--gcc/cppinit.c5
-rw-r--r--gcc/cpplex.c1
-rw-r--r--gcc/cpplib.c11
-rw-r--r--gcc/emit-rtl.c3
-rw-r--r--gcc/simplify-rtx.c7
11 files changed, 75 insertions, 53 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1515aa6..8f96af3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,41 @@
+Tue Apr 18 14:16:47 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * conflict.c (conflict_graph_add): Pass enum type to htab_find_slot.
+ * cpperror.c (hashtab.h): Now include.
+ * cppexp.c (hashtab.h): Likewise.
+ * cpplex.c (hashtab.h): Likewise.
+ * cppfiles.c (hashtab.h): Likewise.
+ (find_include_file, _cpp_calc_hash, cpp_read_file): Pass enum type
+ to htab_find_slot_with_hash.
+ * cpphash.c (hashtab.h): Now include.
+ (_cpp_lookup_slot): INSERT is now enum insert_option.
+ * cpphash.h (_cpp_lookup_slot): Likewise.
+ * cppinit.c (hashtab.h): Include earlier.
+ (initialize_builtins): Pass enum to htab_find_slot.
+ * cpplib.c (hashtab.h): Now include.
+ (do_define, do_undef): Pass enum type to _cpp_lookup_slot.
+ (do_pragma_poison, do_assert): Likewise.
+ * emit-rtl.c (gen_rtx_CONST_INT): Pass enum to
+ htab_find_slot_with_hash.
+ * simplify-rtx.c (cselib_lookup_mem, cselib_lookup): Likewise.
+ * tree.c (type_hash_add): Likewise.
+ (build1): Minor cleanup.
+
+ * ggc-common.c: Add missing blanks.
+ * print-tree.c (print_node): Print DECL_OFFSET_ALIGN.
+ * tree.h (DECL_OFFSET_ALIGN): Fix typo in comment.
+
+ * stmt.c (mark_case_node): New function.
+ (mark_case_nesting): Call it.
+
+ * expmed.c (emit_store_flag): If comparing two-word integer
+ with zero, can optimize NE, EQ, GE, and LT.
+
+ * c-decl.c (mark_binding_level): Use 'for' instead of `while'.
+ * conflict.c: Minor cleanups.
+ * optabs.c: Add blank line
+ * simplify-rtx.c: Minor cleanups.
+
2000-04-18 Stan Cox <scox@cygnus.com>
* gengenrtl.c (genlegend): Fix misspelling.
@@ -20,23 +58,6 @@
(OLD_CC): Likewise.
* config/m68k/x-ccur (X_CFLAGS): Likewise.
-Tue Apr 18 14:16:47 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * ggc-common.c: Add missing blanks.
- * print-tree.c (print_node): Print DECL_OFFSET_ALIGN.
- * tree.h (DECL_OFFSET_ALIGN): Fix typo in comment.
-
- * stmt.c (mark_case_node): New function.
- (mark_case_nesting): Call it.
-
- * expmed.c (emit_store_flag): If comparing two-word integer
- with zero, can optimize NE, EQ, GE, and LT.
-
- * c-decl.c (mark_binding_level): Use 'for' instead of `while'.
- * conflict.c: Minor cleanups.
- * optabs.c: Add blank line
- * simplify-rtx.c: Minor cleanups.
-
2000-04-18 Mark Mitchell <mark@codesourcery.com>
* cpplex.c (_cpp_lex_token): Don't call CPP_BUMP_LINE when the
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 0e8afc4..e798b78 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -25,6 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
+#include "hashtab.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 237b8e6..91ffc5d 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -1,5 +1,6 @@
/* Parse C expressions for cpplib.
Copyright (C) 1987, 92, 94, 95, 97, 98, 1999, 2000 Free Software Foundation.
+ Contributed by Per Bothner, 1994.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -14,19 +15,14 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
-
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding!
-
-Written by Per Bothner 1994. */
+Boston, MA 02111-1307, USA. */
/* Parse a C expression from text in a string */
#include "config.h"
#include "system.h"
#include "cpplib.h"
+#include "hashtab.h"
#include "cpphash.h"
#ifndef CHAR_TYPE_SIZE
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index cc891d4..f7cdd31 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -18,17 +18,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding! */
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "hashtab.h"
#include "cpplib.h"
#include "cpphash.h"
-#include "hashtab.h"
#include "intl.h"
#include "mkdeps.h"
@@ -263,8 +259,8 @@ find_include_file (pfile, fname, search_start, ihash, before)
dummy.hash = _cpp_calc_hash (fname, strlen (fname));
path = (fname[0] == '/') ? ABSOLUTE_PATH : search_start;
slot = (IHASH **) htab_find_slot_with_hash (pfile->all_include_files,
- (const void *)&dummy,
- dummy.hash, 1);
+ (const void *) &dummy,
+ dummy.hash, INSERT);
if (*slot && (ih = redundant_include_p (pfile, *slot, path)))
{
@@ -333,8 +329,8 @@ _cpp_fake_ihash (pfile, fname)
dummy.nshort = fname;
dummy.hash = _cpp_calc_hash (fname, strlen (fname));
slot = (IHASH **) htab_find_slot_with_hash (pfile->all_include_files,
- (const void *)&dummy,
- dummy.hash, 1);
+ (const void *) &dummy,
+ dummy.hash, INSERT);
if (*slot)
return (*slot)->name;
ih = make_IHASH (fname, 0, ABSOLUTE_PATH, dummy.hash, slot);
@@ -670,10 +666,10 @@ cpp_read_file (pfile, fname)
dummy.hash = _cpp_calc_hash (fname, strlen (fname));
slot = (IHASH **) htab_find_slot_with_hash (pfile->all_include_files,
(const void *) &dummy,
- dummy.hash, 1);
+ dummy.hash, INSERT);
if (*slot && (ih = redundant_include_p (pfile, *slot, ABSOLUTE_PATH)))
{
- if (ih == (IHASH *)-1)
+ if (ih == (IHASH *) -1)
return 1; /* Already included. */
}
else
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index bb13dda..6f28295 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -26,8 +26,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
#include "cpplib.h"
-#include "cpphash.h"
#include "hashtab.h"
+#include "cpphash.h"
+
#undef abort
static unsigned int hash_HASHNODE PARAMS ((const void *));
@@ -200,12 +201,13 @@ _cpp_lookup (pfile, name, len)
}
/* Find the hashtable slot for name "name". Used to insert or delete. */
+
HASHNODE **
_cpp_lookup_slot (pfile, name, len, insert, hash)
cpp_reader *pfile;
const U_CHAR *name;
int len;
- int insert;
+ enum insert_option insert;
unsigned long *hash;
{
const U_CHAR *bp;
@@ -214,7 +216,9 @@ _cpp_lookup_slot (pfile, name, len, insert, hash)
if (len < 0)
{
- for (bp = name; is_idchar (*bp); bp++);
+ for (bp = name; is_idchar (*bp); bp++)
+ ;
+
len = bp - name;
}
@@ -223,7 +227,7 @@ _cpp_lookup_slot (pfile, name, len, insert, hash)
dummy.hash = _cpp_calc_hash (name, len);
slot = (HASHNODE **) htab_find_slot_with_hash (pfile->hashtab,
- (void *)&dummy,
+ (void *) &dummy,
dummy.hash, insert);
if (insert)
*hash = dummy.hash;
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 90fff64..9779fad 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -274,7 +274,8 @@ extern unsigned int _cpp_calc_hash PARAMS ((const U_CHAR *, size_t));
extern HASHNODE *_cpp_lookup PARAMS ((cpp_reader *,
const U_CHAR *, int));
extern HASHNODE **_cpp_lookup_slot PARAMS ((cpp_reader *,
- const U_CHAR *, int, int,
+ const U_CHAR *, int,
+ enum insert_option,
unsigned long *));
extern void _cpp_free_definition PARAMS ((DEFINITION *));
extern DEFINITION *_cpp_create_definition PARAMS ((cpp_reader *, int));
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 7d20b2c..6feb060 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -21,14 +21,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-
+#include "hashtab.h"
#include "cpplib.h"
#include "cpphash.h"
#include "output.h"
#include "prefix.h"
#include "intl.h"
#include "version.h"
-#include "hashtab.h"
#include "mkdeps.h"
/* Predefined symbols, built-in macros, and the default include path. */
@@ -683,7 +682,7 @@ initialize_builtins (pfile)
hp = _cpp_make_hashnode (b->name, len, b->type,
_cpp_calc_hash (b->name, len));
hp->value.cpval = val;
- *(htab_find_slot (pfile->hashtab, (void *)hp, 1)) = hp;
+ *(htab_find_slot (pfile->hashtab, (void *) hp, INSERT)) = hp;
if ((b->flags & DUMP) && CPP_OPTION (pfile, debug_output))
dump_special_to_buffer (pfile, b->name);
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 06bee99..9d0a792 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -22,6 +22,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "intl.h"
+#include "hashtab.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 44cc189..87f245c 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -22,6 +22,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "hashtab.h"
#include "cpplib.h"
#include "cpphash.h"
#include "hashtab.h"
@@ -392,7 +393,7 @@ do_define (pfile)
goto out;
}
- slot = _cpp_lookup_slot (pfile, sym, len, 1, &hash);
+ slot = _cpp_lookup_slot (pfile, sym, len, INSERT, &hash);
if (*slot)
{
int ok;
@@ -770,7 +771,7 @@ do_undef (pfile)
name = pfile->token_buffer + here;
CPP_SET_WRITTEN (pfile, here);
- slot = _cpp_lookup_slot (pfile, name, len, 0, 0);
+ slot = _cpp_lookup_slot (pfile, name, len, NO_INSERT, 0);
if (slot)
{
HASHNODE *hp = *slot;
@@ -1028,7 +1029,7 @@ do_pragma_poison (pfile)
p = pfile->token_buffer + written;
len = strlen (p);
- slot = _cpp_lookup_slot (pfile, p, len, 1, &hash);
+ slot = _cpp_lookup_slot (pfile, p, len, INSERT, &hash);
if (*slot)
{
HASHNODE *hp = *slot;
@@ -1586,14 +1587,14 @@ do_assert (pfile)
sym = pfile->token_buffer + old_written;
blen = (U_CHAR *) strchr (sym, '(') - sym;
- tslot = _cpp_lookup_slot (pfile, sym, tlen, 1, &thash);
+ tslot = _cpp_lookup_slot (pfile, sym, tlen, INSERT, &thash);
if (*tslot)
{
cpp_warning (pfile, "%s re-asserted", sym);
goto error;
}
- bslot = _cpp_lookup_slot (pfile, sym, blen, 1, &bhash);
+ bslot = _cpp_lookup_slot (pfile, sym, blen, INSERT, &bhash);
if (! *bslot)
{
*bslot = base = _cpp_make_hashnode (sym, blen, T_ASSERT, bhash);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 98009ec..9044fb5 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -248,7 +248,8 @@ gen_rtx_CONST_INT (mode, arg)
#endif
/* Look up the CONST_INT in the hash table. */
- slot = htab_find_slot_with_hash (const_int_htab, &arg, (hashval_t) arg, 1);
+ slot = htab_find_slot_with_hash (const_int_htab, &arg,
+ (hashval_t) arg, INSERT);
if (*slot == 0)
{
if (!ggc_p)
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ffe7b24..a959557 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2662,7 +2662,7 @@ cselib_lookup_mem (x, create)
mem_elt = new_cselib_val (++next_unknown_value, GET_MODE (x));
add_mem_for_addr (addr, mem_elt, x);
- slot = htab_find_slot_with_hash (hash_table, x, mem_elt->value, 1);
+ slot = htab_find_slot_with_hash (hash_table, x, mem_elt->value, INSERT);
*slot = mem_elt;
return mem_elt;
}
@@ -2782,7 +2782,7 @@ cselib_lookup (x, mode, create)
e = new_cselib_val (++next_unknown_value, GET_MODE (x));
e->locs = new_elt_loc_list (e->locs, x);
REG_VALUES (i) = new_elt_list (REG_VALUES (i), e);
- slot = htab_find_slot_with_hash (hash_table, x, e->value, 1);
+ slot = htab_find_slot_with_hash (hash_table, x, e->value, INSERT);
*slot = e;
return e;
}
@@ -2795,7 +2795,8 @@ cselib_lookup (x, mode, create)
if (! hashval)
return 0;
- slot = htab_find_slot_with_hash (hash_table, x, hashval, create);
+ slot = htab_find_slot_with_hash (hash_table, x, hashval,
+ create ? INSERT : NO_INSERT);
if (slot == 0)
return 0;