aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
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 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"