diff options
author | Alexandre Petit-Bianco <apbianco@redhat.com> | 2001-09-21 08:58:35 -0700 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2001-09-21 08:58:35 -0700 |
commit | 4bad9e39d1985c1cc951d966104bfe33db631b03 (patch) | |
tree | 1dd385a111004f2f27510e3697c07240d8fb652f /gcc/stringpool.c | |
parent | f62ce55b12b8148b86f6f103179e9e9f3f1054dd (diff) | |
download | gcc-4bad9e39d1985c1cc951d966104bfe33db631b03.zip gcc-4bad9e39d1985c1cc951d966104bfe33db631b03.tar.gz gcc-4bad9e39d1985c1cc951d966104bfe33db631b03.tar.bz2 |
stringpool.c (get_identifier_with_length): New function.
2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
* stringpool.c (get_identifier_with_length): New function.
* tree.h (get_identifier_with_length): New prototype.
( http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00779.html )
From-SVN: r45731
Diffstat (limited to 'gcc/stringpool.c')
-rw-r--r-- | gcc/stringpool.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/stringpool.c b/gcc/stringpool.c index 32bf7b5..c28156c 100644 --- a/gcc/stringpool.c +++ b/gcc/stringpool.c @@ -109,6 +109,22 @@ get_identifier (text) return HT_IDENT_TO_GCC_IDENT (ht_node); } +/* Identical to get_identifier, except that the length is assumed + known. */ + +tree +get_identifier_with_length (text, length) + const char *text; + unsigned int length; +{ + hashnode ht_node = ht_lookup (ident_hash, + (const unsigned char *) text, + length, HT_ALLOC); + + /* ht_node can't be NULL here. */ + return HT_IDENT_TO_GCC_IDENT (ht_node); +} + /* If an identifier with the name TEXT (a null-terminated string) has previously been referred to, return that node; otherwise return NULL_TREE. */ |