From 7bb3fbbb4dd015ad83f96871e15124f896761284 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Fri, 8 Aug 2003 20:23:06 +0000 Subject: * tree.h (get_identifier) Define a macro form of get_identifier that calls get_identifier_with_length when the string is constant. (get_identifier_with_length): Change type of second argument to size_t in prototype. * stringpool.c (get_identifier): Undefine the macro before giving the function definition. (get_identifier_with_length): Change type of second argument to size_t in function definition. * hashtable.c (calc_hash): Change type of second argument to size_t. (ht_lookup): Change type of third argument to size_t. Reorganize to speed-up the cases where the hash table slot is empty, or the first probe matches (i.e. there isn't a collision). * hashtable.h (ht_lookup): Adjust function prototype. From-SVN: r70256 --- gcc/tree.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index cac3efc..69e75e1 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2050,10 +2050,18 @@ extern tree make_tree_vec (int); extern tree get_identifier (const char *); +#if GCC_VERSION >= 3000 +#define get_identifier(str) \ + (__builtin_constant_p (str) \ + ? get_identifier_with_length ((str), strlen (str)) \ + : get_identifier (str)) +#endif + + /* Identical to get_identifier, except that the length is assumed known. */ -extern tree get_identifier_with_length (const char *, unsigned int); +extern tree get_identifier_with_length (const char *, size_t); /* If an identifier with the name TEXT (a null-terminated string) has previously been referred to, return that node; otherwise return -- cgit v1.1