aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-04-04 13:56:01 -0700
committerPer Bothner <bothner@gcc.gnu.org>2001-04-04 13:56:01 -0700
commit3cc48399b878e39e334670e417741d6b3531185a (patch)
tree5a388d102608c5d677efdc447fcc9f752c7506e8 /gcc/java/jcf-write.c
parent8e184d9cc12b898bba2aebea0e0e8d5faac9e569 (diff)
downloadgcc-3cc48399b878e39e334670e417741d6b3531185a.zip
gcc-3cc48399b878e39e334670e417741d6b3531185a.tar.gz
gcc-3cc48399b878e39e334670e417741d6b3531185a.tar.bz2
java-tree.h (CONSTANT_VALUE_P): New macro.
* java-tree.h (CONSTANT_VALUE_P): New macro. * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P. * parse.y (maybe_build_class_init_for_field): New static function. (resolve_expression_name, resolve_field_access): Use maybe_build_class_init_for_field instead of build_class_init This does not do the init if the field is compile-time-constant. (resolve_field_access): Simplify. * parse.y (fold_constant_for_init): Merge test into switch. From-SVN: r41094
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 79ac691..3e000da 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2885,11 +2885,7 @@ generate_classfile (clas, state)
build_java_signature (TREE_TYPE (part)));
PUT2(i);
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 (TREE_TYPE (DECL_INITIAL (part))) != POINTER_TYPE)
- || TREE_CODE (DECL_INITIAL (part)) == REAL_CST);
+ && FIELD_STATIC (part) && CONSTANT_VALUE_P (DECL_INITIAL (part));
if (have_value)
attr_count++;