From: Nathan Sidwell Date: Fri, 9 Jul 2004 18:36:02 +0000 (+0000) Subject: class.c (make_class): Do not create binfo here. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85fd2947bd37c39eb2b8b237359743ae0ecbb657;p=gcc.git class.c (make_class): Do not create binfo here. * class.c (make_class): Do not create binfo here. (set_super_info): Create it here. * java-tree.h (CLASS_HAS_SUPER): Cope with lack of a binfo. From-SVN: r84388 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index b0bdd58aade..8c6a0b291cc 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2004-07-09 Nathan Sidwell + + * class.c (make_class): Do not create binfo here. + (set_super_info): Create it here. + * java-tree.h (CLASS_HAS_SUPER): Cope with lack of a binfo. + 2004-07-08 Richard Henderson * expr.c (case_identity, get_primitive_array_vtable, @@ -8207,7 +8213,7 @@ properly initialize `finished_label'. Don't emit gotos for empty try statements. -2000-03-19 Martin v. Löwis +2000-03-19 Martin v. Löwis * except.c (emit_handlers): Clear catch_clauses_last. diff --git a/gcc/java/class.c b/gcc/java/class.c index 5e7c2b9422b..c09e2e5b3b6 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -318,7 +318,6 @@ make_class (void) { tree type; type = make_node (RECORD_TYPE); - TYPE_BINFO (type) = make_tree_binfo (0); MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type); return type; @@ -473,9 +472,11 @@ set_super_info (int access_flags, tree this_class, { int total_supers = interfaces_count; tree class_decl = TYPE_NAME (this_class); + if (super_class) total_supers++; + TYPE_BINFO (this_class) = make_tree_binfo (0); TYPE_VFIELD (this_class) = TYPE_VFIELD (object_type_node); BINFO_BASE_BINFOS (TYPE_BINFO (this_class)) = make_tree_vec (total_supers); if (super_class) @@ -485,7 +486,7 @@ set_super_info (int access_flags, tree this_class, BINFO_OFFSET (super_binfo) = integer_zero_node; TREE_VEC_ELT (BINFO_BASE_BINFOS (TYPE_BINFO (this_class)), 0) = super_binfo; - CLASS_HAS_SUPER (this_class) = 1; + CLASS_HAS_SUPER_FLAG (TYPE_BINFO (this_class)) = 1; } set_class_decl_access_flags (access_flags, class_decl); diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 1920232c38c..1fef83260d0 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -122,7 +122,8 @@ struct JCF; /* True if the class whose TYPE_BINFO this is has a superclass. (True of all classes except Object.) */ #define CLASS_HAS_SUPER_FLAG(BINFO) BINFO_FLAG_1 (BINFO) -#define CLASS_HAS_SUPER(TYPE) CLASS_HAS_SUPER_FLAG (TYPE_BINFO (TYPE)) +#define CLASS_HAS_SUPER(TYPE) \ + (TYPE_BINFO (TYPE) && CLASS_HAS_SUPER_FLAG (TYPE_BINFO (TYPE))) /* Return the supertype of class TYPE, or NULL_TREE is it has none. */ #define CLASSTYPE_SUPER(TYPE) (CLASS_HAS_SUPER (TYPE) \