diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1999-04-26 19:09:37 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1999-04-26 12:09:37 -0700 |
commit | 7f1d48663e8aa1d749c88ffd17365bf2aa80f21a (patch) | |
tree | 38ae2203c1adb1c12229db14df3792c799011465 /gcc/java/class.c | |
parent | ccd63d90d14a15e87224d8fba54870ab78167a25 (diff) | |
download | gcc-7f1d48663e8aa1d749c88ffd17365bf2aa80f21a.zip gcc-7f1d48663e8aa1d749c88ffd17365bf2aa80f21a.tar.gz gcc-7f1d48663e8aa1d749c88ffd17365bf2aa80f21a.tar.bz2 |
class.c (layout_class_method): Generate <clinit>'s rtl for interfaces.
Sat Apr 24 16:50:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (layout_class_method): Generate <clinit>'s rtl for
interfaces.
* decl.c (complete_start_java_method): Don't call _Jv_InitClass
for interfaces' <clinit>.
* expr.c (lookup_field): Search for fields in interfaces.
(expand_invoke): Fixed indentation.
(expand_java_field_op): Likewise. Use IS_CLINIT.
* parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
(IS_CLINIT): New macro.
* parse.y (type_declaration:): Call maybe_generate_clinit after an
interface was parsed.
(maybe_generate_clinit): Don't generate if the current class is an
interface with only fields of primitive types.
(reset_method_name): Use IS_CLINIT.
(java_complete_expand_method): Expand <clinit> when it exists for
interfaces. Use IS_CLINIT.
(resolve_expression_name): Use DECL_CONTEXT instead of
current_class to build static field references.
(java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
ARRAY_REF when doing xreferencing.
(check_final_assignment): Fixed typo in leading comment. Use
IS_CLINIT.
(patch_array_ref): Don't fully expand array references when
xreferencing.
(patch_return): Use IS_CLINIT.
(patch_throw_statement): Likewise.
From-SVN: r26661
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index f785d0f..6cb3dfc 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -1623,11 +1623,14 @@ layout_class_method (this_class, super_class, method_decl, dtable_count) obstack_1grow (&temporary_obstack, '\0'); asm_name = obstack_finish (&temporary_obstack); DECL_ASSEMBLER_NAME (method_decl) = get_identifier (asm_name); + /* We don't generate a RTL for the method if it's abstract, or if + it's an interface method that isn't clinit. */ if (! METHOD_ABSTRACT (method_decl) - && ! CLASS_INTERFACE (TYPE_NAME (this_class))) + || (CLASS_INTERFACE (TYPE_NAME (this_class)) + && (IS_CLINIT (method_decl)))) make_function_rtl (method_decl); obstack_free (&temporary_obstack, asm_name); - + if (method_name == init_identifier_node) { char *p = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (this_class))); |