aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-01-21 18:54:25 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-01-21 18:54:25 +0000
commit5c64ead4ae1889d5ff5d5fcc7bff4afdfaedf7a2 (patch)
tree9766241670e17d3cecba272f6528b5390929f045
parent9179646e87d54f448b89d4f0881edf5eb4a1e791 (diff)
downloadgcc-5c64ead4ae1889d5ff5d5fcc7bff4afdfaedf7a2.zip
gcc-5c64ead4ae1889d5ff5d5fcc7bff4afdfaedf7a2.tar.gz
gcc-5c64ead4ae1889d5ff5d5fcc7bff4afdfaedf7a2.tar.bz2
class.c (supers_all_compiled): New function.
* class.c (supers_all_compiled): New function. (make_class_data): Use it. From-SVN: r61561
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/class.c25
2 files changed, 23 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index c5b1b6e..346dd6b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,10 @@
2003-01-21 Tom Tromey <tromey@redhat.com>
+ * class.c (supers_all_compiled): New function.
+ (make_class_data): Use it.
+
+2003-01-21 Tom Tromey <tromey@redhat.com>
+
* parse.y (method_header): Native method can't be strictfp.
No method can be transient or volatile.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 6d49497..1e0e83a 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -54,6 +54,7 @@ static int32 hashUtf8String (const char *, int);
static tree make_field_value (tree);
static tree get_dispatch_vector (tree);
static tree get_dispatch_table (tree, tree);
+static int supers_all_compiled (tree type);
static void add_interface_do (tree, tree, int);
static tree maybe_layout_super_class (tree, tree);
static int assume_compiled (const char *);
@@ -1265,7 +1266,8 @@ static tree
get_dispatch_vector (tree type)
{
tree vtable = TYPE_VTABLE (type);
- if (vtable == NULL)
+
+ if (vtable == NULL_TREE)
{
HOST_WIDE_INT i;
tree method;
@@ -1367,6 +1369,18 @@ get_dispatch_table (tree type, tree this_class_addr)
NULL_TREE, list);
}
+static int
+supers_all_compiled (tree type)
+{
+ while (type != NULL_TREE)
+ {
+ if (!assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))))
+ return 0;
+ type = CLASSTYPE_SUPER (type);
+ }
+ return 1;
+}
+
void
make_class_data (tree type)
{
@@ -1468,8 +1482,8 @@ make_class_data (tree type)
DECL_IGNORED_P (methods_decl) = 1;
rest_of_decl_compilation (methods_decl, (char*) 0, 1, 0);
- if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl)))
- && ! CLASS_INTERFACE (type_decl) && !flag_indirect_dispatch)
+ if (supers_all_compiled (type) && ! CLASS_INTERFACE (type_decl)
+ && !flag_indirect_dispatch)
{
tree dtable = get_dispatch_table (type, this_class_addr);
dtable_decl = build_dtable_decl (type);
@@ -1956,9 +1970,6 @@ layout_class_methods (tree this_class)
TYPE_NVIRTUALS (this_class) = dtable_count;
}
-/* Return 0 if NAME is equal to STR, -1 if STR is "less" than NAME,
- and 1 if STR is "greater" than NAME. */
-
/* Lay METHOD_DECL out, returning a possibly new value of
DTABLE_COUNT. Also mangle the method's name. */
@@ -1995,7 +2006,7 @@ layout_class_method (tree this_class, tree super_class,
}
else if (! METHOD_STATIC (method_decl) && !DECL_ARTIFICIAL (method_decl))
{
- tree method_sig =
+ tree method_sig =
build_java_argument_signature (TREE_TYPE (method_decl));
tree super_method = lookup_argument_method (super_class, method_name,
method_sig);