diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1998-11-12 06:26:08 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1998-11-12 06:26:08 -0800 |
commit | d640220cf872edb863ae66d41dc3b0ae6f68ea2f (patch) | |
tree | 884f8404cb7e6d56ccfe5e971b9e4cde9ea2065f /gcc/java/constants.c | |
parent | 733b3a87ca33556dec810133a1ccf57ead86b504 (diff) | |
download | gcc-d640220cf872edb863ae66d41dc3b0ae6f68ea2f.zip gcc-d640220cf872edb863ae66d41dc3b0ae6f68ea2f.tar.gz gcc-d640220cf872edb863ae66d41dc3b0ae6f68ea2f.tar.bz2 |
class.c: Remove some unused variables.
�
* class.c: Remove some unused variables.
* constants.c (find_string_constant): New function.
(count_constant_pool_bytes): Fix to correctly handle wide constants.
* decl.c (complete_start_java_method): Don't _Jv_InitClass
if flag_emit_class_files.
From-SVN: r23616
Diffstat (limited to 'gcc/java/constants.c')
-rw-r--r-- | gcc/java/constants.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/java/constants.c b/gcc/java/constants.c index 507d484..6d4ad2f 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -140,6 +140,18 @@ find_class_constant (cpool, type) build_internal_class_name (type)); } +/* Allocate a CONSTANT_string entry given a STRING_CST. */ + +int +find_string_constant (cpool, string) + CPool *cpool; + tree string; +{ + string = get_identifier (TREE_STRING_POINTER (string)); + return find_class_or_string_constant (cpool, CONSTANT_String, string); + +} + /* Find (or create) a CONSTANT_NameAndType matching NAME and TYPE. Return its index in the constant pool CPOOL. */ @@ -202,8 +214,7 @@ count_constant_pool_bytes (cpool) { int size = 2; int i = 1; - jword *datap = &cpool->data[1];; - for ( ; i < cpool->count; i++, datap++) + for ( ; i < cpool->count; i++) { size++; switch (cpool->tags[i]) @@ -222,15 +233,19 @@ count_constant_pool_bytes (cpool) break; case CONSTANT_Long: case CONSTANT_Double: - size += 4; + size += 8; + i++; break; case CONSTANT_Utf8: { - tree t = (tree) *datap; + tree t = (tree) cpool->data[i]; int len = IDENTIFIER_LENGTH (t); size += len + 2; } break; + default: + /* Second word of CONSTANT_Long and CONSTANT_Double. */ + size--; } } return size; |