class.c (build_utf8_ref): Don't generate identifier based on utf8const contents.
authorTom Tromey <tromey@redhat.com>
Tue, 15 May 2001 18:20:57 +0000 (18:20 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Tue, 15 May 2001 18:20:57 +0000 (18:20 +0000)
* class.c (build_utf8_ref): Don't generate identifier based on
utf8const contents.

From-SVN: r42110

gcc/java/ChangeLog
gcc/java/class.c

index 1c8e207595f8b2d36c6f0f9afb3818ca37d5a3b3..686bf0a8e3803b80e305f4a752c936397d65620f 100644 (file)
@@ -1,3 +1,8 @@
+2001-05-15  Tom Tromey  <tromey@redhat.com>
+
+       * class.c (build_utf8_ref): Don't generate identifier based on
+       utf8const contents.
+
 2001-05-12  Richard Henderson  <rth@redhat.com>
 
        * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
index 741881ff774e818000566c6865f3133ad007af2a..40c8a83a03c97cedda51b448eb02f1b0187b1b21 100644 (file)
@@ -807,7 +807,6 @@ build_utf8_ref (name)
   const char * name_ptr = IDENTIFIER_POINTER(name);
   int name_len = IDENTIFIER_LENGTH(name);
   char buf[60];
-  char *buf_ptr;
   tree ctype, field = NULL_TREE, str_type, cinit, string;
   static int utf8_count = 0;
   int name_hash;
@@ -833,23 +832,8 @@ build_utf8_ref (name)
   FINISH_RECORD_CONSTRUCTOR (cinit);
   TREE_CONSTANT (cinit) = 1;
 
-  /* Build a unique identifier based on buf. */
+  /* Generate a unique-enough identifier.  */
   sprintf(buf, "_Utf%d", ++utf8_count);
-  buf_ptr = &buf[strlen (buf)];
-  if (name_len > 0 && name_ptr[0] >= '0' && name_ptr[0] <= '9')
-    *buf_ptr++ = '_';
-  while (--name_len >= 0)
-    {
-      unsigned char c = *name_ptr++;
-      if (c & 0x80)
-       continue;
-      if (!ISALPHA(c) && !ISDIGIT(c))
-       c = '_';
-      *buf_ptr++ = c;
-      if (buf_ptr >= buf + 50)
-       break;
-    }
-  *buf_ptr = '\0';
 
   decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_type);
   /* FIXME get some way to force this into .text, not .data. */