diff options
author | Tom Tromey <tromey@redhat.com> | 2001-05-15 18:20:57 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-05-15 18:20:57 +0000 |
commit | 48187504f8edc2a0db6317e77c180e6f0a57d882 (patch) | |
tree | b78e53dd04a45c4076c378c47b01b59fa720c050 | |
parent | 6f9b26b05c24e9222399ef241afe58abf7106555 (diff) | |
download | gcc-48187504f8edc2a0db6317e77c180e6f0a57d882.zip gcc-48187504f8edc2a0db6317e77c180e6f0a57d882.tar.gz gcc-48187504f8edc2a0db6317e77c180e6f0a57d882.tar.bz2 |
class.c (build_utf8_ref): Don't generate identifier based on utf8const contents.
* class.c (build_utf8_ref): Don't generate identifier based on
utf8const contents.
From-SVN: r42110
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/class.c | 18 |
2 files changed, 6 insertions, 17 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 1c8e2075..686bf0a 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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. diff --git a/gcc/java/class.c b/gcc/java/class.c index 741881f..40c8a83 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -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. */ |