summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-14 19:39:36 +0000
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-14 19:39:36 +0000
commit771e289076fb404b3af142ccbc1ce7251ae95ee6 (patch)
tree6784ca7456219fc5f0b50b07b3f96641c6cc9e9c /gcc/passes.c
parent1c58960e7eb5b969f581a1ed169b2c304f0626ce (diff)
downloadgcc-771e289076fb404b3af142ccbc1ce7251ae95ee6.tar.gz
dumping cleanup phase 1 -- Removing TODO_dump_func
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175051 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 0faef10b590..23963a01e31 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1602,6 +1602,37 @@ do_per_function_toporder (void (*callback) (void *data), void *data)
nnodes = 0;
}
+/* Helper function to perform function body dump. */
+
+static void
+execute_function_dump (void *data ATTRIBUTE_UNUSED)
+{
+ if (dump_file && current_function_decl)
+ {
+ if (cfun->curr_properties & PROP_trees)
+ dump_function_to_file (current_function_decl, dump_file, dump_flags);
+ else
+ {
+ if (dump_flags & TDF_SLIM)
+ print_rtl_slim_with_bb (dump_file, get_insns (), dump_flags);
+ else if ((cfun->curr_properties & PROP_cfg)
+ && (dump_flags & TDF_BLOCKS))
+ print_rtl_with_bb (dump_file, get_insns ());
+ else
+ print_rtl (dump_file, get_insns ());
+
+ if ((cfun->curr_properties & PROP_cfg)
+ && graph_dump_format != no_graph
+ && (dump_flags & TDF_GRAPH))
+ print_rtl_graph_with_bb (dump_file_name, get_insns ());
+ }
+
+ /* Flush the file. If verification fails, we won't be able to
+ close the file before aborting. */
+ fflush (dump_file);
+ }
+}
+
/* Perform all TODO actions that ought to be done on each function. */
static void
@@ -1648,31 +1679,6 @@ execute_function_todo (void *data)
if (flags & TODO_remove_unused_locals)
remove_unused_locals ();
- if ((flags & TODO_dump_func) && dump_file && current_function_decl)
- {
- if (cfun->curr_properties & PROP_trees)
- dump_function_to_file (current_function_decl, dump_file, dump_flags);
- else
- {
- if (dump_flags & TDF_SLIM)
- print_rtl_slim_with_bb (dump_file, get_insns (), dump_flags);
- else if ((cfun->curr_properties & PROP_cfg)
- && (dump_flags & TDF_BLOCKS))
- print_rtl_with_bb (dump_file, get_insns ());
- else
- print_rtl (dump_file, get_insns ());
-
- if ((cfun->curr_properties & PROP_cfg)
- && graph_dump_format != no_graph
- && (dump_flags & TDF_GRAPH))
- print_rtl_graph_with_bb (dump_file_name, get_insns ());
- }
-
- /* Flush the file. If verification fails, we won't be able to
- close the file before aborting. */
- fflush (dump_file);
- }
-
if (flags & TODO_rebuild_frequencies)
rebuild_frequencies ();
@@ -1898,6 +1904,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
execute_todo (todo_after);
verify_interpass_invariants ();
+ do_per_function (execute_function_dump, NULL);
pass_fini_dump_file (pass);
current_pass = NULL;
@@ -2038,6 +2045,7 @@ execute_one_pass (struct opt_pass *pass)
/* Run post-pass cleanup and verification. */
execute_todo (todo_after | pass->todo_flags_finish);
verify_interpass_invariants ();
+ do_per_function (execute_function_dump, NULL);
if (pass->type == IPA_PASS)
{
struct cgraph_node *node;