OSDN Git Service

Support procedures for testing profile-directed optimizations.
[pf3gnuchains/gcc-fork.git] / gcc / stringpool.c
index 0828bc0..32bf7b5 100644 (file)
@@ -1,20 +1,20 @@
 /* String pool for GCC.
    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
 
-GNU CC is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to the Free
+along with GCC; see the file COPYING.  If not, write to the Free
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
@@ -32,11 +32,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "ggc.h"
 #include "tree.h"
 #include "hashtable.h"
-#include "flags.h"
 #include "toplev.h"
 
-#define IS_FE_IDENT(NODE) (TREE_CODE (NODE) == IDENTIFIER_NODE)
-
 /* The "" allocated string.  */
 const char empty_string[] = "";
 
@@ -49,13 +46,10 @@ const char digit_vector[] = {
 
 struct ht *ident_hash;
 static struct obstack string_stack;
-static int do_identifier_warnings;
 
 static hashnode alloc_node PARAMS ((hash_table *));
 static int mark_ident PARAMS ((struct cpp_reader *, hashnode, const PTR));
 static void mark_ident_hash PARAMS ((void *));
-static int scan_for_clashes PARAMS ((struct cpp_reader *, hashnode,
-                                    const char *));
 
 /* Initialize the string pool.  */
 void
@@ -99,23 +93,6 @@ ggc_alloc_string (contents, length)
   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).
    If an identifier with that name has previously been referred to,
    the same node is returned this time.  */
@@ -141,44 +118,15 @@ maybe_get_identifier (text)
      const char *text;
 {
   hashnode ht_node;
-  tree node;
-  size_t length = strlen (text);
 
   ht_node = ht_lookup (ident_hash, (const unsigned char *) text,
-                      length, HT_NO_INSERT);
+                      strlen (text), HT_NO_INSERT);
   if (ht_node)
-    {
-      node = HT_IDENT_TO_GCC_IDENT (ht_node);
-      if (IS_FE_IDENT (node))
-       return node;
-    }
+    return HT_IDENT_TO_GCC_IDENT (ht_node);
 
   return NULL_TREE;
 }
 
-/* If this identifier is longer than the clash-warning length,
-   do a brute force search of the entire table for clashes.  */
-
-static int
-scan_for_clashes (pfile, h, text)
-     struct cpp_reader *pfile ATTRIBUTE_UNUSED;
-     hashnode h;
-     const char *text;
-{
-  tree node = HT_IDENT_TO_GCC_IDENT (h);
-
-  if (IS_FE_IDENT (node)
-      && IDENTIFIER_LENGTH (node) >= id_clash_len
-      && !memcmp (IDENTIFIER_POINTER (node), text, id_clash_len))
-    {
-      warning ("\"%s\" and \"%s\" identical in first %d characters",
-              text, IDENTIFIER_POINTER (node), id_clash_len);
-      return 0;
-    }
-
-  return 1;
-}
-
 /* Record the size of an identifier node for the language in use.
    SIZE is the total size in bytes.
    This is called by the language-specific files.  This must be
@@ -192,15 +140,6 @@ set_identifier_size (size)
     = (size - sizeof (struct tree_common)) / sizeof (tree);
 }
 
-/* Enable warnings on similar identifiers (if requested).
-   Done after the built-in identifiers are created.  */
-
-void
-start_identifier_warnings ()
-{
-  do_identifier_warnings = 1;
-}
-
 /* Report some basic statistics about the string pool.  */
 
 void