summaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 17:41:17 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 17:41:17 +0000
commita82984ec82161ff946c0e260660fbbcbdad83b28 (patch)
treef41491186a8687f01af5f4a1ce70623ea8fd50cb /gcc/java/decl.c
parente62f1d3ac988062027deeb5373bb4d504add34e8 (diff)
downloadgcc-a82984ec82161ff946c0e260660fbbcbdad83b28.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66768 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index a4b1c43fd60..b06cf88249b 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"