decl.c (java_expand_body): Kill.

* decl.c (java_expand_body): Kill.
	(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

	* toplev.c (process_options): all frontends now do unit-at-a-time.
	* cgraphunit.c: update comments.
	(cgraph_expand_function): call passmanager dirrectly; emit thunks.
	* c-decl.c (finish_function): use cgraph_add_new_function.

	* method.c (use_thunk): Use tree_rest_of_compilation
	* cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
	(LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
	* cp-tree.h (expand_body): Kill.
	(emit_associated_thunks): Declare.
	* semantics.c (emit_associated_thunks): Export.
	(expand_body): Kill.

	* misc.c (gnat_expand_body): Kill.
	(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

	* f95-lang.c (gfc_expand_function): Kill.
	(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

	* function.c (expand_function_end): We are always unit-at-a-time.

From-SVN: r128367
This commit is contained in:
Jan Hubicka 2007-09-11 12:39:53 +02:00 committed by Jan Hubicka
parent 8ce4afa36d
commit e89d601008
21 changed files with 47 additions and 123 deletions

View File

@ -1,3 +1,11 @@
2007-09-11 Jan Hubicka <jh@suse.cz>
* toplev.c (process_options): all frontends now do unit-at-a-time.
* cgraphunit.c: update comments.
(cgraph_expand_function): call passmanager dirrectly; emit thunks.
* c-decl.c (finish_function): use cgraph_add_new_function.
* function.c (expand_function_end): We are always unit-at-a-time.
2007-09-11 Richard Sandiford <richard@codesourcery.com>
* config/mips/mips.c (mips_set_mips16_mode): Use separate anchor

View File

@ -1,3 +1,8 @@
2007-09-11 Jan Hubicka <jh@suse.cz>
* misc.c (gnat_expand_body): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
2007-09-10 Robert Dewar <dewar@adacore.com>
* exp_atag.ads, exp_atag.adb, mlib-tgt-tru64.adb, mlib-tgt-aix.adb,

View File

@ -100,7 +100,6 @@ static int gnat_eh_type_covers (tree, tree);
static void gnat_parse_file (int);
static rtx gnat_expand_expr (tree, rtx, enum machine_mode, int,
rtx *);
static void gnat_expand_body (tree);
static void internal_error_function (const char *, va_list *);
static void gnat_adjust_rli (record_layout_info);
static tree gnat_type_max_size (const_tree);
@ -149,8 +148,6 @@ static tree gnat_type_max_size (const_tree);
#define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name
#undef LANG_HOOKS_DWARF_NAME
#define LANG_HOOKS_DWARF_NAME gnat_dwarf_name
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gnat_expand_body
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr
#undef LANG_HOOKS_TYPE_FOR_MODE
@ -678,14 +675,6 @@ gnat_expand_expr (tree exp, rtx target, enum machine_mode tmode,
return expand_expr_real (new, target, tmode, modifier, alt_rtl);
}
/* Generate the RTL for the body of GNU_DECL. */
static void
gnat_expand_body (tree gnu_decl)
{
tree_rest_of_compilation (gnu_decl);
}
/* Adjusts the RLI used to layout a record after all the fields have been
added. We only handle the packed case and cause it to use the alignment
that will pad the record at the end. */

View File

@ -4577,15 +4577,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode,
}
}
/* Generate the RTL for the body of FNDECL. */
void
c_expand_body (tree fndecl)
{
tree_rest_of_compilation (fndecl);
}
/* Hook used by staticp to handle language-specific tree codes. */
tree

View File

@ -6799,7 +6799,7 @@ finish_function (void)
This should be cleaned up later and this conditional removed. */
if (cgraph_global_info_ready)
{
c_expand_body (fndecl);
cgraph_add_new_function (fndecl, false);
return;
}

View File

@ -76,15 +76,6 @@ along with GCC; see the file COPYING3. If not see
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
- expand_function callback
This function is used to expand function and pass it into RTL back-end.
Front-end should not make any assumptions about when this function can be
called. In particular cgraph_assemble_pending_functions,
varpool_assemble_pending_variables, cgraph_finalize_function,
varpool_finalize_function, cgraph_optimize can cause arbitrarily
previously finalized functions to be expanded.
We implement two compilation modes.
- unit-at-a-time: In this mode analyzing of all functions is deferred
@ -1074,7 +1065,9 @@ cgraph_expand_function (struct cgraph_node *node)
}
/* Generate RTL for the body of DECL. */
lang_hooks.callgraph.expand_function (decl);
if (lang_hooks.callgraph.emit_associated_thunks)
lang_hooks.callgraph.emit_associated_thunks (decl);
tree_rest_of_compilation (decl);
/* Make sure that BE didn't give up on compiling. */
/* ??? Can happen with nested function of extern inline. */

View File

@ -1,3 +1,13 @@
2007-09-11 Jan Hubicka <jh@suse.cz>
* method.c (use_thunk): Use tree_rest_of_compilation
* cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
(LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
* cp-tree.h (expand_body): Kill.
(emit_associated_thunks): Declare.
* semantics.c (emit_associated_thunks): Export.
(expand_body): Kill.
2007-09-09 David Daney <ddaney@avtrex.com>
PR c++/33324

View File

@ -115,8 +115,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR
#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body
#undef LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS
#define LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS emit_associated_thunks
#undef LANG_HOOKS_MAKE_TYPE
#define LANG_HOOKS_MAKE_TYPE cxx_make_type

View File

@ -4639,7 +4639,7 @@ extern tree finish_typeof (tree);
extern tree finish_offsetof (tree);
extern void finish_decl_cleanup (tree, tree);
extern void finish_eh_cleanup (tree);
extern void expand_body (tree);
extern void emit_associated_thunks (tree);
extern void finish_mem_initializers (tree);
extern tree check_template_template_default_arg (tree);
extern void expand_or_defer_fn (tree);

View File

@ -523,7 +523,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
thunk_fndecl = finish_function (0);
tree_lowering_passes (thunk_fndecl);
expand_body (thunk_fndecl);
tree_rest_of_compilation (thunk_fndecl);
}
pop_from_top_level ();

View File

@ -54,7 +54,6 @@ along with GCC; see the file COPYING3. If not see
static tree maybe_convert_cond (tree);
static tree simplify_aggr_init_exprs_r (tree *, int *, void *);
static void emit_associated_thunks (tree);
static tree finalize_nrv_r (tree *, int *, void *);
@ -3094,7 +3093,7 @@ simplify_aggr_init_expr (tree *tp)
/* Emit all thunks to FN that should be emitted when FN is emitted. */
static void
void
emit_associated_thunks (tree fn)
{
/* When we use vcall offsets, we emit thunks with the virtual
@ -3128,22 +3127,6 @@ emit_associated_thunks (tree fn)
/* Generate RTL for FN. */
void
expand_body (tree fn)
{
/* Emit any thunks that should be emitted at the same time as FN. */
emit_associated_thunks (fn);
/* This function is only called from cgraph, or recursively from
emit_associated_thunks. In neither case should we be currently
generating trees for a function. */
gcc_assert (function_depth == 0);
c_expand_body (fn);
}
/* Generate RTL for FN. */
void
expand_or_defer_fn (tree fn)
{

View File

@ -1,3 +1,8 @@
2007-09-11 Jan Hubicka <jh@suse.cz>
* f95-lang.c (gfc_expand_function): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
2007-09-08 Tobias Burnus <burnus@net-b.de>
PR fortran/31547

View File

@ -98,7 +98,6 @@ int global_bindings_p (void);
void insert_block (tree);
static void gfc_clear_binding_stack (void);
static void gfc_be_parse_file (int);
static void gfc_expand_function (tree);
static alias_set_type gfc_get_alias_set (tree);
#undef LANG_HOOKS_NAME
@ -135,7 +134,6 @@ static alias_set_type gfc_get_alias_set (tree);
#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gfc_expand_function
#define LANG_HOOKS_CLEAR_BINDING_STACK gfc_clear_binding_stack
#define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference
@ -194,45 +192,6 @@ static GTY(()) struct binding_level *free_binding_level;
It is indexed by a RID_... value. */
tree *ridpointers = NULL;
/* language-specific flags. */
static void
gfc_expand_function (tree fndecl)
{
tree t;
if (DECL_INITIAL (fndecl)
&& BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)))
{
/* Local static equivalenced variables are never seen by
check_global_declarations, so we need to output debug
info by hand. */
t = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl));
for (t = BLOCK_VARS (t); t; t = TREE_CHAIN (t))
if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t)
&& TREE_STATIC (t))
{
tree expr = DECL_VALUE_EXPR (t);
if (TREE_CODE (expr) == COMPONENT_REF
&& TREE_CODE (TREE_OPERAND (expr, 0)) == VAR_DECL
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0)))
== UNION_TYPE
&& varpool_node (TREE_OPERAND (expr, 0))->needed
&& errorcount == 0 && sorrycount == 0)
{
timevar_push (TV_SYMOUT);
(*debug_hooks->global_decl) (t);
timevar_pop (TV_SYMOUT);
}
}
}
tree_rest_of_compilation (fndecl);
}
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,
or validate its data type for an `if' or `while' statement or ?..: exp.

