cgraph.c (cgraph_release_function_body): New function.
* cgraph.c (cgraph_release_function_body): New function. (cgraph_remove_node): Use it. * cgraph.h (cgraph_release_function_body): Declare. * cgraphunit.c (cgraph_expand_function): Use it. * ipa.c (cgraph_remove_unreahchable_nodes): Use it. * tree-ssa.c (delete_tree_ssa): Allow to be called before aliasing is initialized and while compilation of other function is running. * tree-optimize.c (execute_free_cfg_annotations): Move code to clear statement CFG annotations from here to ... * tree-cfg.c (delete_tree_cfg_annotations): ... here. From-SVN: r120437
This commit is contained in:
parent
b06e8639fa
commit
3a40c18a68
|
@ -1,3 +1,16 @@
|
||||||
|
2007-01-04 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
|
* cgraph.c (cgraph_release_function_body): New function.
|
||||||
|
(cgraph_remove_node): Use it.
|
||||||
|
* cgraph.h (cgraph_release_function_body): Declare.
|
||||||
|
* cgraphunit.c (cgraph_expand_function): Use it.
|
||||||
|
* ipa.c (cgraph_remove_unreahchable_nodes): Use it.
|
||||||
|
* tree-ssa.c (delete_tree_ssa): Allow to be called before aliasing
|
||||||
|
is initialized and while compilation of other function is running.
|
||||||
|
* tree-optimize.c (execute_free_cfg_annotations): Move code to clear
|
||||||
|
statement CFG annotations from here to ...
|
||||||
|
* tree-cfg.c (delete_tree_cfg_annotations): ... here.
|
||||||
|
|
||||||
2007-01-04 Zdenek Dvorak <dvorakz@suse.cz>
|
2007-01-04 Zdenek Dvorak <dvorakz@suse.cz>
|
||||||
|
|
||||||
* cfgloop.h (enum li_flags): Make the constants powers of two.
|
* cfgloop.h (enum li_flags): Make the constants powers of two.
|
||||||
|
|
27
gcc/cgraph.c
27
gcc/cgraph.c
|
@ -468,6 +468,27 @@ cgraph_node_remove_callers (struct cgraph_node *node)
|
||||||
node->callers = NULL;
|
node->callers = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Release memory used to represent body of function NODE. */
|
||||||
|
|
||||||
|
void
|
||||||
|
cgraph_release_function_body (struct cgraph_node *node)
|
||||||
|
{
|
||||||
|
if (DECL_STRUCT_FUNCTION (node->decl)
|
||||||
|
&& DECL_STRUCT_FUNCTION (node->decl)->gimple_df)
|
||||||
|
{
|
||||||
|
tree old_decl = current_function_decl;
|
||||||
|
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
|
||||||
|
current_function_decl = node->decl;
|
||||||
|
delete_tree_ssa ();
|
||||||
|
delete_tree_cfg_annotations ();
|
||||||
|
current_function_decl = old_decl;
|
||||||
|
pop_cfun();
|
||||||
|
}
|
||||||
|
DECL_SAVED_TREE (node->decl) = NULL;
|
||||||
|
DECL_STRUCT_FUNCTION (node->decl) = NULL;
|
||||||
|
DECL_INITIAL (node->decl) = error_mark_node;
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove the node from cgraph. */
|
/* Remove the node from cgraph. */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -541,11 +562,7 @@ cgraph_remove_node (struct cgraph_node *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kill_body && flag_unit_at_a_time)
|
if (kill_body && flag_unit_at_a_time)
|
||||||
{
|
cgraph_release_function_body (node);
|
||||||
DECL_SAVED_TREE (node->decl) = NULL;
|
|
||||||
DECL_STRUCT_FUNCTION (node->decl) = NULL;
|
|
||||||
DECL_INITIAL (node->decl) = error_mark_node;
|
|
||||||
}
|
|
||||||
node->decl = NULL;
|
node->decl = NULL;
|
||||||
if (node->call_site_hash)
|
if (node->call_site_hash)
|
||||||
{
|
{
|
||||||
|
|
|
@ -281,6 +281,7 @@ void dump_cgraph_node (FILE *, struct cgraph_node *);
|
||||||
void cgraph_insert_node_to_hashtable (struct cgraph_node *node);
|
void cgraph_insert_node_to_hashtable (struct cgraph_node *node);
|
||||||
void cgraph_remove_edge (struct cgraph_edge *);
|
void cgraph_remove_edge (struct cgraph_edge *);
|
||||||
void cgraph_remove_node (struct cgraph_node *);
|
void cgraph_remove_node (struct cgraph_node *);
|
||||||
|
void cgraph_release_function_body (struct cgraph_node *);
|
||||||
void cgraph_node_remove_callees (struct cgraph_node *node);
|
void cgraph_node_remove_callees (struct cgraph_node *node);
|
||||||
struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
|
struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
|
||||||
struct cgraph_node *,
|
struct cgraph_node *,
|
||||||
|
|
|
@ -1179,9 +1179,7 @@ cgraph_expand_function (struct cgraph_node *node)
|
||||||
current_function_decl = NULL;
|
current_function_decl = NULL;
|
||||||
if (!cgraph_preserve_function_body_p (node->decl))
|
if (!cgraph_preserve_function_body_p (node->decl))
|
||||||
{
|
{
|
||||||
DECL_SAVED_TREE (node->decl) = NULL;
|
cgraph_release_function_body (node);
|
||||||
DECL_STRUCT_FUNCTION (node->decl) = NULL;
|
|
||||||
DECL_INITIAL (node->decl) = error_mark_node;
|
|
||||||
/* Eliminate all call edges. This is important so the call_expr no longer
|
/* Eliminate all call edges. This is important so the call_expr no longer
|
||||||
points to the dead function body. */
|
points to the dead function body. */
|
||||||
cgraph_node_remove_callees (node);
|
cgraph_node_remove_callees (node);
|
||||||
|
|
|
@ -186,9 +186,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
|
||||||
break;
|
break;
|
||||||
if (!clone)
|
if (!clone)
|
||||||
{
|
{
|
||||||
DECL_SAVED_TREE (node->decl) = NULL;
|
cgraph_release_function_body (node);
|
||||||
DECL_STRUCT_FUNCTION (node->decl) = NULL;
|
|
||||||
DECL_INITIAL (node->decl) = error_mark_node;
|
|
||||||
node->analyzed = false;
|
node->analyzed = false;
|
||||||
}
|
}
|
||||||
cgraph_node_remove_callees (node);
|
cgraph_node_remove_callees (node);
|
||||||
|
|
|
@ -2651,6 +2651,17 @@ disband_implicit_edges (void)
|
||||||
void
|
void
|
||||||
delete_tree_cfg_annotations (void)
|
delete_tree_cfg_annotations (void)
|
||||||
{
|
{
|
||||||
|
basic_block bb;
|
||||||
|
block_stmt_iterator bsi;
|
||||||
|
|
||||||
|
/* Remove annotations from every tree in the function. */
|
||||||
|
FOR_EACH_BB (bb)
|
||||||
|
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||||
|
{
|
||||||
|
tree stmt = bsi_stmt (bsi);
|
||||||
|
ggc_free (stmt->base.ann);
|
||||||
|
stmt->base.ann = NULL;
|
||||||
|
}
|
||||||
label_to_block_map = NULL;
|
label_to_block_map = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,21 +241,9 @@ struct tree_opt_pass pass_free_datastructures =
|
||||||
static unsigned int
|
static unsigned int
|
||||||
execute_free_cfg_annotations (void)
|
execute_free_cfg_annotations (void)
|
||||||
{
|
{
|
||||||
basic_block bb;
|
|
||||||
block_stmt_iterator bsi;
|
|
||||||
|
|
||||||
/* Emit gotos for implicit jumps. */
|
/* Emit gotos for implicit jumps. */
|
||||||
disband_implicit_edges ();
|
disband_implicit_edges ();
|
||||||
|
|
||||||
/* Remove annotations from every tree in the function. */
|
|
||||||
FOR_EACH_BB (bb)
|
|
||||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
|
||||||
{
|
|
||||||
tree stmt = bsi_stmt (bsi);
|
|
||||||
ggc_free (stmt->base.ann);
|
|
||||||
stmt->base.ann = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* And get rid of annotations we no longer need. */
|
/* And get rid of annotations we no longer need. */
|
||||||
delete_tree_cfg_annotations ();
|
delete_tree_cfg_annotations ();
|
||||||
|
|
||||||
|
|
|
@ -846,10 +846,13 @@ delete_tree_ssa (void)
|
||||||
cfun->gimple_df->call_clobbered_vars = NULL;
|
cfun->gimple_df->call_clobbered_vars = NULL;
|
||||||
cfun->gimple_df->addressable_vars = NULL;
|
cfun->gimple_df->addressable_vars = NULL;
|
||||||
cfun->gimple_df->modified_noreturn_calls = NULL;
|
cfun->gimple_df->modified_noreturn_calls = NULL;
|
||||||
|
if (gimple_aliases_computed_p (cfun))
|
||||||
|
{
|
||||||
|
delete_alias_heapvars ();
|
||||||
|
gcc_assert (!need_ssa_update_p ());
|
||||||
|
}
|
||||||
cfun->gimple_df->aliases_computed_p = false;
|
cfun->gimple_df->aliases_computed_p = false;
|
||||||
|
|
||||||
delete_alias_heapvars ();
|
|
||||||
gcc_assert (!need_ssa_update_p ());
|
|
||||||
cfun->gimple_df = NULL;
|
cfun->gimple_df = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue