summaryrefslogtreecommitdiff
path: root/gcc/stringpool.c
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 15:58:35 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-21 15:58:35 +0000
commit82863d5e235b06f2fdbb514b5db470bd124814e8 (patch)
tree1dd385a111004f2f27510e3697c07240d8fb652f /gcc/stringpool.c
parentf70d66411c6de03f36070c1956ae3ef820efd74a (diff)
downloadgcc-82863d5e235b06f2fdbb514b5db470bd124814e8.tar.gz
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 ) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stringpool.c')
-rw-r--r--gcc/stringpool.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index 32bf7b5da35..c28156caaee 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. */