View File

@ -4404,13 +4404,6 @@ expand_function_end (void)
}
}
/* Possibly warn about unused parameters.
When frontend does unit-at-a-time, the warning is already
issued at finalization time. */
if (warn_unused_parameter
&& !lang_hooks.callgraph.expand_function)
do_warn_unused_parameter (current_function_decl);
/* End any sequences that failed to be closed due to syntax errors. */
while (in_sequence_p ())
end_sequence ();

View File

@ -1,3 +1,8 @@
2007-09-11 Jan Hubicka <jh@suse.cz>
* decl.c (java_expand_body): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
2007-09-06 Tom Tromey <tromey@redhat.com>
* jcf-parse.c (parse_class_file): Re-enter the current file.

View File

@ -1862,14 +1862,6 @@ finish_method (tree fndecl)
cgraph_finalize_function (fndecl, false);
}
/* Optimize and expand a function's entire body. */
void
java_expand_body (tree fndecl)
{
tree_rest_of_compilation (fndecl);
}
/* We pessimistically marked all methods and fields external until we
knew what set of classes we were planning to compile. Now mark those
associated with CLASS to be generated locally as not external. */

View File

@ -192,9 +192,6 @@ struct language_function GTY(())
#undef LANG_HOOKS_GET_CALLEE_FNDECL
#define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION java_expand_body
#undef LANG_HOOKS_CLEAR_BINDING_STACK
#define LANG_HOOKS_CLEAR_BINDING_STACK java_clear_binding_stack

View File

@ -138,11 +138,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
}
#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR lhd_callgraph_analyze_expr
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION NULL
#define LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS NULL
#define LANG_HOOKS_CALLGRAPH_INITIALIZER { \
LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, \
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, \
LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS, \
}
#define LANG_HOOKS_FUNCTION_INITIALIZER { \

View File

@ -44,8 +44,8 @@ struct lang_hooks_for_callgraph
are relevant to use of other declarations, mark them. */
tree (*analyze_expr) (tree *, int *, tree);
/* Produce RTL for function passed as argument. */
void (*expand_function) (tree);
/* Emmit thunks associated to function. */
void (*emit_associated_thunks) (tree);
};
/* Lang hooks for management of language-specific data or status

View File

@ -461,8 +461,7 @@ next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass)
cgraph_expand_all_functions ()
for each node N in the cgraph
cgraph_expand_function (N)
lang_hooks.callgraph.expand_function (DECL (N))
tree_rest_of_compilation (DECL (N)) -> all_passes
tree_rest_of_compilation (DECL (N)) -> all_passes
*/
void

View File

@ -1785,11 +1785,6 @@ process_options (void)
if (flag_asynchronous_unwind_tables)
flag_unwind_tables = 1;
/* Disable unit-at-a-time mode for frontends not supporting callgraph
interface. */
if (flag_unit_at_a_time && ! lang_hooks.callgraph.expand_function)
flag_unit_at_a_time = 0;
if (!flag_unit_at_a_time)
flag_section_anchors = 0;