diff options
-rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/java/jcf-write.c | 7 | ||||
-rw-r--r-- | gcc/java/parse.c | 4 | ||||
-rw-r--r-- | gcc/java/parse.y | 3 |
4 files changed, 17 insertions, 5 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 03fb4f3..42368c0 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,11 @@ +2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * jcf-write.c (generate_classfile): Properly install the + ConstantValue attribute and the initial value constant pool index + on string constants. + * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting + class files. + 2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index ecd14af..0d2a038 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -2874,8 +2874,11 @@ generate_classfile (clas, state) i = find_utf8_constant (&state->cpool, build_java_signature (TREE_TYPE (part))); PUT2(i); - have_value = DECL_INITIAL (part) != NULL_TREE && FIELD_STATIC (part) - && TREE_CODE (TREE_TYPE (part)) != POINTER_TYPE; + have_value = DECL_INITIAL (part) != NULL_TREE + && FIELD_STATIC (part) + && (TREE_CODE (DECL_INITIAL (part)) == STRING_CST + || TREE_CODE (DECL_INITIAL (part)) == INTEGER_CST + || TREE_CODE (DECL_INITIAL (part)) == REAL_CST); if (have_value) attr_count++; diff --git a/gcc/java/parse.c b/gcc/java/parse.c index 14c4375..5133edf 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -13802,7 +13802,6 @@ java_complete_lhs (node) case NEW_CLASS_EXPR: case CALL_EXPR: /* Complete function's argument(s) first */ - if (complete_function_arguments (node)) return error_mark_node; else @@ -13847,7 +13846,8 @@ java_complete_lhs (node) (type == string_ptr_type_node && ! flag_emit_class_files)) return empty_stmt_node; } - DECL_INITIAL (nn) = NULL_TREE; + if (! flag_emit_class_files) + DECL_INITIAL (nn) = NULL_TREE; } wfl_op2 = TREE_OPERAND (node, 1); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 312afd3..f062016 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -11148,7 +11148,8 @@ java_complete_lhs (node) (type == string_ptr_type_node && ! flag_emit_class_files)) return empty_stmt_node; } - DECL_INITIAL (nn) = NULL_TREE; + if (! flag_emit_class_files) + DECL_INITIAL (nn) = NULL_TREE; } wfl_op2 = TREE_OPERAND (node, 1); |