Convert gimple types from a union to C++ inheritance

Patch partially autogenerated by refactor_gimple.py from
https://github.com/davidmalcolm/gcc-refactoring-scripts
revision 05fc808c61bd8ddd2372f29b79ceb2491360d298

	* Makefile.in (GIMPLE_H): Add dep on is-a.h.
	* coretypes.h (union gimple_statement_d): Remove declaration.
	(gimple): Convert from being a "union gimple_statement_d *"
	to a "struct gimple_statement_base *".
	(const_gimple): Likewise (with "const").
	* ggc.h (ggc_alloc_cleared_gimple_statement_d_stat): Replace
	with...
	(ggc_alloc_cleared_gimple_statement_stat): ...this.
	* gimple-pretty-print.c (debug): Change parameter from a
	"gimple_statement_d &" to a "gimple_statement_base &".
	(debug): Change parameter from a "gimple_statement_d *" to
	a "gimple_statement_base *".
	* gimple-pretty-print.h (debug): Update declarations as above.
	* gimple.c (gimple_alloc_stat): Update for renaming of
	ggc_alloc_cleared_gimple_statement_d_stat to
	ggc_alloc_cleared_gimple_statement_stat.
	* gimple.h: Include "is-a.h" for use by is_a_helper
	specializations in followup autogenerated patch.
	(struct gimple statement_base): Make this type usable as a base
	class by adding "desc", "tag" and "variable_size" to GTY, thus
	using opting-in to gengtype's support for simple inheritance.
	(gimple_statement_with_ops_base): Convert to a subclass of
	gimple_statement_base, dropping initial "gsbase" field.  Note
	that this type is abstract, with no GSS_ value, and thus no GTY
	tag value.
	(gimple_statement_with_ops): Convert to a subclass of
	gimple_statement_with_ops_base, dropping initial "opbase" field.
	Add tag value to GTY marking.  Update marking of op field to
	reflect how num_ops field is accessed via inheritance.
	(gimple_statement_with_memory_ops_base): Convert to a subclass of
	gimple_statement_with_ops_base, dropping initial "opbase" field.
	Add tag value to GTY marking.
	(gimple_statement_with_memory_ops): Convert to a subclass of
	public gimple_statement_with_memory_ops_base, dropping initial
	"membase" field.  Add tag value to GTY marking.  Update marking
	of op field to reflect how num_ops field is accessed via
	inheritance.
	(gimple_statement_call): Analogous changes that also update the
	marking of the "u" union.
	(gimple_statement_omp): Convert to a subclass of
	gimple_statement_base, dropping initial "gsbase" field, adding
	tag value to GTY marking.
	(gimple_statement_bind): Likewise.
	(gimple_statement_catch): Likewise.
	(gimple_statement_eh_filter): Likewise.
	(gimple_statement_eh_else): Likewise.
	(gimple_statement_eh_mnt): Likewise.
	(gimple_statement_phi): Likewise.
	(gimple_statement_eh_ctrl): Likewise.
	(gimple_statement_try): Likewise.
	(gimple_statement_wce): Likewise.
	(gimple_statement_asm): Convert to a subclass of
	gimple_statement_with_memory_ops_base, dropping initial
	"membase" field, adding tag value to GTY marking, and updating
	marking of op field.
	(gimple_statement_omp_critical): Convert to a subclass of
	gimple_statement_omp, dropping initial "omp" field, adding tag
	value to GTY marking.
	(gimple_statement_omp_for): Likewise.
	(gimple_statement_omp_parallel): Likewise.
	(gimple_statement_omp_task): Convert to a subclass of
	gimple_statement_omp_parallel, dropping initial "par" field,
	adding tag value to GTY marking.
	(gimple_statement_omp_sections): Convert to a subclass of
	gimple_statement_omp, dropping initial "omp" field, adding
	tag value to GTY marking.
	(gimple_statement_omp_continue): Convert to a subclass of
	gimple_statement_base, dropping initial "gsbase" field, adding
	tag value to GTY marking.
	(gimple_statement_omp_single): Convert to a subclass of
	gimple_statement_omp, dropping initial "omp" field, adding
	tag value to GTY marking.
	(gimple_statement_omp_atomic_load): Convert to a subclass of
	gimple_statement_base, dropping initial "gsbase" field, adding
	tag value to GTY marking.
	(gimple_statement_omp_atomic_store): Convert to a subclass of
	gimple_statement_base, dropping initial "gsbase" field, adding
	tag value to GTY marking.
	(gimple_statement_transaction): Convert to a subclass of
	gimple_statement_with_memory_ops_base, dropping initial "gsbase"
	field, adding tag value to GTY marking.
	(union gimple_statement_d): Remove.
	* system.h (CONST_CAST_GIMPLE): Update to use
	"struct gimple_statement_base *" rather than
	"union gimple_statement_d *".
	* tree-ssa-ccp.c (gimple_htab): Convert underlying type from
	gimple_statement_d to gimple_statement_base.

	* gimple.h (gimple_use_ops): Port from union to usage of
	dyn_cast.
	(gimple_set_use_ops): Port from union to usage of as_a.
	(gimple_set_vuse): Likewise.
	(gimple_set_vdef): Likewise.
	(gimple_call_internal_fn): Port from union to a static_cast,
	given that the type has already been asserted.
	(gimple_omp_body_ptr): Port from unchecked union usage to
	a static_cast.
	(gimple_omp_set_body): Likewise.

	* gimple-iterator.c (update_bb_for_stmts): Update for conversion of
	gimple types to a true class hierarchy.
	(update_call_edge_frequencies): Likewise.
	(gsi_insert_seq_nodes_before): Likewise.
	(gsi_insert_seq_nodes_after): Likewise.
	(gsi_split_seq_after): Likewise.
	(gsi_set_stmt): Likewise.
	(gsi_split_seq_before): Likewise.
	(gsi_remove): Likewise.
	* gimple-iterator.h (gsi_one_before_end_p): Likewise.
	(gsi_next): Likewise.
	(gsi_prev): Likewise.
	* gimple-pretty-print.c (dump_gimple_debug): Likewise.
	* gimple-ssa.h (gimple_vuse_op): Likewise.
	(gimple_vdef_op): Likewise.
	* gimple-streamer-in.c (input_gimple_stmt): Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* gimple.c (gimple_set_code): Likewise.
	(gimple_alloc_stat): Likewise.
	(gimple_set_subcode): Likewise.
	(gimple_build_call_internal_1): Likewise.
	(gimple_check_failed): Likewise.
	(gimple_call_flags): Likewise.
	(gimple_set_bb): Likewise.
	* gimple.h (is_a_helper <gimple_statement_asm> (gimple)): New.
	(is_a_helper <gimple_statement_bind> (gimple)): Likewise.
	(is_a_helper <gimple_statement_call> (gimple)): Likewise.
	(is_a_helper <gimple_statement_catch> (gimple)): Likewise.
	(is_a_helper <gimple_statement_eh_ctrl> (gimple)): Likewise.
	(is_a_helper <gimple_statement_eh_else> (gimple)): Likewise.
	(is_a_helper <gimple_statement_eh_filter> (gimple)): Likewise.
	(is_a_helper <gimple_statement_eh_mnt> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_atomic_load> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_atomic_store> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_continue> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_critical> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_for> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_parallel> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_sections> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_single> (gimple)): Likewise.
	(is_a_helper <gimple_statement_omp_task> (gimple)): Likewise.
	(is_a_helper <gimple_statement_phi> (gimple)): Likewise.
	(is_a_helper <gimple_statement_transaction> (gimple)): Likewise.
	(is_a_helper <gimple_statement_try> (gimple)): Likewise.
	(is_a_helper <gimple_statement_wce> (gimple)): Likewise.
	(is_a_helper <const gimple_statement_asm> (const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_bind> (const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_call> (const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_catch> (const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_eh_ctrl> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_eh_filter> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_atomic_load> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_atomic_store>
	(const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_omp_continue> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_critical> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_for> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_parallel> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_sections> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_single> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_omp_task> (const_gimple)):
	Likewise.
	(is_a_helper <const gimple_statement_phi> (const_gimple)): Likewise.
	(is_a_helper <const gimple_statement_transaction> (const_gimple)):
	Likewise.
	(gimple_seq_last): Update for conversion of gimple types to a true
	class hierarchy.
	(gimple_seq_set_last): Likewise.
	(gimple_code): Likewise.
	(gimple_bb): Likewise.
	(gimple_block): Likewise.
	(gimple_set_block): Likewise.
	(gimple_location): Likewise.
	(gimple_location_ptr): Likewise.
	(gimple_set_location): Likewise.
	(gimple_no_warning_p): Likewise.
	(gimple_set_no_warning): Likewise.
	(gimple_set_visited): Likewise.
	(gimple_visited_p): Likewise.
	(gimple_set_plf): Likewise.
	(gimple_plf): Likewise.
	(gimple_set_uid): Likewise.
	(gimple_uid): Likewise.
	(gimple_init_singleton): Likewise.
	(gimple_modified_p): Likewise.
	(gimple_set_modified): Likewise.
	(gimple_expr_code): Likewise.
	(gimple_has_volatile_ops): Likewise.
	(gimple_set_has_volatile_ops): Likewise.
	(gimple_omp_subcode): Likewise.
	(gimple_omp_set_subcode): Likewise.
	(gimple_omp_return_set_nowait): Likewise.
	(gimple_omp_section_set_last): Likewise.
	(gimple_omp_parallel_set_combined_p): Likewise.
	(gimple_omp_atomic_set_need_value): Likewise.
	(gimple_omp_atomic_set_seq_cst): Likewise.
	(gimple_num_ops): Likewise.
	(gimple_set_num_ops): Likewise.
	(gimple_assign_nontemporal_move_p): Likewise.
	(gimple_assign_set_nontemporal_move): Likewise.
	(gimple_assign_rhs_code): Likewise.
	(gimple_assign_set_rhs_code): Likewise.
	(gimple_call_internal_p): Likewise.
	(gimple_call_with_bounds_p): Likewise.
	(gimple_call_set_with_bounds): Likewise.
	(gimple_call_set_tail): Likewise.
	(gimple_call_tail_p): Likewise.
	(gimple_call_set_return_slot_opt): Likewise.
	(gimple_call_return_slot_opt_p): Likewise.
	(gimple_call_set_from_thunk): Likewise.
	(gimple_call_from_thunk_p): Likewise.
	(gimple_call_set_va_arg_pack): Likewise.
	(gimple_call_va_arg_pack_p): Likewise.
	(gimple_call_set_nothrow): Likewise.
	(gimple_call_set_alloca_for_var): Likewise.
	(gimple_call_alloca_for_var_p): Likewise.
	(gimple_call_copy_flags): Likewise.
	(gimple_cond_code): Likewise.
	(gimple_cond_set_code): Likewise.
	(gimple_cond_make_false): Likewise.
	(gimple_cond_make_true): Likewise.
	(gimple_asm_volatile_p): Likewise.
	(gimple_asm_set_volatile): Likewise.
	(gimple_asm_set_input): Likewise.
	(gimple_asm_input_p): Likewise.
	(gimple_try_kind): Likewise.
	(gimple_try_set_kind): Likewise.
	(gimple_try_catch_is_cleanup): Likewise.
	(gimple_try_set_catch_is_cleanup): Likewise.
	(gimple_wce_cleanup_eh_only): Likewise.
	(gimple_wce_set_cleanup_eh_only): Likewise.
	(gimple_debug_bind_p): Likewise.
	(gimple_debug_source_bind_p): Likewise.
	(gimple_omp_for_set_kind): Likewise.
	(gimple_omp_for_set_combined_p): Likewise.
	(gimple_omp_for_set_combined_into_p): Likewise.
	(gimple_omp_target_set_kind): Likewise.
	(gimple_transaction_subcode): Likewise.
	(gimple_transaction_set_subcode): Likewise.
	(gimple_predict_predictor): Likewise.
	(gimple_predict_set_predictor): Likewise.
	(gimple_predict_outcome): Likewise.
	(gimple_predict_set_outcome): Likewise.
	(gimple_transaction_set_label): Likewise.
	(gimple_transaction_set_body): Likewise.
	(gimple_transaction_label_ptr): Likewise.
	(gimple_transaction_label): Likewise.
	(gimple_transaction_body_ptr): Likewise.
	(gimple_omp_continue_set_control_use): Likewise.
	(gimple_omp_continue_control_use_ptr): Likewise.
	(gimple_omp_continue_control_use): Likewise.
	(gimple_omp_continue_set_control_def): Likewise.
	(gimple_omp_continue_control_def_ptr): Likewise.
	(gimple_omp_continue_control_def): Likewise.
	(gimple_omp_atomic_load_rhs_ptr): Likewise.
	(gimple_omp_atomic_load_rhs): Likewise.
	(gimple_omp_atomic_load_set_rhs): Likewise.
	(gimple_omp_atomic_load_lhs_ptr): Likewise.
	(gimple_omp_atomic_load_lhs): Likewise.
	(gimple_omp_atomic_load_set_lhs): Likewise.
	(gimple_omp_atomic_store_val_ptr): Likewise.
	(gimple_omp_atomic_store_val): Likewise.
	(gimple_omp_atomic_store_set_val): Likewise.
	(gimple_omp_for_cond): Likewise.
	(gimple_omp_for_set_cond): Likewise.
	(gimple_omp_sections_set_control): Likewise.
	(gimple_omp_sections_control_ptr): Likewise.
	(gimple_omp_sections_control): Likewise.
	(gimple_omp_sections_set_clauses): Likewise.
	(gimple_omp_sections_clauses_ptr): Likewise.
	(gimple_omp_sections_clauses): Likewise.
	(gimple_omp_teams_set_clauses): Likewise.
	(gimple_omp_teams_clauses_ptr): Likewise.
	(gimple_omp_teams_clauses): Likewise.
	(gimple_omp_target_set_data_arg): Likewise.
	(gimple_omp_target_data_arg_ptr): Likewise.
	(gimple_omp_target_data_arg): Likewise.
	(gimple_omp_target_set_child_fn): Likewise.
	(gimple_omp_target_child_fn_ptr): Likewise.
	(gimple_omp_target_child_fn): Likewise.
	(gimple_omp_target_set_clauses): Likewise.
	(gimple_omp_target_clauses_ptr): Likewise.
	(gimple_omp_target_clauses): Likewise.
	(gimple_omp_single_set_clauses): Likewise.
	(gimple_omp_single_clauses_ptr): Likewise.
	(gimple_omp_single_clauses): Likewise.
	(gimple_omp_task_set_arg_align): Likewise.
	(gimple_omp_task_arg_align_ptr): Likewise.
	(gimple_omp_task_arg_align): Likewise.
	(gimple_omp_task_set_arg_size): Likewise.
	(gimple_omp_task_arg_size_ptr): Likewise.
	(gimple_omp_task_arg_size): Likewise.
	(gimple_omp_task_set_copy_fn): Likewise.
	(gimple_omp_task_copy_fn_ptr): Likewise.
	(gimple_omp_task_copy_fn): Likewise.
	(gimple_omp_task_set_data_arg): Likewise.
	(gimple_omp_task_data_arg_ptr): Likewise.
	(gimple_omp_task_data_arg): Likewise.
	(gimple_omp_task_set_child_fn): Likewise.
	(gimple_omp_task_child_fn_ptr): Likewise.
	(gimple_omp_task_child_fn): Likewise.
	(gimple_omp_task_set_clauses): Likewise.
	(gimple_omp_task_clauses_ptr): Likewise.
	(gimple_omp_task_clauses): Likewise.
	(gimple_omp_parallel_set_data_arg): Likewise.
	(gimple_omp_parallel_data_arg_ptr): Likewise.
	(gimple_omp_parallel_data_arg): Likewise.
	(gimple_omp_parallel_set_child_fn): Likewise.
	(gimple_omp_parallel_child_fn_ptr): Likewise.
	(gimple_omp_parallel_child_fn): Likewise.
	(gimple_omp_parallel_set_clauses): Likewise.
	(gimple_omp_parallel_clauses_ptr): Likewise.
	(gimple_omp_parallel_clauses): Likewise.
	(gimple_omp_for_set_pre_body): Likewise.
	(gimple_omp_for_pre_body_ptr): Likewise.
	(gimple_omp_for_set_incr): Likewise.
	(gimple_omp_for_incr_ptr): Likewise.
	(gimple_omp_for_incr): Likewise.
	(gimple_omp_for_set_final): Likewise.
	(gimple_omp_for_final_ptr): Likewise.
	(gimple_omp_for_final): Likewise.
	(gimple_omp_for_set_initial): Likewise.
	(gimple_omp_for_initial_ptr): Likewise.
	(gimple_omp_for_initial): Likewise.
	(gimple_omp_for_set_index): Likewise.
	(gimple_omp_for_index_ptr): Likewise.
	(gimple_omp_for_index): Likewise.
	(gimple_omp_for_collapse): Likewise.
	(gimple_omp_for_set_clauses): Likewise.
	(gimple_omp_for_clauses_ptr): Likewise.
	(gimple_omp_for_clauses): Likewise.
	(gimple_omp_critical_set_name): Likewise.
	(gimple_omp_critical_name_ptr): Likewise.
	(gimple_omp_critical_name): Likewise.
	(gimple_eh_dispatch_set_region): Likewise.
	(gimple_eh_dispatch_region): Likewise.
	(gimple_resx_set_region): Likewise.
	(gimple_resx_region): Likewise.
	(gimple_phi_set_arg): Likewise.
	(gimple_phi_arg): Likewise.
	(gimple_phi_set_result): Likewise.
	(gimple_phi_result_ptr): Likewise.
	(gimple_phi_result): Likewise.
	(gimple_phi_num_args): Likewise.
	(gimple_phi_capacity): Likewise.
	(gimple_wce_set_cleanup): Likewise.
	(gimple_wce_cleanup_ptr): Likewise.
	(gimple_try_set_cleanup): Likewise.
	(gimple_try_set_eval): Likewise.
	(gimple_try_cleanup_ptr): Likewise.
	(gimple_try_eval_ptr): Likewise.
	(gimple_eh_else_set_e_body): Likewise.
	(gimple_eh_else_set_n_body): Likewise.
	(gimple_eh_else_e_body_ptr): Likewise.
	(gimple_eh_else_n_body_ptr): Likewise.
	(gimple_eh_must_not_throw_set_fndecl): Likewise.
	(gimple_eh_must_not_throw_fndecl): Likewise.
	(gimple_eh_filter_set_failure): Likewise.
	(gimple_eh_filter_set_types): Likewise.
	(gimple_eh_filter_failure_ptr): Likewise.
	(gimple_eh_filter_types_ptr): Likewise.
	(gimple_eh_filter_types): Likewise.
	(gimple_catch_set_handler): Likewise.
	(gimple_catch_set_types): Likewise.
	(gimple_catch_handler_ptr): Likewise.
	(gimple_catch_types_ptr): Likewise.
	(gimple_catch_types): Likewise.
	(gimple_asm_string): Likewise.
	(gimple_asm_set_label_op): Likewise.
	(gimple_asm_label_op): Likewise.
	(gimple_asm_set_clobber_op): Likewise.
	(gimple_asm_clobber_op): Likewise.
	(gimple_asm_set_output_op): Likewise.
	(gimple_asm_output_op_ptr): Likewise.
	(gimple_asm_output_op): Likewise.
	(gimple_asm_set_input_op): Likewise.
	(gimple_asm_input_op_ptr): Likewise.
	(gimple_asm_input_op): Likewise.
	(gimple_asm_nlabels): Likewise.
	(gimple_asm_nclobbers): Likewise.
	(gimple_asm_noutputs): Likewise.
	(gimple_asm_ninputs): Likewise.
	(gimple_bind_set_block): Likewise.
	(gimple_bind_block): Likewise.
	(gimple_bind_add_seq): Likewise.
	(gimple_bind_add_stmt): Likewise.
	(gimple_bind_set_body): Likewise.
	(gimple_bind_body_ptr): Likewise.
	(gimple_bind_append_vars): Likewise.
	(gimple_bind_set_vars): Likewise.
	(gimple_bind_vars): Likewise.
	(gimple_call_clobber_set): Likewise.
	(gimple_call_use_set): Likewise.
	(gimple_call_set_internal_fn): Likewise.
	(gimple_call_set_fntype): Likewise.
	(gimple_call_fntype): Likewise.
	(gimple_omp_return_lhs_ptr): Likewise.
	(gimple_omp_return_lhs): Likewise.
	(gimple_omp_return_set_lhs): Likewise.
	(gimple_omp_taskreg_set_data_arg): Likewise.
	(gimple_omp_taskreg_data_arg_ptr): Likewise.
	(gimple_omp_taskreg_data_arg): Likewise.
	(gimple_omp_taskreg_set_child_fn): Likewise.
	(gimple_omp_taskreg_child_fn_ptr): Likewise.
	(gimple_omp_taskreg_child_fn): Likewise.
	(gimple_omp_taskreg_set_clauses): Likewise.
	(gimple_omp_taskreg_clauses_ptr): Likewise.
	(gimple_omp_taskreg_clauses): Likewise.
	(gimple_vuse): Likewise.
	(gimple_vdef): Likewise.
	(gimple_vuse_ptr): Likewise.
	(gimple_vdef_ptr): Likewise.
	* tree-inline.c (copy_debug_stmt): Likewise.
	* tree-phinodes.c (make_phi_node): Likewise.

	* gimple.h (is_a_helper <const gimple_statement_with_ops>::test): New.
	(is_a_helper <gimple_statement_with_ops>::test): New.
	(is_a_helper <const gimple_statement_with_memory_ops>::test): New.
	(is_a_helper <gimple_statement_with_memory_ops>::test): New.

	* gimple-streamer-in.c (input_gimple_stmt): Port from union
	access to use of as_a.
	* gimple.c (gimple_build_asm_1): Likewise.
	(gimple_build_try): Likewise.  Also, return a specific subclass
	rather than just gimple.
	(gimple_build_resx): Port from union access to use of as_a.
	(gimple_build_eh_dispatch): Likewise.
	(gimple_build_omp_for): Likewise.  Also, convert allocation of iter
	now that gengtype no longer provides a typed allocator function.
	(gimple_copy): Likewise.
	* gimple.h (gimple_build_try): Return a specific subclass rather
	than just gimple.
	* gimplify.c (gimplify_cleanup_point_expr): Replace union access
	with subclass access by making use of new return type of
	gimple_build_try.
	* tree-phinodes.c: (allocate_phi_node): Return a
	"gimple_statement_phi *" rather than just a gimple.
	(resize_phi_node): Likewise.
	(make_phi_node): Replace union access with subclass access by
	making use of new return type of allocate_phi_node.
	(reserve_phi_args_for_new_edge): Replace union access with as_a.
	(remove_phi_arg_num): Accept a "gimple_statement_phi *" rather
	than just a gimple.
	(remove_phi_args): Update for change to remove_phi_arg_num.

	* gdbhooks.py (GimplePrinter.to_string): Update lookup of
	code field to reflect inheritance, rather than embedding of
	the base gimple type.

From-SVN: r205034
This commit is contained in:
David Malcolm 2013-11-19 15:50:46 +00:00 committed by David Malcolm
parent 660dca797a
commit daa6e488c2
19 changed files with 1659 additions and 715 deletions

View File

@ -1,3 +1,463 @@
2013-11-19 David Malcolm <dmalcolm@redhat.com>
Convert gimple types from a union to C++ inheritance.
* Makefile.in (GIMPLE_H): Add dep on is-a.h.
* coretypes.h (union gimple_statement_d): Remove declaration.
(gimple): Convert from being a "union gimple_statement_d *"
to a "struct gimple_statement_base *".
(const_gimple): Likewise (with "const").
* ggc.h (ggc_alloc_cleared_gimple_statement_d_stat): Replace
with...
(ggc_alloc_cleared_gimple_statement_stat): ...this.
* gimple-pretty-print.c (debug): Change parameter from a
"gimple_statement_d &" to a "gimple_statement_base &".
(debug): Change parameter from a "gimple_statement_d *" to
a "gimple_statement_base *".
* gimple-pretty-print.h (debug): Update declarations as above.
* gimple.c (gimple_alloc_stat): Update for renaming of
ggc_alloc_cleared_gimple_statement_d_stat to
ggc_alloc_cleared_gimple_statement_stat.
* gimple.h: Include "is-a.h" for use by is_a_helper
specializations in followup autogenerated patch.
(struct gimple statement_base): Make this type usable as a base
class by adding "desc", "tag" and "variable_size" to GTY, thus
using opting-in to gengtype's support for simple inheritance.
(gimple_statement_with_ops_base): Convert to a subclass of
gimple_statement_base, dropping initial "gsbase" field. Note
that this type is abstract, with no GSS_ value, and thus no GTY
tag value.
(gimple_statement_with_ops): Convert to a subclass of
gimple_statement_with_ops_base, dropping initial "opbase" field.
Add tag value to GTY marking. Update marking of op field to
reflect how num_ops field is accessed via inheritance.
(gimple_statement_with_memory_ops_base): Convert to a subclass of
gimple_statement_with_ops_base, dropping initial "opbase" field.
Add tag value to GTY marking.
(gimple_statement_with_memory_ops): Convert to a subclass of
public gimple_statement_with_memory_ops_base, dropping initial
"membase" field. Add tag value to GTY marking. Update marking
of op field to reflect how num_ops field is accessed via
inheritance.
(gimple_statement_call): Analogous changes that also update the
marking of the "u" union.
(gimple_statement_omp): Convert to a subclass of
gimple_statement_base, dropping initial "gsbase" field, adding
tag value to GTY marking.
(gimple_statement_bind): Likewise.
(gimple_statement_catch): Likewise.
(gimple_statement_eh_filter): Likewise.
(gimple_statement_eh_else): Likewise.
(gimple_statement_eh_mnt): Likewise.
(gimple_statement_phi): Likewise.
(gimple_statement_eh_ctrl): Likewise.
(gimple_statement_try): Likewise.
(gimple_statement_wce): Likewise.
(gimple_statement_asm): Convert to a subclass of
gimple_statement_with_memory_ops_base, dropping initial
"membase" field, adding tag value to GTY marking, and updating
marking of op field.
(gimple_statement_omp_critical): Convert to a subclass of
gimple_statement_omp, dropping initial "omp" field, adding tag
value to GTY marking.
(gimple_statement_omp_for): Likewise.
(gimple_statement_omp_parallel): Likewise.
(gimple_statement_omp_task): Convert to a subclass of
gimple_statement_omp_parallel, dropping initial "par" field,
adding tag value to GTY marking.
(gimple_statement_omp_sections): Convert to a subclass of
gimple_statement_omp, dropping initial "omp" field, adding
tag value to GTY marking.
(gimple_statement_omp_continue): Convert to a subclass of
gimple_statement_base, dropping initial "gsbase" field, adding
tag value to GTY marking.
(gimple_statement_omp_single): Convert to a subclass of
gimple_statement_omp, dropping initial "omp" field, adding
tag value to GTY marking.
(gimple_statement_omp_atomic_load): Convert to a subclass of
gimple_statement_base, dropping initial "gsbase" field, adding
tag value to GTY marking.
(gimple_statement_omp_atomic_store): Convert to a subclass of
gimple_statement_base, dropping initial "gsbase" field, adding
tag value to GTY marking.
(gimple_statement_transaction): Convert to a subclass of
gimple_statement_with_memory_ops_base, dropping initial "gsbase"
field, adding tag value to GTY marking.
(union gimple_statement_d): Remove.
* system.h (CONST_CAST_GIMPLE): Update to use
"struct gimple_statement_base *" rather than
"union gimple_statement_d *".
* tree-ssa-ccp.c (gimple_htab): Convert underlying type from
gimple_statement_d to gimple_statement_base.
* gimple.h (gimple_use_ops): Port from union to usage of
dyn_cast.
(gimple_set_use_ops): Port from union to usage of as_a.
(gimple_set_vuse): Likewise.
(gimple_set_vdef): Likewise.
(gimple_call_internal_fn): Port from union to a static_cast,
given that the type has already been asserted.
(gimple_omp_body_ptr): Port from unchecked union usage to
a static_cast.
(gimple_omp_set_body): Likewise.
* gimple-iterator.c (update_bb_for_stmts): Update for conversion of
gimple types to a true class hierarchy.
(update_call_edge_frequencies): Likewise.
(gsi_insert_seq_nodes_before): Likewise.
(gsi_insert_seq_nodes_after): Likewise.
(gsi_split_seq_after): Likewise.
(gsi_set_stmt): Likewise.
(gsi_split_seq_before): Likewise.
(gsi_remove): Likewise.
* gimple-iterator.h (gsi_one_before_end_p): Likewise.
(gsi_next): Likewise.
(gsi_prev): Likewise.
* gimple-pretty-print.c (dump_gimple_debug): Likewise.
* gimple-ssa.h (gimple_vuse_op): Likewise.
(gimple_vdef_op): Likewise.
* gimple-streamer-in.c (input_gimple_stmt): Likewise.
* gimple-streamer-out.c (output_gimple_stmt): Likewise.
* gimple.c (gimple_set_code): Likewise.
(gimple_alloc_stat): Likewise.
(gimple_set_subcode): Likewise.
(gimple_build_call_internal_1): Likewise.
(gimple_check_failed): Likewise.
(gimple_call_flags): Likewise.
(gimple_set_bb): Likewise.
* gimple.h (is_a_helper <gimple_statement_asm> (gimple)): New.
(is_a_helper <gimple_statement_bind> (gimple)): Likewise.
(is_a_helper <gimple_statement_call> (gimple)): Likewise.
(is_a_helper <gimple_statement_catch> (gimple)): Likewise.
(is_a_helper <gimple_statement_eh_ctrl> (gimple)): Likewise.
(is_a_helper <gimple_statement_eh_else> (gimple)): Likewise.
(is_a_helper <gimple_statement_eh_filter> (gimple)): Likewise.
(is_a_helper <gimple_statement_eh_mnt> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_atomic_load> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_atomic_store> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_continue> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_critical> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_for> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_parallel> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_sections> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_single> (gimple)): Likewise.
(is_a_helper <gimple_statement_omp_task> (gimple)): Likewise.
(is_a_helper <gimple_statement_phi> (gimple)): Likewise.
(is_a_helper <gimple_statement_transaction> (gimple)): Likewise.
(is_a_helper <gimple_statement_try> (gimple)): Likewise.
(is_a_helper <gimple_statement_wce> (gimple)): Likewise.
(is_a_helper <const gimple_statement_asm> (const_gimple)): Likewise.
(is_a_helper <const gimple_statement_bind> (const_gimple)): Likewise.
(is_a_helper <const gimple_statement_call> (const_gimple)): Likewise.
(is_a_helper <const gimple_statement_catch> (const_gimple)): Likewise.
(is_a_helper <const gimple_statement_eh_ctrl> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_eh_filter> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_atomic_load> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_atomic_store>
(const_gimple)): Likewise.
(is_a_helper <const gimple_statement_omp_continue> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_critical> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_for> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_parallel> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_sections> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_single> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_omp_task> (const_gimple)):
Likewise.
(is_a_helper <const gimple_statement_phi> (const_gimple)): Likewise.
(is_a_helper <const gimple_statement_transaction> (const_gimple)):
Likewise.
(gimple_seq_last): Update for conversion of gimple types to a true
class hierarchy.
(gimple_seq_set_last): Likewise.
(gimple_code): Likewise.
(gimple_bb): Likewise.
(gimple_block): Likewise.
(gimple_set_block): Likewise.
(gimple_location): Likewise.
(gimple_location_ptr): Likewise.
(gimple_set_location): Likewise.
(gimple_no_warning_p): Likewise.
(gimple_set_no_warning): Likewise.
(gimple_set_visited): Likewise.
(gimple_visited_p): Likewise.
(gimple_set_plf): Likewise.
(gimple_plf): Likewise.
(gimple_set_uid): Likewise.
(gimple_uid): Likewise.
(gimple_init_singleton): Likewise.
(gimple_modified_p): Likewise.
(gimple_set_modified): Likewise.
(gimple_expr_code): Likewise.
(gimple_has_volatile_ops): Likewise.
(gimple_set_has_volatile_ops): Likewise.
(gimple_omp_subcode): Likewise.
(gimple_omp_set_subcode): Likewise.
(gimple_omp_return_set_nowait): Likewise.
(gimple_omp_section_set_last): Likewise.
(gimple_omp_parallel_set_combined_p): Likewise.
(gimple_omp_atomic_set_need_value): Likewise.
(gimple_omp_atomic_set_seq_cst): Likewise.
(gimple_num_ops): Likewise.
(gimple_set_num_ops): Likewise.
(gimple_assign_nontemporal_move_p): Likewise.
(gimple_assign_set_nontemporal_move): Likewise.
(gimple_assign_rhs_code): Likewise.
(gimple_assign_set_rhs_code): Likewise.
(gimple_call_internal_p): Likewise.
(gimple_call_with_bounds_p): Likewise.
(gimple_call_set_with_bounds): Likewise.
(gimple_call_set_tail): Likewise.
(gimple_call_tail_p): Likewise.
(gimple_call_set_return_slot_opt): Likewise.
(gimple_call_return_slot_opt_p): Likewise.
(gimple_call_set_from_thunk): Likewise.
(gimple_call_from_thunk_p): Likewise.
(gimple_call_set_va_arg_pack): Likewise.
(gimple_call_va_arg_pack_p): Likewise.
(gimple_call_set_nothrow): Likewise.
(gimple_call_set_alloca_for_var): Likewise.
(gimple_call_alloca_for_var_p): Likewise.
(gimple_call_copy_flags): Likewise.
(gimple_cond_code): Likewise.
(gimple_cond_set_code): Likewise.
(gimple_cond_make_false): Likewise.
(gimple_cond_make_true): Likewise.
(gimple_asm_volatile_p): Likewise.
(gimple_asm_set_volatile): Likewise.
(gimple_asm_set_input): Likewise.
(gimple_asm_input_p): Likewise.
(gimple_try_kind): Likewise.
(gimple_try_set_kind): Likewise.
(gimple_try_catch_is_cleanup): Likewise.
(gimple_try_set_catch_is_cleanup): Likewise.
(gimple_wce_cleanup_eh_only): Likewise.
(gimple_wce_set_cleanup_eh_only): Likewise.
(gimple_debug_bind_p): Likewise.
(gimple_debug_source_bind_p): Likewise.
(gimple_omp_for_set_kind): Likewise.
(gimple_omp_for_set_combined_p): Likewise.
(gimple_omp_for_set_combined_into_p): Likewise.
(gimple_omp_target_set_kind): Likewise.
(gimple_transaction_subcode): Likewise.
(gimple_transaction_set_subcode): Likewise.
(gimple_predict_predictor): Likewise.
(gimple_predict_set_predictor): Likewise.
(gimple_predict_outcome): Likewise.
(gimple_predict_set_outcome): Likewise.
(gimple_transaction_set_label): Likewise.
(gimple_transaction_set_body): Likewise.
(gimple_transaction_label_ptr): Likewise.
(gimple_transaction_label): Likewise.
(gimple_transaction_body_ptr): Likewise.
(gimple_omp_continue_set_control_use): Likewise.
(gimple_omp_continue_control_use_ptr): Likewise.
(gimple_omp_continue_control_use): Likewise.
(gimple_omp_continue_set_control_def): Likewise.
(gimple_omp_continue_control_def_ptr): Likewise.
(gimple_omp_continue_control_def): Likewise.
(gimple_omp_atomic_load_rhs_ptr): Likewise.
(gimple_omp_atomic_load_rhs): Likewise.
(gimple_omp_atomic_load_set_rhs): Likewise.
(gimple_omp_atomic_load_lhs_ptr): Likewise.
(gimple_omp_atomic_load_lhs): Likewise.
(gimple_omp_atomic_load_set_lhs): Likewise.
(gimple_omp_atomic_store_val_ptr): Likewise.
(gimple_omp_atomic_store_val): Likewise.
(gimple_omp_atomic_store_set_val): Likewise.
(gimple_omp_for_cond): Likewise.
(gimple_omp_for_set_cond): Likewise.
(gimple_omp_sections_set_control): Likewise.
(gimple_omp_sections_control_ptr): Likewise.
(gimple_omp_sections_control): Likewise.
(gimple_omp_sections_set_clauses): Likewise.
(gimple_omp_sections_clauses_ptr): Likewise.
(gimple_omp_sections_clauses): Likewise.
(gimple_omp_teams_set_clauses): Likewise.
(gimple_omp_teams_clauses_ptr): Likewise.
(gimple_omp_teams_clauses): Likewise.
(gimple_omp_target_set_data_arg): Likewise.
(gimple_omp_target_data_arg_ptr): Likewise.
(gimple_omp_target_data_arg): Likewise.
(gimple_omp_target_set_child_fn): Likewise.
(gimple_omp_target_child_fn_ptr): Likewise.
(gimple_omp_target_child_fn): Likewise.
(gimple_omp_target_set_clauses): Likewise.
(gimple_omp_target_clauses_ptr): Likewise.
(gimple_omp_target_clauses): Likewise.
(gimple_omp_single_set_clauses): Likewise.
(gimple_omp_single_clauses_ptr): Likewise.
(gimple_omp_single_clauses): Likewise.
(gimple_omp_task_set_arg_align): Likewise.
(gimple_omp_task_arg_align_ptr): Likewise.
(gimple_omp_task_arg_align): Likewise.
(gimple_omp_task_set_arg_size): Likewise.
(gimple_omp_task_arg_size_ptr): Likewise.
(gimple_omp_task_arg_size): Likewise.
(gimple_omp_task_set_copy_fn): Likewise.
(gimple_omp_task_copy_fn_ptr): Likewise.
(gimple_omp_task_copy_fn): Likewise.
(gimple_omp_task_set_data_arg): Likewise.
(gimple_omp_task_data_arg_ptr): Likewise.
(gimple_omp_task_data_arg): Likewise.
(gimple_omp_task_set_child_fn): Likewise.
(gimple_omp_task_child_fn_ptr): Likewise.
(gimple_omp_task_child_fn): Likewise.
(gimple_omp_task_set_clauses): Likewise.
(gimple_omp_task_clauses_ptr): Likewise.
(gimple_omp_task_clauses): Likewise.
(gimple_omp_parallel_set_data_arg): Likewise.
(gimple_omp_parallel_data_arg_ptr): Likewise.
(gimple_omp_parallel_data_arg): Likewise.
(gimple_omp_parallel_set_child_fn): Likewise.
(gimple_omp_parallel_child_fn_ptr): Likewise.
(gimple_omp_parallel_child_fn): Likewise.
(gimple_omp_parallel_set_clauses): Likewise.
(gimple_omp_parallel_clauses_ptr): Likewise.
(gimple_omp_parallel_clauses): Likewise.
(gimple_omp_for_set_pre_body): Likewise.
(gimple_omp_for_pre_body_ptr): Likewise.
(gimple_omp_for_set_incr): Likewise.
(gimple_omp_for_incr_ptr): Likewise.
(gimple_omp_for_incr): Likewise.
(gimple_omp_for_set_final): Likewise.
(gimple_omp_for_final_ptr): Likewise.
(gimple_omp_for_final): Likewise.
(gimple_omp_for_set_initial): Likewise.
(gimple_omp_for_initial_ptr): Likewise.
(gimple_omp_for_initial): Likewise.
(gimple_omp_for_set_index): Likewise.
(gimple_omp_for_index_ptr): Likewise.
(gimple_omp_for_index): Likewise.
(gimple_omp_for_collapse): Likewise.
(gimple_omp_for_set_clauses): Likewise.
(gimple_omp_for_clauses_ptr): Likewise.
(gimple_omp_for_clauses): Likewise.
(gimple_omp_critical_set_name): Likewise.
(gimple_omp_critical_name_ptr): Likewise.
(gimple_omp_critical_name): Likewise.
(gimple_eh_dispatch_set_region): Likewise.
(gimple_eh_dispatch_region): Likewise.
(gimple_resx_set_region): Likewise.
(gimple_resx_region): Likewise.
(gimple_phi_set_arg): Likewise.
(gimple_phi_arg): Likewise.
(gimple_phi_set_result): Likewise.
(gimple_phi_result_ptr): Likewise.
(gimple_phi_result): Likewise.
(gimple_phi_num_args): Likewise.
(gimple_phi_capacity): Likewise.
(gimple_wce_set_cleanup): Likewise.
(gimple_wce_cleanup_ptr): Likewise.
(gimple_try_set_cleanup): Likewise.
(gimple_try_set_eval): Likewise.
(gimple_try_cleanup_ptr): Likewise.
(gimple_try_eval_ptr): Likewise.
(gimple_eh_else_set_e_body): Likewise.
(gimple_eh_else_set_n_body): Likewise.
(gimple_eh_else_e_body_ptr): Likewise.
(gimple_eh_else_n_body_ptr): Likewise.
(gimple_eh_must_not_throw_set_fndecl): Likewise.
(gimple_eh_must_not_throw_fndecl): Likewise.
(gimple_eh_filter_set_failure): Likewise.
(gimple_eh_filter_set_types): Likewise.
(gimple_eh_filter_failure_ptr): Likewise.
(gimple_eh_filter_types_ptr): Likewise.
(gimple_eh_filter_types): Likewise.
(gimple_catch_set_handler): Likewise.
(gimple_catch_set_types): Likewise.
(gimple_catch_handler_ptr): Likewise.
(gimple_catch_types_ptr): Likewise.
(gimple_catch_types): Likewise.
(gimple_asm_string): Likewise.
(gimple_asm_set_label_op): Likewise.
(gimple_asm_label_op): Likewise.
(gimple_asm_set_clobber_op): Likewise.
(gimple_asm_clobber_op): Likewise.
(gimple_asm_set_output_op): Likewise.
(gimple_asm_output_op_ptr): Likewise.
(gimple_asm_output_op): Likewise.
(gimple_asm_set_input_op): Likewise.
(gimple_asm_input_op_ptr): Likewise.
(gimple_asm_input_op): Likewise.
(gimple_asm_nlabels): Likewise.
(gimple_asm_nclobbers): Likewise.
(gimple_asm_noutputs): Likewise.
(gimple_asm_ninputs): Likewise.
(gimple_bind_set_block): Likewise.
(gimple_bind_block): Likewise.
(gimple_bind_add_seq): Likewise.
(gimple_bind_add_stmt): Likewise.
(gimple_bind_set_body): Likewise.
(gimple_bind_body_ptr): Likewise.
(gimple_bind_append_vars): Likewise.
(gimple_bind_set_vars): Likewise.
(gimple_bind_vars): Likewise.
(gimple_call_clobber_set): Likewise.
(gimple_call_use_set): Likewise.
(gimple_call_set_internal_fn): Likewise.
(gimple_call_set_fntype): Likewise.
(gimple_call_fntype): Likewise.
(gimple_omp_return_lhs_ptr): Likewise.
(gimple_omp_return_lhs): Likewise.
(gimple_omp_return_set_lhs): Likewise.
(gimple_omp_taskreg_set_data_arg): Likewise.
(gimple_omp_taskreg_data_arg_ptr): Likewise.
(gimple_omp_taskreg_data_arg): Likewise.
(gimple_omp_taskreg_set_child_fn): Likewise.
(gimple_omp_taskreg_child_fn_ptr): Likewise.
(gimple_omp_taskreg_child_fn): Likewise.
(gimple_omp_taskreg_set_clauses): Likewise.
(gimple_omp_taskreg_clauses_ptr): Likewise.
(gimple_omp_taskreg_clauses): Likewise.
(gimple_vuse): Likewise.
(gimple_vdef): Likewise.
(gimple_vuse_ptr): Likewise.
(gimple_vdef_ptr): Likewise.
* tree-inline.c (copy_debug_stmt): Likewise.
* tree-phinodes.c (make_phi_node): Likewise.
* gimple.h (is_a_helper <const gimple_statement_with_ops>::test): New.
(is_a_helper <gimple_statement_with_ops>::test): New.
(is_a_helper <const gimple_statement_with_memory_ops>::test): New.
(is_a_helper <gimple_statement_with_memory_ops>::test): New.
* gimple-streamer-in.c (input_gimple_stmt): Port from union
access to use of as_a.
* gimple.c (gimple_build_asm_1): Likewise.
(gimple_build_try): Likewise. Also, return a specific subclass
rather than just gimple.
(gimple_build_resx): Port from union access to use of as_a.
(gimple_build_eh_dispatch): Likewise.
(gimple_build_omp_for): Likewise. Also, convert allocation of iter
now that gengtype no longer provides a typed allocator function.
(gimple_copy): Likewise.
* gimple.h (gimple_build_try): Return a specific subclass rather
than just gimple.
* gimplify.c (gimplify_cleanup_point_expr): Replace union access
with subclass access by making use of new return type of
gimple_build_try.
* tree-phinodes.c: (allocate_phi_node): Return a
"gimple_statement_phi *" rather than just a gimple.
(resize_phi_node): Likewise.
(make_phi_node): Replace union access with subclass access by
making use of new return type of allocate_phi_node.
(reserve_phi_args_for_new_edge): Replace union access with as_a.
(remove_phi_arg_num): Accept a "gimple_statement_phi *" rather
than just a gimple.
(remove_phi_args): Update for change to remove_phi_arg_num.
* gdbhooks.py (GimplePrinter.to_string): Update lookup of
code field to reflect inheritance, rather than embedding of
the base gimple type.
2013-11-19 Richard Biener <rguenther@suse.de>
* cfgloop.h (struct loop_iterator): C++-ify, add constructor

View File

@ -888,7 +888,7 @@ BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
cfg-flags.def cfghooks.h
GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H)
tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h
GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
RECOG_H = recog.h
EMIT_RTL_H = emit-rtl.h

View File

@ -61,9 +61,8 @@ typedef const struct rtvec_def *const_rtvec;
union tree_node;
typedef union tree_node *tree;
typedef const union tree_node *const_tree;
union gimple_statement_d;
typedef union gimple_statement_d *gimple;
typedef const union gimple_statement_d *const_gimple;
typedef struct gimple_statement_base *gimple;
typedef const struct gimple_statement_base *const_gimple;
typedef gimple gimple_seq;
struct gimple_stmt_iterator_d;
typedef struct gimple_stmt_iterator_d gimple_stmt_iterator;

View File

@ -240,7 +240,7 @@ class GimplePrinter:
def to_string (self):
if long(self.gdbval) == 0:
return '<gimple 0x0>'
val_gimple_code = self.gdbval['gsbase']['code']
val_gimple_code = self.gdbval['code']
val_gimple_code_name = gdb.parse_and_eval('gimple_code_name')
val_code_name = val_gimple_code_name[long(val_gimple_code)]
result = '<%s 0x%x' % (val_code_name.string(),

View File

@ -269,10 +269,10 @@ ggc_alloc_cleared_tree_node_stat (size_t s MEM_STAT_DECL)
return (union tree_node *) ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
}
static inline union gimple_statement_d *
ggc_alloc_cleared_gimple_statement_d_stat (size_t s MEM_STAT_DECL)
static inline struct gimple_statement_base *
ggc_alloc_cleared_gimple_statement_stat (size_t s MEM_STAT_DECL)
{
return (union gimple_statement_d *)
return (struct gimple_statement_base *)
ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
}

View File

@ -68,7 +68,7 @@ update_bb_for_stmts (gimple_seq_node first, gimple_seq_node last,
{
gimple_seq_node n;
for (n = first; n; n = n->gsbase.next)
for (n = first; n; n = n->next)
{
gimple_set_bb (n, bb);
if (n == last)
@ -86,7 +86,7 @@ update_call_edge_frequencies (gimple_seq_node first, basic_block bb)
int bb_freq = 0;
gimple_seq_node n;
for (n = first; n ; n = n->gsbase.next)
for (n = first; n ; n = n->next)
if (is_gimple_call (n))
{
struct cgraph_edge *e;
@ -124,7 +124,7 @@ gsi_insert_seq_nodes_before (gimple_stmt_iterator *i,
basic_block bb;
gimple_seq_node cur = i->ptr;
gcc_assert (!cur || cur->gsbase.prev);
gcc_assert (!cur || cur->prev);
if ((bb = gsi_bb (*i)) != NULL)
update_bb_for_stmts (first, last, bb);
@ -132,13 +132,13 @@ gsi_insert_seq_nodes_before (gimple_stmt_iterator *i,
/* Link SEQ before CUR in the sequence. */
if (cur)
{
first->gsbase.prev = cur->gsbase.prev;
if (first->gsbase.prev->gsbase.next)
first->gsbase.prev->gsbase.next = first;
first->prev = cur->prev;
if (first->prev->next)
first->prev->next = first;
else
gimple_seq_set_first (i->seq, first);
last->gsbase.next = cur;
cur->gsbase.prev = last;
last->next = cur;
cur->prev = last;
}
else
{
@ -149,11 +149,11 @@ gsi_insert_seq_nodes_before (gimple_stmt_iterator *i,
labels, so it returns an iterator after the end of the block, and
we need to insert before it; it might be cleaner to add a flag to the
iterator saying whether we are at the start or end of the list). */
last->gsbase.next = NULL;
last->next = NULL;
if (itlast)
{
first->gsbase.prev = itlast;
itlast->gsbase.next = first;
first->prev = itlast;
itlast->next = first;
}
else
gimple_seq_set_first (i->seq, first);
@ -242,7 +242,7 @@ gsi_insert_seq_nodes_after (gimple_stmt_iterator *i,
basic_block bb;
gimple_seq_node cur = i->ptr;
gcc_assert (!cur || cur->gsbase.prev);
gcc_assert (!cur || cur->prev);
/* If the iterator is inside a basic block, we need to update the
basic block information for all the nodes between FIRST and LAST. */
@ -252,20 +252,20 @@ gsi_insert_seq_nodes_after (gimple_stmt_iterator *i,
/* Link SEQ after CUR. */
if (cur)
{
last->gsbase.next = cur->gsbase.next;
if (last->gsbase.next)
last->next = cur->next;
if (last->next)
{
last->gsbase.next->gsbase.prev = last;
last->next->prev = last;
}
else
gimple_seq_set_last (i->seq, last);
first->gsbase.prev = cur;
cur->gsbase.next = first;
first->prev = cur;
cur->next = first;
}
else
{
gcc_assert (!gimple_seq_last (*i->seq));
last->gsbase.next = NULL;
last->next = NULL;
gimple_seq_set_first (i->seq, first);
gimple_seq_set_last (i->seq, last);
}
@ -347,15 +347,15 @@ gsi_split_seq_after (gimple_stmt_iterator i)
cur = i.ptr;
/* How can we possibly split after the end, or before the beginning? */
gcc_assert (cur && cur->gsbase.next);
next = cur->gsbase.next;
gcc_assert (cur && cur->next);
next = cur->next;
pold_seq = i.seq;
gimple_seq_set_first (&new_seq, next);
gimple_seq_set_last (&new_seq, gimple_seq_last (*pold_seq));
gimple_seq_set_last (pold_seq, cur);
cur->gsbase.next = NULL;
cur->next = NULL;
return new_seq;
}
@ -371,17 +371,17 @@ gsi_set_stmt (gimple_stmt_iterator *gsi, gimple stmt)
gimple orig_stmt = gsi_stmt (*gsi);
gimple prev, next;
stmt->gsbase.next = next = orig_stmt->gsbase.next;
stmt->gsbase.prev = prev = orig_stmt->gsbase.prev;
stmt->next = next = orig_stmt->next;
stmt->prev = prev = orig_stmt->prev;
/* Note how we don't clear next/prev of orig_stmt. This is so that
copies of *GSI our callers might still hold (to orig_stmt)
can be advanced as if they too were replaced. */
if (prev->gsbase.next)
prev->gsbase.next = stmt;
if (prev->next)
prev->next = stmt;
else
gimple_seq_set_first (gsi->seq, stmt);
if (next)
next->gsbase.prev = stmt;
next->prev = stmt;
else
gimple_seq_set_last (gsi->seq, stmt);
@ -402,10 +402,10 @@ gsi_split_seq_before (gimple_stmt_iterator *i, gimple_seq *pnew_seq)
/* How can we possibly split after the end? */
gcc_assert (cur);
prev = cur->gsbase.prev;
prev = cur->prev;
old_seq = *i->seq;
if (!prev->gsbase.next)
if (!prev->next)
*i->seq = NULL;
i->seq = pnew_seq;
@ -415,8 +415,8 @@ gsi_split_seq_before (gimple_stmt_iterator *i, gimple_seq *pnew_seq)
/* Cut OLD_SEQ before I. */
gimple_seq_set_last (&old_seq, prev);
if (prev->gsbase.next)
prev->gsbase.next = NULL;
if (prev->next)
prev->next = NULL;
}
@ -576,20 +576,20 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently)
/* Update the iterator and re-wire the links in I->SEQ. */
cur = i->ptr;
next = cur->gsbase.next;
prev = cur->gsbase.prev;
next = cur->next;
prev = cur->prev;
/* See gsi_set_stmt for why we don't reset prev/next of STMT. */
if (next)
/* Cur is not last. */
next->gsbase.prev = prev;
else if (prev->gsbase.next)
next->prev = prev;
else if (prev->next)
/* Cur is last but not first. */
gimple_seq_set_last (i->seq, prev);
if (prev->gsbase.next)
if (prev->next)
/* Cur is not first. */
prev->gsbase.next = next;
prev->next = next;
else
/* Cur is first. */
*i->seq = next;

View File

@ -168,7 +168,7 @@ gsi_end_p (gimple_stmt_iterator i)
static inline bool
gsi_one_before_end_p (gimple_stmt_iterator i)
{
return i.ptr != NULL && i.ptr->gsbase.next == NULL;
return i.ptr != NULL && i.ptr->next == NULL;
}
/* Advance the iterator to the next gimple statement. */
@ -176,7 +176,7 @@ gsi_one_before_end_p (gimple_stmt_iterator i)
static inline void
gsi_next (gimple_stmt_iterator *i)
{
i->ptr = i->ptr->gsbase.next;
i->ptr = i->ptr->next;
}
/* Advance the iterator to the previous gimple statement. */
@ -184,8 +184,8 @@ gsi_next (gimple_stmt_iterator *i)
static inline void
gsi_prev (gimple_stmt_iterator *i)
{
gimple prev = i->ptr->gsbase.prev;
if (prev->gsbase.next)
gimple prev = i->ptr->prev;
if (prev->next)
i->ptr = prev;
else
i->ptr = NULL;

View File

@ -88,13 +88,13 @@ print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
}
DEBUG_FUNCTION void
debug (gimple_statement_d &ref)
debug (gimple_statement_base &ref)
{
print_gimple_stmt (stderr, &ref, 0, 0);
}
DEBUG_FUNCTION void
debug (gimple_statement_d *ptr)
debug (gimple_statement_base *ptr)
{
if (ptr)
debug (*ptr);
@ -1073,7 +1073,7 @@ dump_gimple_eh_dispatch (pretty_printer *buffer, gimple gs, int spc, int flags)
static void
dump_gimple_debug (pretty_printer *buffer, gimple gs, int spc, int flags)
{
switch (gs->gsbase.subcode)
switch (gs->subcode)
{
case GIMPLE_DEBUG_BIND:
if (flags & TDF_RAW)

View File

@ -29,8 +29,8 @@ extern void debug_gimple_stmt (gimple);
extern void debug_gimple_seq (gimple_seq);
extern void print_gimple_seq (FILE *, gimple_seq, int, int);
extern void print_gimple_stmt (FILE *, gimple, int, int);
extern void debug (gimple_statement_d &ref);
extern void debug (gimple_statement_d *ptr);
extern void debug (gimple_statement_base &ref);
extern void debug (gimple_statement_base *ptr);
extern void print_gimple_expr (FILE *, gimple, int, int);
extern void pp_gimple_stmt_1 (pretty_printer *, gimple, int, int);
extern void gimple_dump_bb (FILE *, basic_block, int, int);

View File

@ -108,11 +108,13 @@ static inline use_operand_p
gimple_vuse_op (const_gimple g)
{
struct use_optype_d *ops;
if (!gimple_has_mem_ops (g))
const gimple_statement_with_memory_ops *mem_ops_stmt =
dyn_cast <const gimple_statement_with_memory_ops> (g);
if (!mem_ops_stmt)
return NULL_USE_OPERAND_P;
ops = g->gsops.opbase.use_ops;
ops = mem_ops_stmt->use_ops;
if (ops
&& USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
&& USE_OP_PTR (ops)->use == &mem_ops_stmt->vuse)
return USE_OP_PTR (ops);
return NULL_USE_OPERAND_P;
}
@ -122,10 +124,12 @@ gimple_vuse_op (const_gimple g)
static inline def_operand_p
gimple_vdef_op (gimple g)
{
if (!gimple_has_mem_ops (g))
gimple_statement_with_memory_ops *mem_ops_stmt =
dyn_cast <gimple_statement_with_memory_ops> (g);
if (!mem_ops_stmt)
return NULL_DEF_OPERAND_P;
if (g->gsmembase.vdef)
return &g->gsmembase.vdef;
if (mem_ops_stmt->vdef)
return &mem_ops_stmt->vdef;
return NULL_DEF_OPERAND_P;
}

View File

@ -100,12 +100,12 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
bp = streamer_read_bitpack (ib);
num_ops = bp_unpack_var_len_unsigned (&bp);
stmt = gimple_alloc (code, num_ops);
stmt->gsbase.no_warning = bp_unpack_value (&bp, 1);
stmt->no_warning = bp_unpack_value (&bp, 1);
if (is_gimple_assign (stmt))
stmt->gsbase.nontemporal_move = bp_unpack_value (&bp, 1);
stmt->gsbase.has_volatile_ops = bp_unpack_value (&bp, 1);
stmt->nontemporal_move = bp_unpack_value (&bp, 1);
stmt->has_volatile_ops = bp_unpack_value (&bp, 1);
has_hist = bp_unpack_value (&bp, 1);
stmt->gsbase.subcode = bp_unpack_var_len_unsigned (&bp);
stmt->subcode = bp_unpack_var_len_unsigned (&bp);
/* Read location information. */
gimple_set_location (stmt, stream_input_location (&bp, data_in));
@ -131,13 +131,14 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
case GIMPLE_ASM:
{
/* FIXME lto. Move most of this into a new gimple_asm_set_string(). */
gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (stmt);
tree str;
stmt->gimple_asm.ni = streamer_read_uhwi (ib);
stmt->gimple_asm.no = streamer_read_uhwi (ib);
stmt->gimple_asm.nc = streamer_read_uhwi (ib);
stmt->gimple_asm.nl = streamer_read_uhwi (ib);
asm_stmt->ni = streamer_read_uhwi (ib);
asm_stmt->no = streamer_read_uhwi (ib);
asm_stmt->nc = streamer_read_uhwi (ib);
asm_stmt->nl = streamer_read_uhwi (ib);
str = streamer_read_string_cst (data_in, ib);
stmt->gimple_asm.string = TREE_STRING_POINTER (str);
asm_stmt->string = TREE_STRING_POINTER (str);
}
/* Fallthru */

View File

@ -78,7 +78,7 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1);
hist = gimple_histogram_value (cfun, stmt);
bp_pack_value (&bp, hist != NULL, 1);
bp_pack_var_len_unsigned (&bp, stmt->gsbase.subcode);
bp_pack_var_len_unsigned (&bp, stmt->subcode);
/* Emit location information for the statement. */
stream_output_location (ob, &bp, LOCATION_LOCUS (gimple_location (stmt)));

View File

@ -96,7 +96,7 @@ static const char * const gimple_alloc_kind_names[] = {
static inline void
gimple_set_code (gimple g, enum gimple_code code)
{
g->gsbase.code = code;
g->code = code;
}
/* Return the number of bytes needed to hold a GIMPLE statement with
@ -128,13 +128,13 @@ gimple_alloc_stat (enum gimple_code code, unsigned num_ops MEM_STAT_DECL)
gimple_alloc_sizes[(int) kind] += size;
}
stmt = ggc_alloc_cleared_gimple_statement_d_stat (size PASS_MEM_STAT);
stmt = ggc_alloc_cleared_gimple_statement_stat (size PASS_MEM_STAT);
gimple_set_code (stmt, code);
gimple_set_num_ops (stmt, num_ops);
/* Do not call gimple_set_modified here as it has other side
effects and this tuple is still not completely built. */
stmt->gsbase.modified = 1;
stmt->modified = 1;
gimple_init_singleton (stmt);
return stmt;
@ -148,7 +148,7 @@ gimple_set_subcode (gimple g, unsigned subcode)
/* We only have 16 bits for the RHS code. Assert that we are not
overflowing it. */
gcc_assert (subcode < (1 << 16));
g->gsbase.subcode = subcode;
g->subcode = subcode;
}
@ -283,7 +283,7 @@ static inline gimple
gimple_build_call_internal_1 (enum internal_fn fn, unsigned nargs)
{
gimple s = gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK, nargs + 3);
s->gsbase.subcode |= GF_CALL_INTERNAL;
s->subcode |= GF_CALL_INTERNAL;
gimple_call_set_internal_fn (s, fn);
gimple_call_reset_alias_info (s);
return s;
@ -533,21 +533,22 @@ static inline gimple
gimple_build_asm_1 (const char *string, unsigned ninputs, unsigned noutputs,
unsigned nclobbers, unsigned nlabels)
{
gimple p;
gimple_statement_asm *p;
int size = strlen (string);
/* ASMs with labels cannot have outputs. This should have been
enforced by the front end. */
gcc_assert (nlabels == 0 || noutputs == 0);
p = gimple_build_with_ops (GIMPLE_ASM, ERROR_MARK,
ninputs + noutputs + nclobbers + nlabels);
p = as_a <gimple_statement_asm> (
gimple_build_with_ops (GIMPLE_ASM, ERROR_MARK,
ninputs + noutputs + nclobbers + nlabels));
p->gimple_asm.ni = ninputs;
p->gimple_asm.no = noutputs;
p->gimple_asm.nc = nclobbers;
p->gimple_asm.nl = nlabels;
p->gimple_asm.string = ggc_alloc_string (string, size);
p->ni = ninputs;
p->no = noutputs;
p->nc = nclobbers;
p->nl = nlabels;
p->string = ggc_alloc_string (string, size);
if (GATHER_STATISTICS)
gimple_alloc_sizes[(int) gimple_alloc_kind (GIMPLE_ASM)] += size;
@ -659,14 +660,14 @@ gimple_build_eh_else (gimple_seq n_body, gimple_seq e_body)
KIND is either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY depending on
whether this is a try/catch or a try/finally respectively. */
gimple
gimple_statement_try *
gimple_build_try (gimple_seq eval, gimple_seq cleanup,
enum gimple_try_flags kind)
{
gimple p;
gimple_statement_try *p;
gcc_assert (kind == GIMPLE_TRY_CATCH || kind == GIMPLE_TRY_FINALLY);
p = gimple_alloc (GIMPLE_TRY, 0);
p = as_a <gimple_statement_try> (gimple_alloc (GIMPLE_TRY, 0));
gimple_set_subcode (p, kind);
if (eval)
gimple_try_set_eval (p, eval);
@ -696,8 +697,10 @@ gimple_build_wce (gimple_seq cleanup)
gimple
gimple_build_resx (int region)
{
gimple p = gimple_build_with_ops (GIMPLE_RESX, ERROR_MARK, 0);
p->gimple_eh_ctrl.region = region;
gimple_statement_eh_ctrl *p =
as_a <gimple_statement_eh_ctrl> (
gimple_build_with_ops (GIMPLE_RESX, ERROR_MARK, 0));
p->region = region;
return p;
}
@ -744,8 +747,10 @@ gimple_build_switch (tree index, tree default_label, vec<tree> args)
gimple
gimple_build_eh_dispatch (int region)
{
gimple p = gimple_build_with_ops (GIMPLE_EH_DISPATCH, ERROR_MARK, 0);
p->gimple_eh_ctrl.region = region;
gimple_statement_eh_ctrl *p =
as_a <gimple_statement_eh_ctrl> (
gimple_build_with_ops (GIMPLE_EH_DISPATCH, ERROR_MARK, 0));
p->region = region;
return p;
}
@ -819,14 +824,17 @@ gimple
gimple_build_omp_for (gimple_seq body, int kind, tree clauses, size_t collapse,
gimple_seq pre_body)
{
gimple p = gimple_alloc (GIMPLE_OMP_FOR, 0);
gimple_statement_omp_for *p =
as_a <gimple_statement_omp_for> (gimple_alloc (GIMPLE_OMP_FOR, 0));
if (body)
gimple_omp_set_body (p, body);
gimple_omp_for_set_clauses (p, clauses);
gimple_omp_for_set_kind (p, kind);
p->gimple_omp_for.collapse = collapse;
p->gimple_omp_for.iter
= ggc_alloc_cleared_vec_gimple_omp_for_iter (collapse);
p->collapse = collapse;
p->iter = static_cast <struct gimple_omp_for_iter *> (
ggc_internal_cleared_vec_alloc_stat (sizeof (*p->iter),
collapse MEM_STAT_INFO));
if (pre_body)
gimple_omp_for_set_pre_body (p, pre_body);
@ -1114,8 +1122,8 @@ gimple_check_failed (const_gimple gs, const char *file, int line,
gimple_code_name[code],
get_tree_code_name (subcode),
gimple_code_name[gimple_code (gs)],
gs->gsbase.subcode > 0
? get_tree_code_name ((enum tree_code) gs->gsbase.subcode)
gs->subcode > 0
? get_tree_code_name ((enum tree_code) gs->subcode)
: "",
function, trim_filename (file), line);
}
@ -1309,7 +1317,7 @@ gimple_call_flags (const_gimple stmt)
else
flags = flags_from_decl_or_type (gimple_call_fntype (stmt));
if (stmt->gsbase.subcode & GF_CALL_NOTHROW)
if (stmt->subcode & GF_CALL_NOTHROW)
flags |= ECF_NOTHROW;
return flags;
@ -1450,7 +1458,7 @@ gimple_assign_unary_nop_p (gimple gs)
void
gimple_set_bb (gimple stmt, basic_block bb)
{
stmt->gsbase.bb = bb;
stmt->bb = bb;
/* If the statement is a label, add the label to block-to-labels map
so that we can speed up edge creation for GIMPLE_GOTOs. */
@ -1645,9 +1653,15 @@ gimple_copy (gimple stmt)
gimple_omp_for_set_pre_body (copy, new_seq);
t = unshare_expr (gimple_omp_for_clauses (stmt));
gimple_omp_for_set_clauses (copy, t);
copy->gimple_omp_for.iter
= ggc_alloc_vec_gimple_omp_for_iter
(gimple_omp_for_collapse (stmt));
{
gimple_statement_omp_for *omp_for_copy =
as_a <gimple_statement_omp_for> (copy);
omp_for_copy->iter =
static_cast <struct gimple_omp_for_iter *> (
ggc_internal_vec_alloc_stat (sizeof (struct gimple_omp_for_iter),
gimple_omp_for_collapse (stmt)
MEM_STAT_INFO));
}
for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
{
gimple_omp_for_set_cond (copy, i,

File diff suppressed because it is too large Load Diff

View File

@ -5009,7 +5009,7 @@ gimplify_cleanup_point_expr (tree *expr_p, gimple_seq *pre_p)
}
else
{
gimple gtry;
gimple_statement_try *gtry;
gimple_seq seq;
enum gimple_try_flags kind;
@ -5023,7 +5023,7 @@ gimplify_cleanup_point_expr (tree *expr_p, gimple_seq *pre_p)
/* Do not use gsi_replace here, as it may scan operands.
We want to do a simple structural modification only. */
gsi_set_stmt (&iter, gtry);
iter = gsi_start (gtry->gimple_try.eval);
iter = gsi_start (gtry->eval);
}
}
else

View File

@ -1013,7 +1013,7 @@ helper_const_non_const_cast (const char *p)
#define CONST_CAST_TREE(X) CONST_CAST (union tree_node *, (X))
#define CONST_CAST_RTX(X) CONST_CAST (struct rtx_def *, (X))
#define CONST_CAST_BB(X) CONST_CAST (struct basic_block_def *, (X))
#define CONST_CAST_GIMPLE(X) CONST_CAST (union gimple_statement_d *, (X))
#define CONST_CAST_GIMPLE(X) CONST_CAST (struct gimple_statement_base *, (X))
/* Activate certain diagnostics as warnings (not errors via the
-Werror flag). */

View File

@ -2635,7 +2635,7 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
&& TREE_CODE ((**debug_args)[i + 1]) == DEBUG_EXPR_DECL)
{
t = (**debug_args)[i + 1];
stmt->gsbase.subcode = GIMPLE_DEBUG_BIND;
stmt->subcode = GIMPLE_DEBUG_BIND;
gimple_debug_bind_set_value (stmt, t);
break;
}

View File

@ -94,10 +94,10 @@ phinodes_print_statistics (void)
happens to contain a PHI node with LEN arguments or more, return
that one. */
static inline gimple
static inline gimple_statement_phi *
allocate_phi_node (size_t len)
{
gimple phi;
gimple_statement_phi *phi;
size_t bucket = NUM_BUCKETS - 2;
size_t size = sizeof (struct gimple_statement_phi)
+ (len - 1) * sizeof (struct phi_arg_d);
@ -112,7 +112,7 @@ allocate_phi_node (size_t len)
&& gimple_phi_capacity ((*free_phinodes[bucket])[0]) >= len)
{
free_phinode_count--;
phi = free_phinodes[bucket]->pop ();
phi = as_a <gimple_statement_phi> (free_phinodes[bucket]->pop ());
if (free_phinodes[bucket]->is_empty ())
vec_free (free_phinodes[bucket]);
if (GATHER_STATISTICS)
@ -120,7 +120,8 @@ allocate_phi_node (size_t len)
}
else
{
phi = ggc_alloc_gimple_statement_d (size);
phi = static_cast <gimple_statement_phi *> (
ggc_internal_alloc_stat (size MEM_STAT_INFO));
if (GATHER_STATISTICS)
{
enum gimple_alloc_kind kind = gimple_alloc_kind (GIMPLE_PHI);
@ -172,7 +173,7 @@ ideal_phi_node_len (int len)
static gimple
make_phi_node (tree var, int len)
{
gimple phi;
gimple_statement_phi *phi;
int capacity, i;
capacity = ideal_phi_node_len (len);
@ -185,10 +186,10 @@ make_phi_node (tree var, int len)
memset (phi, 0, (sizeof (struct gimple_statement_phi)
- sizeof (struct phi_arg_d)
+ sizeof (struct phi_arg_d) * len));
phi->gsbase.code = GIMPLE_PHI;
phi->code = GIMPLE_PHI;
gimple_init_singleton (phi);
phi->gimple_phi.nargs = len;
phi->gimple_phi.capacity = capacity;
phi->nargs = len;
phi->capacity = capacity;
if (!var)
;
else if (TREE_CODE (var) == SSA_NAME)
@ -237,11 +238,11 @@ release_phi_node (gimple phi)
/* Resize an existing PHI node. The only way is up. Return the
possibly relocated phi. */
static gimple
resize_phi_node (gimple phi, size_t len)
static gimple_statement_phi *
resize_phi_node (gimple_statement_phi *phi, size_t len)
{
size_t old_size, i;
gimple new_phi;
gimple_statement_phi *new_phi;
gcc_assert (len > gimple_phi_capacity (phi));
@ -264,7 +265,7 @@ resize_phi_node (gimple phi, size_t len)
relink_imm_use_stmt (imm, old_imm, new_phi);
}
new_phi->gimple_phi.capacity = len;
new_phi->capacity = len;
for (i = gimple_phi_num_args (new_phi); i < len; i++)
{
@ -292,11 +293,12 @@ reserve_phi_args_for_new_edge (basic_block bb)
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
gimple_statement_phi *stmt =
as_a <gimple_statement_phi> (gsi_stmt (gsi));
if (len > gimple_phi_capacity (stmt))
{
gimple new_phi = resize_phi_node (stmt, cap);
gimple_statement_phi *new_phi = resize_phi_node (stmt, cap);
/* The result of the PHI is defined by this PHI node. */
SSA_NAME_DEF_STMT (gimple_phi_result (new_phi)) = new_phi;
@ -316,7 +318,7 @@ reserve_phi_args_for_new_edge (basic_block bb)
SET_PHI_ARG_DEF (stmt, len - 1, NULL_TREE);
gimple_phi_arg_set_location (stmt, len - 1, UNKNOWN_LOCATION);
stmt->gimple_phi.nargs++;
stmt->nargs++;
}
}
@ -392,7 +394,7 @@ add_phi_arg (gimple phi, tree def, edge e, source_location locus)
is consistent with how we remove an edge from the edge vector. */
static void
remove_phi_arg_num (gimple phi, int i)
remove_phi_arg_num (gimple_statement_phi *phi, int i)
{
int num_elem = gimple_phi_num_args (phi);
@ -419,7 +421,7 @@ remove_phi_arg_num (gimple phi, int i)
/* Shrink the vector and return. Note that we do not have to clear
PHI_ARG_DEF because the garbage collector will not look at those
elements beyond the first PHI_NUM_ARGS elements of the array. */
phi->gimple_phi.nargs--;
phi->nargs--;
}
@ -431,7 +433,8 @@ remove_phi_args (edge e)
gimple_stmt_iterator gsi;
for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
remove_phi_arg_num (gsi_stmt (gsi), e->dest_idx);
remove_phi_arg_num (as_a <gimple_statement_phi> (gsi_stmt (gsi)),
e->dest_idx);
}

View File

@ -1766,7 +1766,7 @@ evaluate_stmt (gimple stmt)
return val;
}
typedef hash_table <pointer_hash <gimple_statement_d> > gimple_htab;
typedef hash_table <pointer_hash <gimple_statement_base> > gimple_htab;
/* Given a BUILT_IN_STACK_SAVE value SAVED_VAL, insert a clobber of VAR before
each matching BUILT_IN_STACK_RESTORE. Mark visited phis in VISITED. */