Commit 083e9f92 by Neil Booth Committed by Neil Booth

c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one.

	* c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one.
	* stringpool.c:	(IS_FE_IDENT, make_identifier): Delete.
	(maybe_get_identifier): Update.
	* tree.h (make_identifier): Delete.

From-SVN: r42432
parent bada7cda
2001-05-22 Neil Booth <neil@daikokuya.demon.co.uk>
* c-lex.c (c_lex): Just cast cpp's hashnode to gcc's one.
* stringpool.c: (IS_FE_IDENT, make_identifier): Delete.
(maybe_get_identifier): Update.
* tree.h (make_identifier): Delete.
2001-05-21 Richard Henderson <rth@redhat.com> 2001-05-21 Richard Henderson <rth@redhat.com>
* combine.c (subst): Do not substitute for a register as * combine.c (subst): Do not substitute for a register as
......
...@@ -997,12 +997,7 @@ c_lex (value) ...@@ -997,12 +997,7 @@ c_lex (value)
goto retry; goto retry;
case CPP_NAME: case CPP_NAME:
{ *value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok.val.node));
tree node = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok.val.node));
if (TREE_CODE (node) != IDENTIFIER_NODE)
make_identifier (node);
*value = node;
}
break; break;
case CPP_INT: case CPP_INT:
......
...@@ -35,8 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -35,8 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "flags.h" #include "flags.h"
#include "toplev.h" #include "toplev.h"
#define IS_FE_IDENT(NODE) (TREE_CODE (NODE) == IDENTIFIER_NODE)
/* The "" allocated string. */ /* The "" allocated string. */
const char empty_string[] = ""; const char empty_string[] = "";
...@@ -99,23 +97,6 @@ ggc_alloc_string (contents, length) ...@@ -99,23 +97,6 @@ ggc_alloc_string (contents, length)
return obstack_finish (&string_stack); return obstack_finish (&string_stack);
} }
/* NODE is an identifier known to the preprocessor. Make it known to
the front ends as well. */
void
make_identifier (node)
tree node;
{
/* If this identifier is longer than the clash-warning length,
do a brute force search of the entire table for clashes. */
if (warn_id_clash && do_identifier_warnings
&& IDENTIFIER_LENGTH (node) >= id_clash_len)
ht_forall (ident_hash, (ht_cb) scan_for_clashes,
IDENTIFIER_POINTER (node));
TREE_SET_CODE (node, IDENTIFIER_NODE);
}
/* Return an IDENTIFIER_NODE whose name is TEXT (a null-terminated string). /* Return an IDENTIFIER_NODE whose name is TEXT (a null-terminated string).
If an identifier with that name has previously been referred to, If an identifier with that name has previously been referred to,
the same node is returned this time. */ the same node is returned this time. */
...@@ -141,17 +122,11 @@ maybe_get_identifier (text) ...@@ -141,17 +122,11 @@ maybe_get_identifier (text)
const char *text; const char *text;
{ {
hashnode ht_node; hashnode ht_node;
tree node;
size_t length = strlen (text);
ht_node = ht_lookup (ident_hash, (const unsigned char *) text, ht_node = ht_lookup (ident_hash, (const unsigned char *) text,
length, HT_NO_INSERT); strlen (text), HT_NO_INSERT);
if (ht_node) if (ht_node)
{ return HT_IDENT_TO_GCC_IDENT (ht_node);
node = HT_IDENT_TO_GCC_IDENT (ht_node);
if (IS_FE_IDENT (node))
return node;
}
return NULL_TREE; return NULL_TREE;
} }
...@@ -167,8 +142,7 @@ scan_for_clashes (pfile, h, text) ...@@ -167,8 +142,7 @@ scan_for_clashes (pfile, h, text)
{ {
tree node = HT_IDENT_TO_GCC_IDENT (h); tree node = HT_IDENT_TO_GCC_IDENT (h);
if (IS_FE_IDENT (node) if (IDENTIFIER_LENGTH (node) >= id_clash_len
&& IDENTIFIER_LENGTH (node) >= id_clash_len
&& !memcmp (IDENTIFIER_POINTER (node), text, id_clash_len)) && !memcmp (IDENTIFIER_POINTER (node), text, id_clash_len))
{ {
warning ("\"%s\" and \"%s\" identical in first %d characters", warning ("\"%s\" and \"%s\" identical in first %d characters",
......
...@@ -1958,10 +1958,6 @@ extern tree make_tree_vec PARAMS ((int)); ...@@ -1958,10 +1958,6 @@ extern tree make_tree_vec PARAMS ((int));
extern tree get_identifier PARAMS ((const char *)); extern tree get_identifier PARAMS ((const char *));
/* NODE is an identifier known to the preprocessor. Make it known to
the front ends as well. */
extern void make_identifier PARAMS ((tree node));
/* If an identifier with the name TEXT (a null-terminated string) has /* If an identifier with the name TEXT (a null-terminated string) has
previously been referred to, return that node; otherwise return previously been referred to, return that node; otherwise return
NULL_TREE. */ NULL_TREE. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment