aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2002-02-02 22:23:37 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-02-02 22:23:37 -0800
commitf0c75752a10218b95f31583594dac574626b3062 (patch)
treed3081a1b3cb01da65223cdcd03a5fd55ecdecda2 /gcc/java/parse.y
parentd74697b84d79ac7f863e9a65b445ac2e72b59090 (diff)
downloadgcc-f0c75752a10218b95f31583594dac574626b3062.zip
gcc-f0c75752a10218b95f31583594dac574626b3062.tar.gz
gcc-f0c75752a10218b95f31583594dac574626b3062.tar.bz2
class.c (add_field): Mark static fields external.
* class.c (add_field): Mark static fields external. (build_class_ref): Remove redundant set. * parse.y (java_expand_classes): Mark static fields of classes to be compiled as local. * jcf-parse.c (parse_class_file): Likewise. From-SVN: r49458
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y25
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 8b33fad..328a18e 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -8963,8 +8963,7 @@ java_expand_classes ()
java_layout_classes ();
java_parse_abort_on_error ();
- cur_ctxp = ctxp_for_generation;
- for (; cur_ctxp; cur_ctxp = cur_ctxp->next)
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
ctxp = cur_ctxp;
input_filename = ctxp->filename;
@@ -8976,7 +8975,7 @@ java_expand_classes ()
/* Find anonymous classes and expand their constructor, now they
have been fixed. */
- for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
tree current;
ctxp = cur_ctxp;
@@ -9009,7 +9008,25 @@ java_expand_classes ()
return;
/* Now things are stable, go for generation of the class data. */
- for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
+
+ /* We pessimistically marked all fields external until we knew
+ what set of classes we were planning to compile. Now mark
+ those that will be generated locally as not external. */
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
+ {
+ tree current;
+ for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
+ {
+ tree class = TREE_TYPE (current);
+ tree field;
+ for (field = TYPE_FIELDS (class); field ; field = TREE_CHAIN (field))
+ if (FIELD_STATIC (field))
+ DECL_EXTERNAL (field) = 0;
+ }
+ }
+
+ /* Compile the classes. */
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
tree current;
ctxp = cur_ctxp;