This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Canonicalize the second arg of make_decl_rtl
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: Canonicalize the second arg of make_decl_rtl
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Date: Wed, 21 Mar 2001 16:01:56 +0100
This is a totally stupid patch that just canonicalize the second
argument passed to make_decl_rtl when it is null. Before the patch, there
were 3 forms (0, NULL, NULL_PTR) and the patch just homogeneize
all the cases to use NULL_PTR. In addition, there is also the
conversion from make_function_rtl to make_decl_rtl for chill (that
Mark did some time ago for the other frontends). I'm not sur it is
worth or useful since chill has been disabled but just in case....
Bootstrapped many times on x86 (except for the chill part).
gcc/ChangeLog:
2001-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* c-decl.c (start_function): Always use NULL_PTR as the second arg of
make_decl_rtl.
* profile.c (output_func_start_profiler): Ditto.
ch/ChangeLog:
* ch-tree.h: Declare the new make_decl_rtl function.
* decl.c (push_extern_function): Use it here.
(builtin_function): And here.
(finish_outer_function): And here.
* except.c (start_handler_array): Likewise.
(initialize_exceptions): Likewise.
* grant.c (chill_finish_compile): Likewise.
* inout.c (declare_predefined_file): Likewise.
* satisfy.c (safe_satisfy_decl): Likewise.
cp/ChangeLog:
* decl2.c (finish_anon_union): Always use NULL_PTR as the second arg of
make_decl_rtl.
f/ChangeLog:
* com.c (ffecom_init_zero_): Always use NULL_PTR as the second arg of
make_decl_rtl.
(ffecom_lookup_label): Likewise.
(start_function): Likewise.
java/ChangeLog:
* class.c (build_utf8_ref): Always use NULL_PTR as the second arg of
make_decl_rtl.
(build_class_ref): Likewise.
(build_static_field_ref): Likewise.
(get_dispatch_table): Likewise.
(layout_class_method): Likewise.
(emit_register_classes): Likewise.
* constants.c (build_constant_data_ref): Likewise.
objc/ChangeLog:
* objc-act.c (create_builtin_decl): Always use NULL_PTR as the second arg of
make_decl_rtl.
(build_selector_reference_decl): Likewise.
(build_class_reference_decl): Likewise.
(build_objc_string_decl): Likewise.
(build_protocol_reference): Likewise.
Index: gcc/c-decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-decl.c,v
retrieving revision 1.215
diff -c -3 -p -r1.215 c-decl.c
*** c-decl.c 2001/03/19 23:49:50 1.215
--- c-decl.c 2001/03/20 19:00:50
*************** start_function (declspecs, declarator, p
*** 6004,6010 ****
declare_parm_level (1);
current_binding_level->subblocks_tag_transparent = 1;
! make_decl_rtl (current_function_decl, NULL);
restype = TREE_TYPE (TREE_TYPE (current_function_decl));
/* Promote the value to int before returning it. */
--- 6004,6010 ----
declare_parm_level (1);
current_binding_level->subblocks_tag_transparent = 1;
! make_decl_rtl (current_function_decl, NULL_PTR);
restype = TREE_TYPE (TREE_TYPE (current_function_decl));
/* Promote the value to int before returning it. */
Index: gcc/profile.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/profile.c,v
retrieving revision 1.54
diff -c -3 -p -r1.54 profile.c
*** profile.c 2001/03/19 23:49:51 1.54
--- profile.c 2001/03/20 19:00:50
*************** output_func_start_profiler ()
*** 1115,1121 ****
announce_function (fndecl);
current_function_decl = fndecl;
DECL_INITIAL (fndecl) = error_mark_node;
! make_decl_rtl (fndecl, NULL);
init_function_start (fndecl, input_filename, lineno);
pushlevel (0);
expand_function_start (fndecl, 0);
--- 1115,1121 ----
announce_function (fndecl);
current_function_decl = fndecl;
DECL_INITIAL (fndecl) = error_mark_node;
! make_decl_rtl (fndecl, NULL_PTR);
init_function_start (fndecl, input_filename, lineno);
pushlevel (0);
expand_function_start (fndecl, 0);
Index: gcc/ch/ch-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/ch-tree.h,v
retrieving revision 1.23
diff -c -3 -p -r1.23 ch-tree.h
*** ch-tree.h 2001/01/29 02:46:26 1.23
--- ch-tree.h 2001/03/20 19:00:51
*************** extern int floor_log2_wide
*** 1115,1121 ****
extern void rest_of_compilation PARAMS ((tree));
/* in varasm.c */
! extern void make_function_rtl PARAMS ((tree));
/* in ???? */
extern void init_iterators PARAMS ((void));
--- 1115,1121 ----
extern void rest_of_compilation PARAMS ((tree));
/* in varasm.c */
! extern void make_decl_rtl PARAMS ((tree, const char*));
/* in ???? */
extern void init_iterators PARAMS ((void));
Index: gcc/ch/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/decl.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 decl.c
*** decl.c 2001/02/23 20:38:55 1.31
--- decl.c 2001/03/20 19:00:51
*************** push_extern_function (name, typespec, ar
*** 1223,1229 ****
save_decl (fndecl);
pop_obstacks ();
}
! make_function_rtl (fndecl);
}
else
{
--- 1223,1229 ----
save_decl (fndecl);
pop_obstacks ();
}
! make_decl_rtl (fndecl, NULL_PTR);
}
else
{
*************** builtin_function (name, type, function_c
*** 4077,4083 ****
DECL_BUILT_IN_NONANSI (decl) = 1;
if (library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
! make_decl_rtl (decl, NULL_PTR, 1);
pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = class;
DECL_FUNCTION_CODE (decl) = function_code;
--- 4077,4083 ----
DECL_BUILT_IN_NONANSI (decl) = 1;
if (library_name)
DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
! make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = class;
DECL_FUNCTION_CODE (decl) = function_code;
*************** finish_outer_function ()
*** 4966,4970 ****
init_entry_decl,
module_init_list);
! make_decl_rtl (global_function_decl, NULL, 0);
}
--- 4966,4970 ----
init_entry_decl,
module_init_list);
! make_decl_rtl (global_function_decl, NULL_PTR);
}
Index: gcc/ch/except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/except.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 except.c
*** except.c 2001/02/04 23:18:43 1.16
--- except.c 2001/03/20 19:00:52
*************** start_handler_array ()
*** 264,270 ****
DECL_INITIAL (decl) = error_mark_node;
pushdecl (decl);
! make_decl_rtl (decl, NULL_PTR, 0);
current_handler->handler_array_decl = decl;
return decl;
}
--- 264,270 ----
DECL_INITIAL (decl) = error_mark_node;
pushdecl (decl);
! make_decl_rtl (decl, NULL_PTR);
current_handler->handler_array_decl = decl;
return decl;
}
*************** initialize_exceptions ()
*** 597,603 ****
DECL_EXTERNAL (exception_stack_decl) = 1;
push_obstacks_nochange ();
pushdecl(exception_stack_decl);
! make_decl_rtl (exception_stack_decl, NULL_PTR, 1);
finish_decl (exception_stack_decl);
}
--- 597,603 ----
DECL_EXTERNAL (exception_stack_decl) = 1;
push_obstacks_nochange ();
pushdecl(exception_stack_decl);
! make_decl_rtl (exception_stack_decl, NULL_PTR);
finish_decl (exception_stack_decl);
}
Index: gcc/ch/grant.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/grant.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 grant.c
*** grant.c 2001/02/04 23:18:43 1.16
--- grant.c 2001/03/20 19:00:52
*************** chill_finish_compile ()
*** 3042,3048 ****
tasking_registry ();
! make_decl_rtl (current_function_decl, NULL, 1);
finish_chill_function ();
--- 3042,3048 ----
tasking_registry ();
! make_decl_rtl (current_function_decl, NULL_PTR);
finish_chill_function ();
Index: gcc/ch/inout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/inout.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 inout.c
*** inout.c 2000/12/07 01:55:52 1.15
--- inout.c 2001/03/20 19:00:52
*************** declare_predefined_file (name, assembler
*** 1076,1082 ****
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1;
DECL_IN_SYSTEM_HEADER (decl) = 1;
! make_decl_rtl (decl, 0, 1);
pushdecl (decl);
}
--- 1076,1082 ----
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1;
DECL_IN_SYSTEM_HEADER (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
}
Index: gcc/ch/satisfy.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ch/satisfy.c,v
retrieving revision 1.14
diff -c -3 -p -r1.14 satisfy.c
*** satisfy.c 2000/05/27 15:21:16 1.14
--- satisfy.c 2001/03/20 19:00:52
*************** safe_satisfy_decl (decl, prev_chain)
*** 246,252 ****
|| TREE_CODE (decl) == CONST_DECL))
{
if (TREE_CODE (decl) == FUNCTION_DECL && decl_function_context (decl))
! make_function_rtl (decl);
else if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
expand_decl (decl);
else
--- 246,252 ----
|| TREE_CODE (decl) == CONST_DECL))
{
if (TREE_CODE (decl) == FUNCTION_DECL && decl_function_context (decl))
! make_decl_rtl (decl, NULL_PTR);
else if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
expand_decl (decl);
else
*************** safe_satisfy_decl (decl, prev_chain)
*** 263,269 ****
IDENTIFIER_POINTER (current_module->prefix_name),
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
! make_decl_rtl (decl, asm_name, TREE_PUBLIC (decl));
}
}
--- 263,269 ----
IDENTIFIER_POINTER (current_module->prefix_name),
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
! make_decl_rtl (decl, asm_name);
}
}
Index: gcc/cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.447
diff -c -3 -p -r1.447 decl2.c
*** decl2.c 2001/03/19 23:49:54 1.447
--- decl2.c 2001/03/20 19:00:55
*************** finish_anon_union (anon_union_decl)
*** 2159,2165 ****
if (static_p)
{
! make_decl_rtl (main_decl, 0);
COPY_DECL_RTL (main_decl, anon_union_decl);
expand_anon_union_decl (anon_union_decl,
NULL_TREE,
--- 2159,2165 ----
if (static_p)
{
! make_decl_rtl (main_decl, NULL_PTR);
COPY_DECL_RTL (main_decl, anon_union_decl);
expand_anon_union_decl (anon_union_decl,
NULL_TREE,
Index: gcc/f/com.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/f/com.c,v
retrieving revision 1.116
diff -c -3 -p -r1.116 com.c
*** com.c 2001/03/19 23:50:02 1.116
--- com.c 2001/03/20 19:00:58
*************** ffecom_init_zero_ (tree decl)
*** 6390,6396 ****
if (incremental)
{
! make_decl_rtl (decl, NULL);
assemble_variable (decl, TREE_PUBLIC (decl) ? 1 : 0, 0, 1);
}
--- 6390,6396 ----
if (incremental)
{
! make_decl_rtl (decl, NULL_PTR);
assemble_variable (decl, TREE_PUBLIC (decl) ? 1 : 0, 0, 1);
}
*************** ffecom_lookup_label (ffelab label)
*** 12196,12202 ****
TREE_STATIC (glabel) = 1;
DECL_CONTEXT (glabel) = current_function_decl;
DECL_INITIAL (glabel) = NULL;
! make_decl_rtl (glabel, NULL);
expand_decl (glabel);
ffecom_save_tree_forever (glabel);
--- 12196,12202 ----
TREE_STATIC (glabel) = 1;
DECL_CONTEXT (glabel) = current_function_decl;
DECL_INITIAL (glabel) = NULL;
! make_decl_rtl (glabel, NULL_PTR);
expand_decl (glabel);
ffecom_save_tree_forever (glabel);
*************** start_function (tree name, tree type, in
*** 14356,14362 ****
if (TREE_CODE (current_function_decl) != ERROR_MARK)
{
! make_decl_rtl (current_function_decl, NULL);
restype = TREE_TYPE (TREE_TYPE (current_function_decl));
DECL_RESULT (current_function_decl)
--- 14356,14362 ----
if (TREE_CODE (current_function_decl) != ERROR_MARK)
{
! make_decl_rtl (current_function_decl, NULL_PTR);
restype = TREE_TYPE (TREE_TYPE (current_function_decl));
DECL_RESULT (current_function_decl)
Index: gcc/java/class.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/class.c,v
retrieving revision 1.95
diff -c -3 -p -r1.95 class.c
*** class.c 2001/03/19 23:50:03 1.95
--- class.c 2001/03/20 19:00:58
*************** build_utf8_ref (name)
*** 864,870 ****
pushdecl (decl);
rest_of_decl_compilation (decl, (char*) 0, global_bindings_p (), 0);
utf8_decl_list = decl;
! make_decl_rtl (decl, (char*) 0);
ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl);
IDENTIFIER_UTF8_REF (name) = ref;
return ref;
--- 864,870 ----
pushdecl (decl);
rest_of_decl_compilation (decl, (char*) 0, global_bindings_p (), 0);
utf8_decl_list = decl;
! make_decl_rtl (decl, NULL_PTR);
ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl);
IDENTIFIER_UTF8_REF (name) = ref;
return ref;
*************** build_class_ref (type)
*** 902,908 ****
SET_DECL_ASSEMBLER_NAME (decl,
java_mangle_class_field
(&temporary_obstack, type));
! make_decl_rtl (decl, NULL);
pushdecl_top_level (decl);
if (is_compiled == 1)
DECL_EXTERNAL (decl) = 1;
--- 902,908 ----
SET_DECL_ASSEMBLER_NAME (decl,
java_mangle_class_field
(&temporary_obstack, type));
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
if (is_compiled == 1)
DECL_EXTERNAL (decl) = 1;
*************** build_class_ref (type)
*** 955,961 ****
decl = build_decl (VAR_DECL, decl_name, class_type_node);
TREE_STATIC (decl) = 1;
TREE_PUBLIC (decl) = 1;
! make_decl_rtl (decl, NULL);
pushdecl_top_level (decl);
if (is_compiled == 1)
DECL_EXTERNAL (decl) = 1;
--- 955,961 ----
decl = build_decl (VAR_DECL, decl_name, class_type_node);
TREE_STATIC (decl) = 1;
TREE_PUBLIC (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
if (is_compiled == 1)
DECL_EXTERNAL (decl) = 1;
*************** build_static_field_ref (fdecl)
*** 988,994 ****
{
if (is_compiled == 1)
DECL_EXTERNAL (fdecl) = 1;
! make_decl_rtl (fdecl, NULL);
}
return fdecl;
}
--- 988,994 ----
{
if (is_compiled == 1)
DECL_EXTERNAL (fdecl) = 1;
! make_decl_rtl (fdecl, NULL_PTR);
}
return fdecl;
}
*************** get_dispatch_table (type, this_class_add
*** 1222,1228 ****
else
{
if (!DECL_RTL_SET_P (method))
! make_decl_rtl (method, NULL);
method = build1 (ADDR_EXPR, nativecode_ptr_type_node, method);
}
list = tree_cons (NULL_TREE /*DECL_VINDEX (method) + 2*/,
--- 1222,1228 ----
else
{
if (!DECL_RTL_SET_P (method))
! make_decl_rtl (method, NULL_PTR);
method = build1 (ADDR_EXPR, nativecode_ptr_type_node, method);
}
list = tree_cons (NULL_TREE /*DECL_VINDEX (method) + 2*/,
*************** layout_class_method (this_class, super_c
*** 1807,1813 ****
if (! METHOD_ABSTRACT (method_decl)
|| (CLASS_INTERFACE (TYPE_NAME (this_class))
&& (DECL_CLINIT_P (method_decl))))
! make_decl_rtl (method_decl, NULL);
if (ID_INIT_P (method_name))
{
--- 1807,1813 ----
if (! METHOD_ABSTRACT (method_decl)
|| (CLASS_INTERFACE (TYPE_NAME (this_class))
&& (DECL_CLINIT_P (method_decl))))
! make_decl_rtl (method_decl, NULL_PTR);
if (ID_INIT_P (method_name))
{
*************** emit_register_classes ()
*** 1888,1894 ****
/* DECL_EXTERNAL (init_decl) = 1;*/
TREE_PUBLIC (init_decl) = 1;
pushlevel (0);
! make_decl_rtl (init_decl, NULL);
init_function_start (init_decl, input_filename, 0);
expand_function_start (init_decl, 0);
--- 1888,1894 ----
/* DECL_EXTERNAL (init_decl) = 1;*/
TREE_PUBLIC (init_decl) = 1;
pushlevel (0);
! make_decl_rtl (init_decl, NULL_PTR);
init_function_start (init_decl, input_filename, 0);
expand_function_start (init_decl, 0);
Index: gcc/java/constants.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/constants.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 constants.c
*** constants.c 2001/02/04 22:44:02 1.17
--- constants.c 2001/03/20 19:00:58
*************** build_constant_data_ref ()
*** 401,407 ****
build_array_type (ptr_type_node,
one_elt_array_domain_type));
TREE_STATIC (decl) = 1;
! make_decl_rtl (decl, NULL);
TYPE_CPOOL_DATA_REF (current_class) = current_constant_pool_data_ref
= build1 (ADDR_EXPR, ptr_type_node, decl);
}
--- 401,407 ----
build_array_type (ptr_type_node,
one_elt_array_domain_type));
TREE_STATIC (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
TYPE_CPOOL_DATA_REF (current_class) = current_constant_pool_data_ref
= build1 (ADDR_EXPR, ptr_type_node, decl);
}
Index: gcc/objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/objc/objc-act.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 objc-act.c
*** objc-act.c 2001/03/20 02:57:28 1.73
--- objc-act.c 2001/03/20 19:01:00
*************** create_builtin_decl (code, type, name)
*** 1231,1237 ****
if (code == VAR_DECL)
{
TREE_STATIC (decl) = 1;
! make_decl_rtl (decl, 0);
pushdecl (decl);
}
--- 1231,1237 ----
if (code == VAR_DECL)
{
TREE_STATIC (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
}
*************** build_selector_reference_decl ()
*** 2076,2082 ****
DECL_ARTIFICIAL (decl) = 1;
DECL_CONTEXT (decl) = 0;
! make_decl_rtl (decl, 0);
pushdecl_top_level (decl);
return decl;
--- 2076,2082 ----
DECL_ARTIFICIAL (decl) = 1;
DECL_CONTEXT (decl) = 0;
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
return decl;
*************** build_class_reference_decl ()
*** 2298,2304 ****
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, 0);
pushdecl_top_level (decl);
return decl;
--- 2298,2304 ----
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
return decl;
*************** build_objc_string_decl (section)
*** 2441,2447 ****
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, 0);
pushdecl_top_level (decl);
return decl;
--- 2441,2447 ----
DECL_CONTEXT (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
return decl;
*************** build_protocol_reference (p)
*** 5343,5349 ****
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, 0);
pushdecl_top_level (decl);
}
--- 5343,5349 ----
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
! make_decl_rtl (decl, NULL_PTR);
pushdecl_top_level (decl);
}
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
PGP signature