* tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
(execute_all_ipa_stmt_fixups): Declare.
* ipa-cp.c (pass_ipa_cp): Added stmt_fixup value.
* ipa-inline.c (pass_ipa_inline): Likewise.
* ipa-pure-const.c (pass_ipa_pure_cons): Likewise.
* ipa-reference.c (pass_ipa_reference): Likewise.
* ipa.c (pass_ipa_whole_program_visibility): Likewise.
* lto-streamer-out.c (pass_ipa_lto_gimple_out): Likewise.
(pass_ipa_lto_finish_out): Likewise.
* lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Likewise.
* passes.c (execute_ipa_stmt_fixups): New function.
(execute_all_ipa_stmt_fixups): New function.
* lto-streamer-in.c (input_function): Call execute_all_ipa_stmt_fixups.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154064
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-11-10 Martin Jambor <mjambor@suse.cz>
+
+ * tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
+ (execute_all_ipa_stmt_fixups): Declare.
+ * ipa-cp.c (pass_ipa_cp): Added stmt_fixup value.
+ * ipa-inline.c (pass_ipa_inline): Likewise.
+ * ipa-pure-const.c (pass_ipa_pure_cons): Likewise.
+ * ipa-reference.c (pass_ipa_reference): Likewise.
+ * ipa.c (pass_ipa_whole_program_visibility): Likewise.
+ * lto-streamer-out.c (pass_ipa_lto_gimple_out): Likewise.
+ (pass_ipa_lto_finish_out): Likewise.
+ * lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Likewise.
+ * passes.c (execute_ipa_stmt_fixups): New function.
+ (execute_all_ipa_stmt_fixups): New function.
+ * lto-streamer-in.c (input_function): Call execute_all_ipa_stmt_fixups.
+
2009-11-10 Eric Botcazou <ebotcazou@adacore.com>
PR ada/20548
ipcp_write_summary, /* write_summary */
ipcp_read_summary, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL, /* variable_transform */
inline_write_summary, /* write_summary */
inline_read_summary, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
inline_transform, /* function_transform */
NULL, /* variable_transform */
pure_const_write_summary, /* write_summary */
pure_const_read_summary, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
ipa_reference_write_summary, /* write_summary */
ipa_reference_read_summary, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
NULL, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL, /* variable_transform */
gimple *stmts;
basic_block bb;
struct bitpack_d *bp;
+ struct cgraph_node *node;
fn = DECL_STRUCT_FUNCTION (fn_decl);
tag = input_record_start (ib);
gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest));
}
- fixup_call_stmt_edges (cgraph_node (fn_decl), stmts);
+ node = cgraph_node (fn_decl);
+ fixup_call_stmt_edges (node, stmts);
+ execute_all_ipa_stmt_fixups (node, stmts);
update_ssa (TODO_update_ssa_only_virtuals);
free_dominance_info (CDI_DOMINATORS);
lto_output, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
produce_asm_for_decls, /* write_summary */
NULL, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
lto_output_wpa_fixup, /* write_summary */
lto_input_wpa_fixup, /* read_summary */
NULL, /* function_read_summary */
+ NULL, /* stmt_fixup */
0, /* TODOs */
NULL, /* function_transform */
NULL /* variable_transform */
while (pass);
}
+/* Execute stmt fixup hooks of all passes in PASS for NODE and STMTS. */
+
+static void
+execute_ipa_stmt_fixups (struct opt_pass *pass,
+ struct cgraph_node *node, gimple *stmts)
+{
+ while (pass)
+ {
+ /* Execute all of the IPA_PASSes in the list. */
+ if (pass->type == IPA_PASS
+ && (!pass->gate || pass->gate ()))
+ {
+ struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *) pass;
+
+ if (ipa_pass->stmt_fixup)
+ {
+ pass_init_dump_file (pass);
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_push (pass->tv_id);
+
+ ipa_pass->stmt_fixup (node, stmts);
+
+ /* Stop timevar. */
+ if (pass->tv_id)
+ timevar_pop (pass->tv_id);
+ pass_fini_dump_file (pass);
+ }
+ if (pass->sub)
+ execute_ipa_stmt_fixups (pass->sub, node, stmts);
+ }
+ pass = pass->next;
+ }
+}
+
+/* Execute stmt fixup hooks of all IPA passes for NODE and STMTS. */
+
+void
+execute_all_ipa_stmt_fixups (struct cgraph_node *node, gimple *stmts)
+{
+ execute_ipa_stmt_fixups (all_regular_ipa_passes, node, stmts);
+}
+
+
extern void debug_properties (unsigned int);
extern void dump_properties (FILE *, unsigned int);
as needed so both calls are necessary. */
void (*read_summary) (void);
void (*function_read_summary) (struct cgraph_node *);
-
+ /* Hook to convert gimple stmt uids into true gimple statements. The second
+ parameter is an array of statements indexed by their uid. */
+ void (*stmt_fixup) (struct cgraph_node *, gimple *);
+
/* Results of interprocedural propagation of an IPA pass is applied to
function body via this hook. */
unsigned int function_transform_todo_flags_start;
extern void execute_ipa_pass_list (struct opt_pass *);
extern void execute_ipa_summary_passes (struct ipa_opt_pass_d *);
extern void execute_all_ipa_transforms (void);
+extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple *);
extern void print_current_pass (FILE *);
extern void debug_pass (void);