diff options
author | Richard Henderson <rth@redhat.com> | 2003-05-13 10:41:17 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-05-13 10:41:17 -0700 |
commit | 3bec3c0c9cadc98f39f7072cb77a1c1b90ada59b (patch) | |
tree | f41491186a8687f01af5f4a1ce70623ea8fd50cb /gcc/java/decl.c | |
parent | a65cddcf3959175275b11b9caedbe71a5d25ebe5 (diff) | |
download | gcc-3bec3c0c9cadc98f39f7072cb77a1c1b90ada59b.zip gcc-3bec3c0c9cadc98f39f7072cb77a1c1b90ada59b.tar.gz gcc-3bec3c0c9cadc98f39f7072cb77a1c1b90ada59b.tar.bz2 |
class.c (layout_class_method): Set DECL_EXTERNAL.
* class.c (layout_class_method): Set DECL_EXTERNAL.
* decl.c (java_mark_decl_local, java_mark_class_local): New.
* java-tree.h (java_mark_class_local): Declare.
* jcf-parse.c (parse_class_file): Use it.
* parse.y (java_expand_classes): Likewise.
From-SVN: r66768
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r-- | gcc/java/decl.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index a4b1c43..b06cf88 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1845,4 +1845,33 @@ void java_optimize_inline (tree fndecl) } } +/* We pessimistically marked all methods and fields external until we + knew what set of classes we were planning to compile. Now mark those + associated with CLASS to be generated locally as not external. */ + +static void +java_mark_decl_local (tree decl) +{ + DECL_EXTERNAL (decl) = 0; + + /* If we've already constructed DECL_RTL, give encode_section_info + a second chance, now that we've changed the flags. */ + if (DECL_RTL_SET_P (decl)) + make_decl_rtl (decl, NULL); +} + +void +java_mark_class_local (tree class) +{ + tree t; + + for (t = TYPE_FIELDS (class); t ; t = TREE_CHAIN (t)) + if (FIELD_STATIC (t)) + java_mark_decl_local (t); + + for (t = TYPE_METHODS (class); t ; t = TREE_CHAIN (t)) + if (!METHOD_ABSTRACT (t) && (!METHOD_NATIVE (t) || flag_jni)) + java_mark_decl_local (t); +} + #include "gt-java-decl.h" |