Commit e0f391dd by Richard Henderson Committed by Richard Henderson

builtins.c (define_builtin): Don't call make_decl_rtl.

        * builtins.c (define_builtin): Don't call make_decl_rtl.
        * constants.c (build_constant_data_ref): Likewise.
        * class.c (build_utf8_ref): Likewise.
        (build_fieldref_cache_entry, build_static_field_ref): Likewise.
        (get_dispatch_table, layout_class_method): Likewise.
        (build_class_ref): Likewise. Don't set DECL_SIZE or DECL_SIZE_UNIT
        by hand.
        (make_local_function_alias): Don't SET_DECL_ASSEMBLER_NAME.
        (make_method_value): Use METHOD_ABSTRACT instead of DECL_RTL_SET_P
        to determine if we need a non-zero address.
        * decl.c (builtin_function): Don't call make_decl_rtl.
        (give_name_to_locals): Don't SET_DECL_ASSEMBLER_NAME.
        * expr.c (build_known_method_ref): Don't call make_decl_rtl.
        * resource.c (compile_resource_data): Likewise.
        * parse.y (resolve_field_access): Re-word comment to avoid
        building DECL_RTL.

From-SVN: r100108
parent 8cfb12bf
2005-05-24 Richard Henderson <rth@redhat.com> 2005-05-24 Richard Henderson <rth@redhat.com>
* builtins.c (define_builtin): Don't call make_decl_rtl.
* constants.c (build_constant_data_ref): Likewise.
* class.c (build_utf8_ref): Likewise.
(build_fieldref_cache_entry, build_static_field_ref): Likewise.
(get_dispatch_table, layout_class_method): Likewise.
(build_class_ref): Likewise. Don't set DECL_SIZE or DECL_SIZE_UNIT
by hand.
(make_local_function_alias): Don't SET_DECL_ASSEMBLER_NAME.
(make_method_value): Use METHOD_ABSTRACT instead of DECL_RTL_SET_P
to determine if we need a non-zero address.
* decl.c (builtin_function): Don't call make_decl_rtl.
(give_name_to_locals): Don't SET_DECL_ASSEMBLER_NAME.
* expr.c (build_known_method_ref): Don't call make_decl_rtl.
* resource.c (compile_resource_data): Likewise.
* parse.y (resolve_field_access): Re-word comment to avoid
building DECL_RTL.
2005-05-24 Richard Henderson <rth@redhat.com>
* class.c (registered_class): Take it out of class_roots; turn into * class.c (registered_class): Take it out of class_roots; turn into
a vec of trees. a vec of trees.
(register_class): Make static. Don't duplicate decl node. Use (register_class): Make static. Don't duplicate decl node. Use
......
...@@ -144,7 +144,6 @@ define_builtin (enum built_in_function val, ...@@ -144,7 +144,6 @@ define_builtin (enum built_in_function val,
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname));
make_decl_rtl (decl);
pushdecl (decl); pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL; DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL;
DECL_FUNCTION_CODE (decl) = val; DECL_FUNCTION_CODE (decl) = val;
......
...@@ -916,7 +916,6 @@ build_utf8_ref (tree name) ...@@ -916,7 +916,6 @@ build_utf8_ref (tree name)
rest_of_decl_compilation (decl, global_bindings_p (), 0); rest_of_decl_compilation (decl, global_bindings_p (), 0);
cgraph_varpool_mark_needed_node (cgraph_varpool_node (decl)); cgraph_varpool_mark_needed_node (cgraph_varpool_node (decl));
utf8_decl_list = decl; utf8_decl_list = decl;
make_decl_rtl (decl);
ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl); ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl);
IDENTIFIER_UTF8_REF (name) = ref; IDENTIFIER_UTF8_REF (name) = ref;
return ref; return ref;
...@@ -948,9 +947,9 @@ build_class_ref (tree type) ...@@ -948,9 +947,9 @@ build_class_ref (tree type)
if (TREE_CODE (type) == POINTER_TYPE) if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (flag_indirect_dispatch if (flag_indirect_dispatch
&& type != output_class && type != output_class
&& TREE_CODE (type) == RECORD_TYPE) && TREE_CODE (type) == RECORD_TYPE)
return build_indirect_class_ref (type); return build_indirect_class_ref (type);
if (TREE_CODE (type) == RECORD_TYPE) if (TREE_CODE (type) == RECORD_TYPE)
...@@ -963,8 +962,6 @@ build_class_ref (tree type) ...@@ -963,8 +962,6 @@ build_class_ref (tree type)
if (decl == NULL_TREE) if (decl == NULL_TREE)
{ {
decl = build_decl (VAR_DECL, decl_name, class_type_node); decl = build_decl (VAR_DECL, decl_name, class_type_node);
DECL_SIZE (decl) = TYPE_SIZE (class_type_node);
DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (class_type_node);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
DECL_IGNORED_P (decl) = 1; DECL_IGNORED_P (decl) = 1;
...@@ -974,7 +971,6 @@ build_class_ref (tree type) ...@@ -974,7 +971,6 @@ build_class_ref (tree type)
SET_DECL_ASSEMBLER_NAME (decl, SET_DECL_ASSEMBLER_NAME (decl,
java_mangle_class_field java_mangle_class_field
(&temporary_obstack, type)); (&temporary_obstack, type));
make_decl_rtl (decl);
pushdecl_top_level (decl); pushdecl_top_level (decl);
} }
} }
...@@ -1027,7 +1023,6 @@ build_class_ref (tree type) ...@@ -1027,7 +1023,6 @@ build_class_ref (tree type)
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
make_decl_rtl (decl);
pushdecl_top_level (decl); pushdecl_top_level (decl);
} }
} }
...@@ -1058,7 +1053,6 @@ build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED) ...@@ -1058,7 +1053,6 @@ build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED)
TREE_PUBLIC (decl) = 0; TREE_PUBLIC (decl) = 0;
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
make_decl_rtl (decl);
pushdecl_top_level (decl); pushdecl_top_level (decl);
} }
return decl; return decl;
...@@ -1083,12 +1077,8 @@ build_static_field_ref (tree fdecl) ...@@ -1083,12 +1077,8 @@ build_static_field_ref (tree fdecl)
|| JNUMERIC_TYPE_P (TREE_TYPE (fdecl))) || JNUMERIC_TYPE_P (TREE_TYPE (fdecl)))
&& TREE_CONSTANT (DECL_INITIAL (fdecl)))) && TREE_CONSTANT (DECL_INITIAL (fdecl))))
{ {
if (!DECL_RTL_SET_P (fdecl)) if (is_compiled == 1)
{ DECL_EXTERNAL (fdecl) = 1;
if (is_compiled == 1)
DECL_EXTERNAL (fdecl) = 1;
make_decl_rtl (fdecl);
}
} }
else else
{ {
...@@ -1240,7 +1230,6 @@ make_local_function_alias (tree method) ...@@ -1240,7 +1230,6 @@ make_local_function_alias (tree method)
DECL_INITIAL (alias) = error_mark_node; DECL_INITIAL (alias) = error_mark_node;
TREE_ADDRESSABLE (alias) = 1; TREE_ADDRESSABLE (alias) = 1;
TREE_USED (alias) = 1; TREE_USED (alias) = 1;
SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias));
TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1; TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias)) = 1;
if (!flag_syntax_only) if (!flag_syntax_only)
assemble_alias (alias, DECL_ASSEMBLER_NAME (method)); assemble_alias (alias, DECL_ASSEMBLER_NAME (method));
...@@ -1320,7 +1309,7 @@ make_method_value (tree mdecl) ...@@ -1320,7 +1309,7 @@ make_method_value (tree mdecl)
index = integer_minus_one_node; index = integer_minus_one_node;
code = null_pointer_node; code = null_pointer_node;
if (DECL_RTL_SET_P (mdecl)) if (!METHOD_ABSTRACT (mdecl))
code = build1 (ADDR_EXPR, nativecode_ptr_type_node, code = build1 (ADDR_EXPR, nativecode_ptr_type_node,
make_local_function_alias (mdecl)); make_local_function_alias (mdecl));
START_RECORD_CONSTRUCTOR (minit, method_type_node); START_RECORD_CONSTRUCTOR (minit, method_type_node);
...@@ -1442,9 +1431,6 @@ get_dispatch_table (tree type, tree this_class_addr) ...@@ -1442,9 +1431,6 @@ get_dispatch_table (tree type, tree this_class_addr)
} }
else else
{ {
if (!DECL_RTL_SET_P (method))
make_decl_rtl (method);
if (TARGET_VTABLE_USES_DESCRIPTORS) if (TARGET_VTABLE_USES_DESCRIPTORS)
for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
{ {
...@@ -2335,12 +2321,6 @@ layout_class_method (tree this_class, tree super_class, ...@@ -2335,12 +2321,6 @@ layout_class_method (tree this_class, tree super_class,
SET_DECL_ASSEMBLER_NAME (method_decl, SET_DECL_ASSEMBLER_NAME (method_decl,
java_mangle_decl (&temporary_obstack, java_mangle_decl (&temporary_obstack,
method_decl)); method_decl));
/* 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))
&& (DECL_CLINIT_P (method_decl))))
make_decl_rtl (method_decl);
if (ID_INIT_P (method_name)) if (ID_INIT_P (method_name))
{ {
......
...@@ -446,7 +446,6 @@ build_constant_data_ref (void) ...@@ -446,7 +446,6 @@ build_constant_data_ref (void)
decl = build_decl (VAR_DECL, decl_name, type); decl = build_decl (VAR_DECL, decl_name, type);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
make_decl_rtl (decl);
TYPE_CPOOL_DATA_REF (output_class) = decl; TYPE_CPOOL_DATA_REF (output_class) = decl;
} }
......
...@@ -558,7 +558,6 @@ builtin_function (const char *name, ...@@ -558,7 +558,6 @@ builtin_function (const char *name,
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
if (library_name) if (library_name)
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
make_decl_rtl (decl);
pushdecl (decl); pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = cl; DECL_BUILT_IN_CLASS (decl) = cl;
DECL_FUNCTION_CODE (decl) = function_code; DECL_FUNCTION_CODE (decl) = function_code;
...@@ -1854,7 +1853,6 @@ give_name_to_locals (JCF *jcf) ...@@ -1854,7 +1853,6 @@ give_name_to_locals (JCF *jcf)
{ {
tree decl = TREE_VEC_ELT (decl_map, slot); tree decl = TREE_VEC_ELT (decl_map, slot);
DECL_NAME (decl) = name; DECL_NAME (decl) = name;
SET_DECL_ASSEMBLER_NAME (decl, name);
if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type) if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type)
warning (0, "bad type in parameter debug info"); warning (0, "bad type in parameter debug info");
} }
...@@ -1921,7 +1919,6 @@ give_name_to_locals (JCF *jcf) ...@@ -1921,7 +1919,6 @@ give_name_to_locals (JCF *jcf)
sprintf (buffer, "ARG_%d", arg_i); sprintf (buffer, "ARG_%d", arg_i);
DECL_NAME (parm) = get_identifier (buffer); DECL_NAME (parm) = get_identifier (buffer);
} }
SET_DECL_ASSEMBLER_NAME (parm, DECL_NAME (parm));
} }
} }
} }
...@@ -2127,6 +2124,11 @@ java_mark_decl_local (tree decl) ...@@ -2127,6 +2124,11 @@ java_mark_decl_local (tree decl)
/* If we've already constructed DECL_RTL, give encode_section_info /* If we've already constructed DECL_RTL, give encode_section_info
a second chance, now that we've changed the flags. */ a second chance, now that we've changed the flags. */
/* ??? Ideally, we'd have flag_unit_at_a_time set, and not have done
anything that would have referenced DECL_RTL so far. But at the
moment we force flag_unit_at_a_time off due to excessive memory
consumption when compiling large jar files. Which probably means
that we need to re-order how we process jar files... */
if (DECL_RTL_SET_P (decl)) if (DECL_RTL_SET_P (decl))
make_decl_rtl (decl); make_decl_rtl (decl);
} }
......
...@@ -2050,7 +2050,6 @@ build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED, ...@@ -2050,7 +2050,6 @@ build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED,
if (! flag_indirect_dispatch if (! flag_indirect_dispatch
|| (! DECL_EXTERNAL (method) && ! TREE_PUBLIC (method))) || (! DECL_EXTERNAL (method) && ! TREE_PUBLIC (method)))
{ {
make_decl_rtl (method);
func = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (method)), func = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (method)),
method); method);
} }
......
...@@ -9550,11 +9550,7 @@ resolve_field_access (tree qual_wfl, tree *field_decl, tree *field_type) ...@@ -9550,11 +9550,7 @@ resolve_field_access (tree qual_wfl, tree *field_decl, tree *field_type)
field_ref = length; field_ref = length;
/* In case we're dealing with a static array, we need to /* In case we're dealing with a static array, we need to
initialize its class before the array length can be fetched. initialize its class before the array length can be fetched. */
It's also a good time to create a DECL_RTL for the field if
none already exists, otherwise if the field was declared in a
class found in an external file and hasn't been (and won't
be) accessed for its value, none will be created. */
if (TREE_CODE (where_found) == VAR_DECL && FIELD_STATIC (where_found)) if (TREE_CODE (where_found) == VAR_DECL && FIELD_STATIC (where_found))
{ {
build_static_field_ref (where_found); build_static_field_ref (where_found);
......
...@@ -93,7 +93,6 @@ compile_resource_data (const char *name, const char *buffer, int length) ...@@ -93,7 +93,6 @@ compile_resource_data (const char *name, const char *buffer, int length)
layout_decl (decl, 0); layout_decl (decl, 0);
pushdecl (decl); pushdecl (decl);
rest_of_decl_compilation (decl, global_bindings_p (), 0); rest_of_decl_compilation (decl, global_bindings_p (), 0);
make_decl_rtl (decl);
cgraph_varpool_finalize_decl (decl); cgraph_varpool_finalize_decl (decl);
resources = tree_cons (NULL_TREE, decl, resources); resources = tree_cons (NULL_TREE, decl, resources);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment