+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
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
+#include "is-a.h"
typedef gimple gimple_seq_node;
/* Data structure definitions for GIMPLE tuples. NOTE: word markers
are for 64 bit hosts. */
-struct GTY((chain_next ("%h.next"))) gimple_statement_base {
+struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
+ chain_next ("%h.next"), variable_size))
+ gimple_statement_base
+{
/* [ WORD 1 ]
Main identifying code for a tuple. */
ENUM_BITFIELD(gimple_code) code : 8;
/* Base structure for tuples with operands. */
-struct GTY(()) gimple_statement_with_ops_base
+/* This gimple subclass has no tag value. */
+struct GTY(())
+ gimple_statement_with_ops_base : public gimple_statement_base
{
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
SSA operand vectors. NOTE: It should be possible to
/* Statements that take register operands. */
-struct GTY(()) gimple_statement_with_ops
+struct GTY((tag("GSS_WITH_OPS")))
+ gimple_statement_with_ops : public gimple_statement_with_ops_base
{
- /* [ WORD 1-7 ] */
- struct gimple_statement_with_ops_base opbase;
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* Base for statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_with_memory_ops_base
+struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
+ gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
{
- /* [ WORD 1-7 ] */
- struct gimple_statement_with_ops_base opbase;
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8-9 ]
Virtual operands for this statement. The GC will pick them
/* Statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_with_memory_ops
+struct GTY((tag("GSS_WITH_MEM_OPS")))
+ gimple_statement_with_memory_ops :
+ public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* Call statements that take both memory and register operands. */
-struct GTY(()) gimple_statement_call
+struct GTY((tag("GSS_CALL")))
+ gimple_statement_call : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10-13 ] */
struct pt_solution call_used;
struct pt_solution call_clobbered;
/* [ WORD 14 ] */
- union GTY ((desc ("%1.membase.opbase.gsbase.subcode & GF_CALL_INTERNAL"))) {
+ union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
tree GTY ((tag ("0"))) fntype;
enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
} u;
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* OpenMP statements (#pragma omp). */
-struct GTY(()) gimple_statement_omp {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP")))
+ gimple_statement_omp : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
gimple_seq body;
/* GIMPLE_BIND */
-struct GTY(()) gimple_statement_bind {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_BIND")))
+ gimple_statement_bind : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Variables declared in this scope. */
/* GIMPLE_CATCH */
-struct GTY(()) gimple_statement_catch {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_CATCH")))
+ gimple_statement_catch : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree types;
/* GIMPLE_EH_FILTER */
-struct GTY(()) gimple_statement_eh_filter {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_FILTER")))
+ gimple_statement_eh_filter : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Filter types. */
/* GIMPLE_EH_ELSE */
-struct GTY(()) gimple_statement_eh_else {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_ELSE")))
+ gimple_statement_eh_else : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7,8 ] */
gimple_seq n_body, e_body;
/* GIMPLE_EH_MUST_NOT_THROW */
-struct GTY(()) gimple_statement_eh_mnt {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_EH_MNT")))
+ gimple_statement_eh_mnt : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] Abort function decl. */
tree fndecl;
/* GIMPLE_PHI */
-struct GTY(()) gimple_statement_phi {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_PHI")))
+ gimple_statement_phi : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
unsigned capacity;
/* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
-struct GTY(()) gimple_statement_eh_ctrl
+struct GTY((tag("GSS_EH_CTRL")))
+ gimple_statement_eh_ctrl : public gimple_statement_base
{
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Exception region number. */
/* GIMPLE_TRY */
-struct GTY(()) gimple_statement_try {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_TRY")))
+ gimple_statement_try : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ]
Expression to evaluate. */
/* GIMPLE_WITH_CLEANUP_EXPR */
-struct GTY(()) gimple_statement_wce {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_WCE")))
+ gimple_statement_wce : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
executed if an exception is thrown, not on normal exit of its
/* GIMPLE_ASM */
-struct GTY(()) gimple_statement_asm
+struct GTY((tag("GSS_ASM")))
+ gimple_statement_asm : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base membase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ]
__asm__ statement. */
Operand vector. NOTE! This must always be the last field
of this structure. In particular, this means that this
structure cannot be embedded inside another one. */
- tree GTY((length ("%h.membase.opbase.gsbase.num_ops"))) op[1];
+ tree GTY((length ("%h.num_ops"))) op[1];
};
/* GIMPLE_OMP_CRITICAL */
-struct GTY(()) gimple_statement_omp_critical {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_CRITICAL")))
+ gimple_statement_omp_critical : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Critical section name. */
/* GIMPLE_OMP_FOR */
-struct GTY(()) gimple_statement_omp_for {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_FOR")))
+ gimple_statement_omp_for : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
/* GIMPLE_OMP_PARALLEL */
-struct GTY(()) gimple_statement_omp_parallel {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_PARALLEL")))
+ gimple_statement_omp_parallel : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ]
Clauses. */
/* GIMPLE_OMP_TASK */
-struct GTY(()) gimple_statement_omp_task {
- /* [ WORD 1-10 ] */
- struct gimple_statement_omp_parallel par;
+struct GTY((tag("GSS_OMP_TASK")))
+ gimple_statement_omp_task : public gimple_statement_omp_parallel
+{
+ /* [ WORD 1-10 ] : base class */
/* [ WORD 11 ]
Child function holding firstprivate initialization if needed. */
/* GIMPLE_OMP_SECTIONS */
-struct GTY(()) gimple_statement_omp_sections {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_SECTIONS")))
+ gimple_statement_omp_sections : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 8 ] */
tree clauses;
Note: This does not inherit from gimple_statement_omp, because we
do not need the body field. */
-struct GTY(()) gimple_statement_omp_continue {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_CONTINUE")))
+ gimple_statement_omp_continue : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree control_def;
/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS */
-struct GTY(()) gimple_statement_omp_single {
- /* [ WORD 1-7 ] */
- struct gimple_statement_omp omp;
+struct GTY((tag("GSS_OMP_SINGLE")))
+ gimple_statement_omp_single : public gimple_statement_omp
+{
+ /* [ WORD 1-7 ] : base class */
/* [ WORD 7 ] */
tree clauses;
Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
contains a sequence, which we don't need here. */
-struct GTY(()) gimple_statement_omp_atomic_load {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
+ gimple_statement_omp_atomic_load : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7-8 ] */
tree rhs, lhs;
/* GIMPLE_OMP_ATOMIC_STORE.
See note on GIMPLE_OMP_ATOMIC_LOAD. */
-struct GTY(()) gimple_statement_omp_atomic_store {
- /* [ WORD 1-6 ] */
- struct gimple_statement_base gsbase;
+struct GTY((tag("GSS_OMP_ATOMIC_STORE")))
+ gimple_statement_omp_atomic_store : public gimple_statement_base
+{
+ /* [ WORD 1-6 ] : base class */
/* [ WORD 7 ] */
tree val;
likely because it is guaranteed to go irrevocable upon entry. */
#define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
-struct GTY(()) gimple_statement_transaction
+struct GTY((tag("GSS_TRANSACTION")))
+ gimple_statement_transaction : public gimple_statement_with_memory_ops_base
{
- /* [ WORD 1-9 ] */
- struct gimple_statement_with_memory_ops_base gsbase;
+ /* [ WORD 1-9 ] : base class */
/* [ WORD 10 ] */
gimple_seq body;
};
#undef DEFGSSTRUCT
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_asm>::test (gimple gs)
+{
+ return gs->code == GIMPLE_ASM;
+}
-/* Define the overall contents of a gimple tuple. It may be any of the
- structures declared above for various types of tuples. */
-
-union GTY ((desc ("gimple_statement_structure (&%h)"),
- chain_next ("%h.gsbase.next"), variable_size)) gimple_statement_d {
- struct gimple_statement_base GTY ((tag ("GSS_BASE"))) gsbase;
- struct gimple_statement_with_ops GTY ((tag ("GSS_WITH_OPS"))) gsops;
- struct gimple_statement_with_memory_ops_base GTY ((tag ("GSS_WITH_MEM_OPS_BASE"))) gsmembase;
- struct gimple_statement_with_memory_ops GTY ((tag ("GSS_WITH_MEM_OPS"))) gsmem;
- struct gimple_statement_call GTY ((tag ("GSS_CALL"))) gimple_call;
- struct gimple_statement_omp GTY ((tag ("GSS_OMP"))) omp;
- struct gimple_statement_bind GTY ((tag ("GSS_BIND"))) gimple_bind;
- struct gimple_statement_catch GTY ((tag ("GSS_CATCH"))) gimple_catch;
- struct gimple_statement_eh_filter GTY ((tag ("GSS_EH_FILTER"))) gimple_eh_filter;
- struct gimple_statement_eh_mnt GTY ((tag ("GSS_EH_MNT"))) gimple_eh_mnt;
- struct gimple_statement_eh_else GTY ((tag ("GSS_EH_ELSE"))) gimple_eh_else;
- struct gimple_statement_phi GTY ((tag ("GSS_PHI"))) gimple_phi;
- struct gimple_statement_eh_ctrl GTY ((tag ("GSS_EH_CTRL"))) gimple_eh_ctrl;
- struct gimple_statement_try GTY ((tag ("GSS_TRY"))) gimple_try;
- struct gimple_statement_wce GTY ((tag ("GSS_WCE"))) gimple_wce;
- struct gimple_statement_asm GTY ((tag ("GSS_ASM"))) gimple_asm;
- struct gimple_statement_omp_critical GTY ((tag ("GSS_OMP_CRITICAL"))) gimple_omp_critical;
- struct gimple_statement_omp_for GTY ((tag ("GSS_OMP_FOR"))) gimple_omp_for;
- struct gimple_statement_omp_parallel GTY ((tag ("GSS_OMP_PARALLEL"))) gimple_omp_parallel;
- struct gimple_statement_omp_task GTY ((tag ("GSS_OMP_TASK"))) gimple_omp_task;
- struct gimple_statement_omp_sections GTY ((tag ("GSS_OMP_SECTIONS"))) gimple_omp_sections;
- struct gimple_statement_omp_single GTY ((tag ("GSS_OMP_SINGLE"))) gimple_omp_single;
- struct gimple_statement_omp_continue GTY ((tag ("GSS_OMP_CONTINUE"))) gimple_omp_continue;
- struct gimple_statement_omp_atomic_load GTY ((tag ("GSS_OMP_ATOMIC_LOAD"))) gimple_omp_atomic_load;
- struct gimple_statement_omp_atomic_store GTY ((tag ("GSS_OMP_ATOMIC_STORE"))) gimple_omp_atomic_store;
- struct gimple_statement_transaction GTY((tag ("GSS_TRANSACTION"))) gimple_transaction;
-};
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_bind>::test (gimple gs)
+{
+ return gs->code == GIMPLE_BIND;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_call>::test (gimple gs)
+{
+ return gs->code == GIMPLE_CALL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_catch>::test (gimple gs)
+{
+ return gs->code == GIMPLE_CATCH;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_eh_ctrl>::test (gimple gs)
+{
+ return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_eh_else>::test (gimple gs)
+{
+ return gs->code == GIMPLE_EH_ELSE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_eh_filter>::test (gimple gs)
+{
+ return gs->code == GIMPLE_EH_FILTER;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_eh_mnt>::test (gimple gs)
+{
+ return gs->code == GIMPLE_EH_MUST_NOT_THROW;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_atomic_load>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_atomic_store>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_continue>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_CONTINUE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_critical>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_CRITICAL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_for>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_FOR;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_parallel>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_sections>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_SECTIONS;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_single>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_omp_task>::test (gimple gs)
+{
+ return gs->code == GIMPLE_OMP_TASK;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_phi>::test (gimple gs)
+{
+ return gs->code == GIMPLE_PHI;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_transaction>::test (gimple gs)
+{
+ return gs->code == GIMPLE_TRANSACTION;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_try>::test (gimple gs)
+{
+ return gs->code == GIMPLE_TRY;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_wce>::test (gimple gs)
+{
+ return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_asm>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_ASM;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_bind>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_BIND;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_call>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_CALL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_catch>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_CATCH;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_eh_ctrl>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_RESX || gs->code == GIMPLE_EH_DISPATCH;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_eh_filter>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_EH_FILTER;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_atomic_load>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_atomic_store>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_ATOMIC_STORE || gs->code == GIMPLE_OMP_RETURN;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_continue>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_CONTINUE;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_critical>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_CRITICAL;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_for>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_FOR;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_parallel>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK || gs->code == GIMPLE_OMP_TARGET;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_sections>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_SECTIONS;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_single>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_SINGLE || gs->code == GIMPLE_OMP_TEAMS;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_omp_task>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_OMP_TASK;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_phi>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_PHI;
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_transaction>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_TRANSACTION;
+}
/* Offset in bytes to the location of the operand vector.
Zero if there is no operand vector for this tuple structure. */
gimple gimple_build_eh_filter (tree, gimple_seq);
gimple gimple_build_eh_must_not_throw (tree);
gimple gimple_build_eh_else (gimple_seq, gimple_seq);
-gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
+gimple_statement_try *gimple_build_try (gimple_seq, gimple_seq,
+ enum gimple_try_flags);
gimple gimple_build_wce (gimple_seq);
gimple gimple_build_resx (int);
gimple gimple_build_switch_nlabels (unsigned, tree, tree);
static inline gimple_seq_node
gimple_seq_last (gimple_seq s)
{
- return s ? s->gsbase.prev : NULL;
+ return s ? s->prev : NULL;
}
static inline void
gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
{
- (*ps)->gsbase.prev = last;
+ (*ps)->prev = last;
}
static inline enum gimple_code
gimple_code (const_gimple g)
{
- return g->gsbase.code;
+ return g->code;
}
static inline basic_block
gimple_bb (const_gimple g)
{
- return g->gsbase.bb;
+ return g->bb;
}
static inline tree
gimple_block (const_gimple g)
{
- return LOCATION_BLOCK (g->gsbase.location);
+ return LOCATION_BLOCK (g->location);
}
gimple_set_block (gimple g, tree block)
{
if (block)
- g->gsbase.location =
- COMBINE_LOCATION_DATA (line_table, g->gsbase.location, block);
+ g->location =
+ COMBINE_LOCATION_DATA (line_table, g->location, block);
else
- g->gsbase.location = LOCATION_LOCUS (g->gsbase.location);
+ g->location = LOCATION_LOCUS (g->location);
}
static inline location_t
gimple_location (const_gimple g)
{
- return g->gsbase.location;
+ return g->location;
}
/* Return pointer to location information for statement G. */
static inline const location_t *
gimple_location_ptr (const_gimple g)
{
- return &g->gsbase.location;
+ return &g->location;
}
static inline void
gimple_set_location (gimple g, location_t location)
{
- g->gsbase.location = location;
+ g->location = location;
}
static inline bool
gimple_no_warning_p (const_gimple stmt)
{
- return stmt->gsbase.no_warning;
+ return stmt->no_warning;
}
/* Set the no_warning flag of STMT to NO_WARNING. */
static inline void
gimple_set_no_warning (gimple stmt, bool no_warning)
{
- stmt->gsbase.no_warning = (unsigned) no_warning;
+ stmt->no_warning = (unsigned) no_warning;
}
/* Set the visited status on statement STMT to VISITED_P. */
static inline void
gimple_set_visited (gimple stmt, bool visited_p)
{
- stmt->gsbase.visited = (unsigned) visited_p;
+ stmt->visited = (unsigned) visited_p;
}
static inline bool
gimple_visited_p (gimple stmt)
{
- return stmt->gsbase.visited;
+ return stmt->visited;
}
gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
{
if (val_p)
- stmt->gsbase.plf |= (unsigned int) plf;
+ stmt->plf |= (unsigned int) plf;
else
- stmt->gsbase.plf &= ~((unsigned int) plf);
+ stmt->plf &= ~((unsigned int) plf);
}
static inline unsigned int
gimple_plf (gimple stmt, enum plf_mask plf)
{
- return stmt->gsbase.plf & ((unsigned int) plf);
+ return stmt->plf & ((unsigned int) plf);
}
static inline void
gimple_set_uid (gimple g, unsigned uid)
{
- g->gsbase.uid = uid;
+ g->uid = uid;
}
static inline unsigned
gimple_uid (const_gimple g)
{
- return g->gsbase.uid;
+ return g->uid;
}
static inline void
gimple_init_singleton (gimple g)
{
- g->gsbase.next = NULL;
- g->gsbase.prev = g;
+ g->next = NULL;
+ g->prev = g;
}
return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_with_ops>::test (const_gimple gs)
+{
+ return gimple_has_ops (gs);
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_with_ops>::test (gimple gs)
+{
+ return gimple_has_ops (gs);
+}
/* Return true if GIMPLE statement G has memory operands. */
return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gimple_statement_with_memory_ops>::test (const_gimple gs)
+{
+ return gimple_has_mem_ops (gs);
+}
+
+template <>
+template <>
+inline bool
+is_a_helper <gimple_statement_with_memory_ops>::test (gimple gs)
+{
+ return gimple_has_mem_ops (gs);
+}
/* Return the set of USE operands for statement G. */
static inline struct use_optype_d *
gimple_use_ops (const_gimple g)
{
- if (!gimple_has_ops (g))
+ const gimple_statement_with_ops *ops_stmt =
+ dyn_cast <const gimple_statement_with_ops> (g);
+ if (!ops_stmt)
return NULL;
- return g->gsops.opbase.use_ops;
+ return ops_stmt->use_ops;
}
static inline void
gimple_set_use_ops (gimple g, struct use_optype_d *use)
{
- gcc_gimple_checking_assert (gimple_has_ops (g));
- g->gsops.opbase.use_ops = use;
+ gimple_statement_with_ops *ops_stmt =
+ as_a <gimple_statement_with_ops> (g);
+ ops_stmt->use_ops = use;
}
static inline tree
gimple_vuse (const_gimple g)
{
- 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_TREE;
- return g->gsmembase.vuse;
+ return mem_ops_stmt->vuse;
}
/* Return the single VDEF operand of the statement G. */
static inline tree
gimple_vdef (const_gimple g)
{
- 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_TREE;
- return g->gsmembase.vdef;
+ return mem_ops_stmt->vdef;
}
/* Return the single VUSE operand of the statement G. */
static inline tree *
gimple_vuse_ptr (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;
- return &g->gsmembase.vuse;
+ return &mem_ops_stmt->vuse;
}
/* Return the single VDEF operand of the statement G. */
static inline tree *
gimple_vdef_ptr (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;
- return &g->gsmembase.vdef;
+ return &mem_ops_stmt->vdef;
}
/* Set the single VUSE operand of the statement G. */
static inline void
gimple_set_vuse (gimple g, tree vuse)
{
- gcc_gimple_checking_assert (gimple_has_mem_ops (g));
- g->gsmembase.vuse = vuse;
+ gimple_statement_with_memory_ops *mem_ops_stmt =
+ as_a <gimple_statement_with_memory_ops> (g);
+ mem_ops_stmt->vuse = vuse;
}
/* Set the single VDEF operand of the statement G. */
static inline void
gimple_set_vdef (gimple g, tree vdef)
{
- gcc_gimple_checking_assert (gimple_has_mem_ops (g));
- g->gsmembase.vdef = vdef;
+ gimple_statement_with_memory_ops *mem_ops_stmt =
+ as_a <gimple_statement_with_memory_ops> (g);
+ mem_ops_stmt->vdef = vdef;
}
static inline bool
gimple_modified_p (const_gimple g)
{
- return (gimple_has_ops (g)) ? (bool) g->gsbase.modified : false;
+ return (gimple_has_ops (g)) ? (bool) g->modified : false;
}
gimple_set_modified (gimple s, bool modifiedp)
{
if (gimple_has_ops (s))
- s->gsbase.modified = (unsigned) modifiedp;
+ s->modified = (unsigned) modifiedp;
}
{
enum gimple_code code = gimple_code (stmt);
if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
- return (enum tree_code) stmt->gsbase.subcode;
+ return (enum tree_code) stmt->subcode;
else
{
gcc_gimple_checking_assert (code == GIMPLE_CALL);
gimple_has_volatile_ops (const_gimple stmt)
{
if (gimple_has_mem_ops (stmt))
- return stmt->gsbase.has_volatile_ops;
+ return stmt->has_volatile_ops;
else
return false;
}
gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
{
if (gimple_has_mem_ops (stmt))
- stmt->gsbase.has_volatile_ops = (unsigned) volatilep;
+ stmt->has_volatile_ops = (unsigned) volatilep;
}
/* Return true if STMT is in a transaction. */
{
gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
&& gimple_code (s) <= GIMPLE_OMP_TEAMS);
- return s->gsbase.subcode;
+ return s->subcode;
}
/* Set the subcode for OMP statement S to SUBCODE. */
/* We only have 16 bits for the subcode. Assert that we are not
overflowing it. */
gcc_gimple_checking_assert (subcode < (1 << 16));
- s->gsbase.subcode = subcode;
+ s->subcode = subcode;
}
/* Set the nowait flag on OMP_RETURN statement S. */
gimple_omp_return_set_nowait (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
- s->gsbase.subcode |= GF_OMP_RETURN_NOWAIT;
+ s->subcode |= GF_OMP_RETURN_NOWAIT;
}
static inline void
gimple_omp_return_set_lhs (gimple g, tree lhs)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
- g->gimple_omp_atomic_store.val = lhs;
+ gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <gimple_statement_omp_atomic_store> (g);
+ omp_atomic_store_stmt->val = lhs;
}
static inline tree
gimple_omp_return_lhs (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
- return g->gimple_omp_atomic_store.val;
+ const gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <const gimple_statement_omp_atomic_store> (g);
+ return omp_atomic_store_stmt->val;
}
static inline tree *
gimple_omp_return_lhs_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
- return &g->gimple_omp_atomic_store.val;
+ gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <gimple_statement_omp_atomic_store> (g);
+ return &omp_atomic_store_stmt->val;
}
gimple_omp_section_set_last (gimple g)
{
GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
- g->gsbase.subcode |= GF_OMP_SECTION_LAST;
+ g->subcode |= GF_OMP_SECTION_LAST;
}
{
GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
if (combined_p)
- g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
+ g->subcode |= GF_OMP_PARALLEL_COMBINED;
else
- g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
+ g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
}
{
if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- g->gsbase.subcode |= GF_OMP_ATOMIC_NEED_VALUE;
+ g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
}
{
if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- g->gsbase.subcode |= GF_OMP_ATOMIC_SEQ_CST;
+ g->subcode |= GF_OMP_ATOMIC_SEQ_CST;
}
static inline unsigned
gimple_num_ops (const_gimple gs)
{
- return gs->gsbase.num_ops;
+ return gs->num_ops;
}
static inline void
gimple_set_num_ops (gimple gs, unsigned num_ops)
{
- gs->gsbase.num_ops = num_ops;
+ gs->num_ops = num_ops;
}
gimple_assign_nontemporal_move_p (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gs->gsbase.nontemporal_move;
+ return gs->nontemporal_move;
}
/* Sets nontemporal move flag of GS to NONTEMPORAL. */
gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
{
GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gs->gsbase.nontemporal_move = nontemporal;
+ gs->nontemporal_move = nontemporal;
}
enum tree_code code;
GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- code = (enum tree_code) gs->gsbase.subcode;
+ code = (enum tree_code) gs->subcode;
/* While we initially set subcode to the TREE_CODE of the rhs for
GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
in sync when we rewrite stmts into SSA form or do SSA propagations. */
gimple_assign_set_rhs_code (gimple s, enum tree_code code)
{
GIMPLE_CHECK (s, GIMPLE_ASSIGN);
- s->gsbase.subcode = code;
+ s->subcode = code;
}
gimple_call_internal_p (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_CALL);
- return (gs->gsbase.subcode & GF_CALL_INTERNAL) != 0;
+ return (gs->subcode & GF_CALL_INTERNAL) != 0;
}
gimple_call_with_bounds_p (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_CALL);
- return (gs->gsbase.subcode & GF_CALL_WITH_BOUNDS) != 0;
+ return (gs->subcode & GF_CALL_WITH_BOUNDS) != 0;
}
{
GIMPLE_CHECK (gs, GIMPLE_CALL);
if (with_bounds)
- gs->gsbase.subcode |= GF_CALL_WITH_BOUNDS;
+ gs->subcode |= GF_CALL_WITH_BOUNDS;
else
- gs->gsbase.subcode &= ~GF_CALL_WITH_BOUNDS;
+ gs->subcode &= ~GF_CALL_WITH_BOUNDS;
}
gimple_call_internal_fn (const_gimple gs)
{
gcc_gimple_checking_assert (gimple_call_internal_p (gs));
- return gs->gimple_call.u.internal_fn;
+ return static_cast <const gimple_statement_call *> (gs)->u.internal_fn;
}
static inline tree
gimple_call_fntype (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
+ const gimple_statement_call *call_stmt =
+ as_a <const gimple_statement_call> (gs);
if (gimple_call_internal_p (gs))
return NULL_TREE;
- return gs->gimple_call.u.fntype;
+ return call_stmt->u.fntype;
}
/* Set the type of the function called by GS to FNTYPE. */
static inline void
gimple_call_set_fntype (gimple gs, tree fntype)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
+ gimple_statement_call *call_stmt = as_a <gimple_statement_call> (gs);
gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
- gs->gimple_call.u.fntype = fntype;
+ call_stmt->u.fntype = fntype;
}
static inline void
gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
{
- GIMPLE_CHECK (gs, GIMPLE_CALL);
+ gimple_statement_call *call_stmt = as_a <gimple_statement_call> (gs);
gcc_gimple_checking_assert (gimple_call_internal_p (gs));
- gs->gimple_call.u.internal_fn = fn;
+ call_stmt->u.internal_fn = fn;
}
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (tail_p)
- s->gsbase.subcode |= GF_CALL_TAILCALL;
+ s->subcode |= GF_CALL_TAILCALL;
else
- s->gsbase.subcode &= ~GF_CALL_TAILCALL;
+ s->subcode &= ~GF_CALL_TAILCALL;
}
gimple_call_tail_p (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_CALL);
- return (s->gsbase.subcode & GF_CALL_TAILCALL) != 0;
+ return (s->subcode & GF_CALL_TAILCALL) != 0;
}
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (return_slot_opt_p)
- s->gsbase.subcode |= GF_CALL_RETURN_SLOT_OPT;
+ s->subcode |= GF_CALL_RETURN_SLOT_OPT;
else
- s->gsbase.subcode &= ~GF_CALL_RETURN_SLOT_OPT;
+ s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
}
gimple_call_return_slot_opt_p (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_CALL);
- return (s->gsbase.subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
+ return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
}
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (from_thunk_p)
- s->gsbase.subcode |= GF_CALL_FROM_THUNK;
+ s->subcode |= GF_CALL_FROM_THUNK;
else
- s->gsbase.subcode &= ~GF_CALL_FROM_THUNK;
+ s->subcode &= ~GF_CALL_FROM_THUNK;
}
gimple_call_from_thunk_p (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_CALL);
- return (s->gsbase.subcode & GF_CALL_FROM_THUNK) != 0;
+ return (s->subcode & GF_CALL_FROM_THUNK) != 0;
}
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (pass_arg_pack_p)
- s->gsbase.subcode |= GF_CALL_VA_ARG_PACK;
+ s->subcode |= GF_CALL_VA_ARG_PACK;
else
- s->gsbase.subcode &= ~GF_CALL_VA_ARG_PACK;
+ s->subcode &= ~GF_CALL_VA_ARG_PACK;
}
gimple_call_va_arg_pack_p (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_CALL);
- return (s->gsbase.subcode & GF_CALL_VA_ARG_PACK) != 0;
+ return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
}
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (nothrow_p)
- s->gsbase.subcode |= GF_CALL_NOTHROW;
+ s->subcode |= GF_CALL_NOTHROW;
else
- s->gsbase.subcode &= ~GF_CALL_NOTHROW;
+ s->subcode &= ~GF_CALL_NOTHROW;
}
/* Return true if S is a nothrow call. */
{
GIMPLE_CHECK (s, GIMPLE_CALL);
if (for_var)
- s->gsbase.subcode |= GF_CALL_ALLOCA_FOR_VAR;
+ s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
else
- s->gsbase.subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
+ s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
}
/* Return true of S is a call to builtin_alloca emitted for VLA objects. */
gimple_call_alloca_for_var_p (gimple s)
{
GIMPLE_CHECK (s, GIMPLE_CALL);
- return (s->gsbase.subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
+ return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
}
/* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
{
GIMPLE_CHECK (dest_call, GIMPLE_CALL);
GIMPLE_CHECK (orig_call, GIMPLE_CALL);
- dest_call->gsbase.subcode = orig_call->gsbase.subcode;
+ dest_call->subcode = orig_call->subcode;
}
static inline struct pt_solution *
gimple_call_use_set (gimple call)
{
- GIMPLE_CHECK (call, GIMPLE_CALL);
- return &call->gimple_call.call_used;
+ gimple_statement_call *call_stmt = as_a <gimple_statement_call> (call);
+ return &call_stmt->call_used;
}
static inline struct pt_solution *
gimple_call_clobber_set (gimple call)
{
- GIMPLE_CHECK (call, GIMPLE_CALL);
- return &call->gimple_call.call_clobbered;
+ gimple_statement_call *call_stmt = as_a <gimple_statement_call> (call);
+ return &call_stmt->call_clobbered;
}
gimple_cond_code (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_COND);
- return (enum tree_code) gs->gsbase.subcode;
+ return (enum tree_code) gs->subcode;
}
gimple_cond_set_code (gimple gs, enum tree_code code)
{
GIMPLE_CHECK (gs, GIMPLE_COND);
- gs->gsbase.subcode = code;
+ gs->subcode = code;
}
{
gimple_cond_set_lhs (gs, boolean_true_node);
gimple_cond_set_rhs (gs, boolean_false_node);
- gs->gsbase.subcode = EQ_EXPR;
+ gs->subcode = EQ_EXPR;
}
{
gimple_cond_set_lhs (gs, boolean_true_node);
gimple_cond_set_rhs (gs, boolean_true_node);
- gs->gsbase.subcode = EQ_EXPR;
+ gs->subcode = EQ_EXPR;
}
/* Check if conditional statemente GS is of the form 'if (1 == 1)',
static inline tree
gimple_bind_vars (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- return gs->gimple_bind.vars;
+ const gimple_statement_bind *bind_stmt =
+ as_a <const gimple_statement_bind> (gs);
+ return bind_stmt->vars;
}
static inline void
gimple_bind_set_vars (gimple gs, tree vars)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- gs->gimple_bind.vars = vars;
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ bind_stmt->vars = vars;
}
static inline void
gimple_bind_append_vars (gimple gs, tree vars)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- gs->gimple_bind.vars = chainon (gs->gimple_bind.vars, vars);
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ bind_stmt->vars = chainon (bind_stmt->vars, vars);
}
static inline gimple_seq *
gimple_bind_body_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- return &gs->gimple_bind.body;
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ return &bind_stmt->body;
}
/* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
static inline void
gimple_bind_set_body (gimple gs, gimple_seq seq)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- gs->gimple_bind.body = seq;
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ bind_stmt->body = seq;
}
static inline void
gimple_bind_add_stmt (gimple gs, gimple stmt)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ gimple_seq_add_stmt (&bind_stmt->body, stmt);
}
static inline void
gimple_bind_add_seq (gimple gs, gimple_seq seq)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- gimple_seq_add_seq (&gs->gimple_bind.body, seq);
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
+ gimple_seq_add_seq (&bind_stmt->body, seq);
}
static inline tree
gimple_bind_block (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
- return gs->gimple_bind.block;
+ const gimple_statement_bind *bind_stmt =
+ as_a <const gimple_statement_bind> (gs);
+ return bind_stmt->block;
}
static inline void
gimple_bind_set_block (gimple gs, tree block)
{
- GIMPLE_CHECK (gs, GIMPLE_BIND);
+ gimple_statement_bind *bind_stmt = as_a <gimple_statement_bind> (gs);
gcc_gimple_checking_assert (block == NULL_TREE
|| TREE_CODE (block) == BLOCK);
- gs->gimple_bind.block = block;
+ bind_stmt->block = block;
}
static inline unsigned
gimple_asm_ninputs (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- return gs->gimple_asm.ni;
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ return asm_stmt->ni;
}
static inline unsigned
gimple_asm_noutputs (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- return gs->gimple_asm.no;
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ return asm_stmt->no;
}
static inline unsigned
gimple_asm_nclobbers (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- return gs->gimple_asm.nc;
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ return asm_stmt->nc;
}
/* Return the number of label operands for GIMPLE_ASM GS. */
static inline unsigned
gimple_asm_nlabels (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- return gs->gimple_asm.nl;
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ return asm_stmt->nl;
}
/* Return input operand INDEX of GIMPLE_ASM GS. */
static inline tree
gimple_asm_input_op (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
- return gimple_op (gs, index + gs->gimple_asm.no);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->ni);
+ return gimple_op (gs, index + asm_stmt->no);
}
/* Return a pointer to input operand INDEX of GIMPLE_ASM GS. */
static inline tree *
gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.ni);
- return gimple_op_ptr (gs, index + gs->gimple_asm.no);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->ni);
+ return gimple_op_ptr (gs, index + asm_stmt->no);
}
static inline void
gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.ni
+ gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->ni
&& TREE_CODE (in_op) == TREE_LIST);
- gimple_set_op (gs, index + gs->gimple_asm.no, in_op);
+ gimple_set_op (gs, index + asm_stmt->no, in_op);
}
static inline tree
gimple_asm_output_op (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.no);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->no);
return gimple_op (gs, index);
}
static inline tree *
gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.no);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->no);
return gimple_op_ptr (gs, index);
}
static inline void
gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.no
+ gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->no
&& TREE_CODE (out_op) == TREE_LIST);
gimple_set_op (gs, index, out_op);
}
static inline tree
gimple_asm_clobber_op (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.nc);
- return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->nc);
+ return gimple_op (gs, index + asm_stmt->ni + asm_stmt->no);
}
static inline void
gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.nc
+ gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->nc
&& TREE_CODE (clobber_op) == TREE_LIST);
- gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
+ gimple_set_op (gs, index + asm_stmt->ni + asm_stmt->no, clobber_op);
}
/* Return label operand INDEX of GIMPLE_ASM GS. */
static inline tree
gimple_asm_label_op (const_gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.nl);
- return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->nl);
+ return gimple_op (gs, index + asm_stmt->ni + asm_stmt->nc);
}
/* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM GS. */
static inline void
gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- gcc_gimple_checking_assert (index < gs->gimple_asm.nl
+ gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (gs);
+ gcc_gimple_checking_assert (index < asm_stmt->nl
&& TREE_CODE (label_op) == TREE_LIST);
- gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
+ gimple_set_op (gs, index + asm_stmt->ni + asm_stmt->nc, label_op);
}
/* Return the string representing the assembly instruction in
static inline const char *
gimple_asm_string (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASM);
- return gs->gimple_asm.string;
+ const gimple_statement_asm *asm_stmt =
+ as_a <const gimple_statement_asm> (gs);
+ return asm_stmt->string;
}
gimple_asm_volatile_p (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_ASM);
- return (gs->gsbase.subcode & GF_ASM_VOLATILE) != 0;
+ return (gs->subcode & GF_ASM_VOLATILE) != 0;
}
{
GIMPLE_CHECK (gs, GIMPLE_ASM);
if (volatile_p)
- gs->gsbase.subcode |= GF_ASM_VOLATILE;
+ gs->subcode |= GF_ASM_VOLATILE;
else
- gs->gsbase.subcode &= ~GF_ASM_VOLATILE;
+ gs->subcode &= ~GF_ASM_VOLATILE;
}
{
GIMPLE_CHECK (gs, GIMPLE_ASM);
if (input_p)
- gs->gsbase.subcode |= GF_ASM_INPUT;
+ gs->subcode |= GF_ASM_INPUT;
else
- gs->gsbase.subcode &= ~GF_ASM_INPUT;
+ gs->subcode &= ~GF_ASM_INPUT;
}
gimple_asm_input_p (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_ASM);
- return (gs->gsbase.subcode & GF_ASM_INPUT) != 0;
+ return (gs->subcode & GF_ASM_INPUT) != 0;
}
static inline tree
gimple_catch_types (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_CATCH);
- return gs->gimple_catch.types;
+ const gimple_statement_catch *catch_stmt =
+ as_a <const gimple_statement_catch> (gs);
+ return catch_stmt->types;
}
static inline tree *
gimple_catch_types_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_CATCH);
- return &gs->gimple_catch.types;
+ gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
+ return &catch_stmt->types;
}
static inline gimple_seq *
gimple_catch_handler_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_CATCH);
- return &gs->gimple_catch.handler;
+ gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
+ return &catch_stmt->handler;
}
static inline void
gimple_catch_set_types (gimple gs, tree t)
{
- GIMPLE_CHECK (gs, GIMPLE_CATCH);
- gs->gimple_catch.types = t;
+ gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
+ catch_stmt->types = t;
}
static inline void
gimple_catch_set_handler (gimple gs, gimple_seq handler)
{
- GIMPLE_CHECK (gs, GIMPLE_CATCH);
- gs->gimple_catch.handler = handler;
+ gimple_statement_catch *catch_stmt = as_a <gimple_statement_catch> (gs);
+ catch_stmt->handler = handler;
}
static inline tree
gimple_eh_filter_types (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
- return gs->gimple_eh_filter.types;
+ const gimple_statement_eh_filter *eh_filter_stmt =
+ as_a <const gimple_statement_eh_filter> (gs);
+ return eh_filter_stmt->types;
}
static inline tree *
gimple_eh_filter_types_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
- return &gs->gimple_eh_filter.types;
+ gimple_statement_eh_filter *eh_filter_stmt =
+ as_a <gimple_statement_eh_filter> (gs);
+ return &eh_filter_stmt->types;
}
static inline gimple_seq *
gimple_eh_filter_failure_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
- return &gs->gimple_eh_filter.failure;
+ gimple_statement_eh_filter *eh_filter_stmt =
+ as_a <gimple_statement_eh_filter> (gs);
+ return &eh_filter_stmt->failure;
}
static inline void
gimple_eh_filter_set_types (gimple gs, tree types)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
- gs->gimple_eh_filter.types = types;
+ gimple_statement_eh_filter *eh_filter_stmt =
+ as_a <gimple_statement_eh_filter> (gs);
+ eh_filter_stmt->types = types;
}
static inline void
gimple_eh_filter_set_failure (gimple gs, gimple_seq failure)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_FILTER);
- gs->gimple_eh_filter.failure = failure;
+ gimple_statement_eh_filter *eh_filter_stmt =
+ as_a <gimple_statement_eh_filter> (gs);
+ eh_filter_stmt->failure = failure;
}
/* Get the function decl to be called by the MUST_NOT_THROW region. */
static inline tree
gimple_eh_must_not_throw_fndecl (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
- return gs->gimple_eh_mnt.fndecl;
+ gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt> (gs);
+ return eh_mnt_stmt->fndecl;
}
/* Set the function decl to be called by GS to DECL. */
static inline void
gimple_eh_must_not_throw_set_fndecl (gimple gs, tree decl)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_MUST_NOT_THROW);
- gs->gimple_eh_mnt.fndecl = decl;
+ gimple_statement_eh_mnt *eh_mnt_stmt = as_a <gimple_statement_eh_mnt> (gs);
+ eh_mnt_stmt->fndecl = decl;
}
/* GIMPLE_EH_ELSE accessors. */
static inline gimple_seq *
gimple_eh_else_n_body_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
- return &gs->gimple_eh_else.n_body;
+ gimple_statement_eh_else *eh_else_stmt =
+ as_a <gimple_statement_eh_else> (gs);
+ return &eh_else_stmt->n_body;
}
static inline gimple_seq
static inline gimple_seq *
gimple_eh_else_e_body_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
- return &gs->gimple_eh_else.e_body;
+ gimple_statement_eh_else *eh_else_stmt =
+ as_a <gimple_statement_eh_else> (gs);
+ return &eh_else_stmt->e_body;
}
static inline gimple_seq
static inline void
gimple_eh_else_set_n_body (gimple gs, gimple_seq seq)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
- gs->gimple_eh_else.n_body = seq;
+ gimple_statement_eh_else *eh_else_stmt =
+ as_a <gimple_statement_eh_else> (gs);
+ eh_else_stmt->n_body = seq;
}
static inline void
gimple_eh_else_set_e_body (gimple gs, gimple_seq seq)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_ELSE);
- gs->gimple_eh_else.e_body = seq;
+ gimple_statement_eh_else *eh_else_stmt =
+ as_a <gimple_statement_eh_else> (gs);
+ eh_else_stmt->e_body = seq;
}
/* GIMPLE_TRY accessors. */
gimple_try_kind (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_TRY);
- return (enum gimple_try_flags) (gs->gsbase.subcode & GIMPLE_TRY_KIND);
+ return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
}
gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
|| kind == GIMPLE_TRY_FINALLY);
if (gimple_try_kind (gs) != kind)
- gs->gsbase.subcode = (unsigned int) kind;
+ gs->subcode = (unsigned int) kind;
}
gimple_try_catch_is_cleanup (const_gimple gs)
{
gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
- return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
+ return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
}
static inline gimple_seq *
gimple_try_eval_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_TRY);
- return &gs->gimple_try.eval;
+ gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
+ return &try_stmt->eval;
}
static inline gimple_seq *
gimple_try_cleanup_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_TRY);
- return &gs->gimple_try.cleanup;
+ gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
+ return &try_stmt->cleanup;
}
{
gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
if (catch_is_cleanup)
- g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
+ g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
else
- g->gsbase.subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
+ g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
}
static inline void
gimple_try_set_eval (gimple gs, gimple_seq eval)
{
- GIMPLE_CHECK (gs, GIMPLE_TRY);
- gs->gimple_try.eval = eval;
+ gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
+ try_stmt->eval = eval;
}
static inline void
gimple_try_set_cleanup (gimple gs, gimple_seq cleanup)
{
- GIMPLE_CHECK (gs, GIMPLE_TRY);
- gs->gimple_try.cleanup = cleanup;
+ gimple_statement_try *try_stmt = as_a <gimple_statement_try> (gs);
+ try_stmt->cleanup = cleanup;
}
static inline gimple_seq *
gimple_wce_cleanup_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- return &gs->gimple_wce.cleanup;
+ gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce> (gs);
+ return &wce_stmt->cleanup;
}
static inline void
gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
{
- GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- gs->gimple_wce.cleanup = cleanup;
+ gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce> (gs);
+ wce_stmt->cleanup = cleanup;
}
gimple_wce_cleanup_eh_only (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- return gs->gsbase.subcode != 0;
+ return gs->subcode != 0;
}
gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
{
GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- gs->gsbase.subcode = (unsigned int) eh_only_p;
+ gs->subcode = (unsigned int) eh_only_p;
}
static inline unsigned
gimple_phi_capacity (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- return gs->gimple_phi.capacity;
+ const gimple_statement_phi *phi_stmt =
+ as_a <const gimple_statement_phi> (gs);
+ return phi_stmt->capacity;
}
static inline unsigned
gimple_phi_num_args (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- return gs->gimple_phi.nargs;
+ const gimple_statement_phi *phi_stmt =
+ as_a <const gimple_statement_phi> (gs);
+ return phi_stmt->nargs;
}
static inline tree
gimple_phi_result (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- return gs->gimple_phi.result;
+ const gimple_statement_phi *phi_stmt =
+ as_a <const gimple_statement_phi> (gs);
+ return phi_stmt->result;
}
/* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
static inline tree *
gimple_phi_result_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- return &gs->gimple_phi.result;
+ gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
+ return &phi_stmt->result;
}
/* Set RESULT to be the SSA name created by GIMPLE_PHI GS. */
static inline void
gimple_phi_set_result (gimple gs, tree result)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- gs->gimple_phi.result = result;
+ gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
+ phi_stmt->result = result;
if (result && TREE_CODE (result) == SSA_NAME)
SSA_NAME_DEF_STMT (result) = gs;
}
static inline struct phi_arg_d *
gimple_phi_arg (gimple gs, unsigned index)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
- return &(gs->gimple_phi.args[index]);
+ gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
+ gcc_gimple_checking_assert (index <= phi_stmt->capacity);
+ return &(phi_stmt->args[index]);
}
/* Set PHIARG to be the argument corresponding to incoming edge INDEX
static inline void
gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
{
- GIMPLE_CHECK (gs, GIMPLE_PHI);
- gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
- gs->gimple_phi.args[index] = *phiarg;
+ gimple_statement_phi *phi_stmt = as_a <gimple_statement_phi> (gs);
+ gcc_gimple_checking_assert (index <= phi_stmt->nargs);
+ phi_stmt->args[index] = *phiarg;
}
/* Return the PHI nodes for basic block BB, or NULL if there are no
static inline int
gimple_resx_region (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_RESX);
- return gs->gimple_eh_ctrl.region;
+ const gimple_statement_eh_ctrl *eh_ctrl_stmt =
+ as_a <const gimple_statement_eh_ctrl> (gs);
+ return eh_ctrl_stmt->region;
}
/* Set REGION to be the region number for GIMPLE_RESX GS. */
static inline void
gimple_resx_set_region (gimple gs, int region)
{
- GIMPLE_CHECK (gs, GIMPLE_RESX);
- gs->gimple_eh_ctrl.region = region;
+ gimple_statement_eh_ctrl *eh_ctrl_stmt =
+ as_a <gimple_statement_eh_ctrl> (gs);
+ eh_ctrl_stmt->region = region;
}
/* Return the region number for GIMPLE_EH_DISPATCH GS. */
static inline int
gimple_eh_dispatch_region (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
- return gs->gimple_eh_ctrl.region;
+ const gimple_statement_eh_ctrl *eh_ctrl_stmt =
+ as_a <const gimple_statement_eh_ctrl> (gs);
+ return eh_ctrl_stmt->region;
}
/* Set REGION to be the region number for GIMPLE_EH_DISPATCH GS. */
static inline void
gimple_eh_dispatch_set_region (gimple gs, int region)
{
- GIMPLE_CHECK (gs, GIMPLE_EH_DISPATCH);
- gs->gimple_eh_ctrl.region = region;
+ gimple_statement_eh_ctrl *eh_ctrl_stmt =
+ as_a <gimple_statement_eh_ctrl> (gs);
+ eh_ctrl_stmt->region = region;
}
/* Return the number of labels associated with the switch statement GS. */
gimple_debug_bind_p (const_gimple s)
{
if (is_gimple_debug (s))
- return s->gsbase.subcode == GIMPLE_DEBUG_BIND;
+ return s->subcode == GIMPLE_DEBUG_BIND;
return false;
}
gimple_debug_source_bind_p (const_gimple s)
{
if (is_gimple_debug (s))
- return s->gsbase.subcode == GIMPLE_DEBUG_SOURCE_BIND;
+ return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
return false;
}
static inline gimple_seq *
gimple_omp_body_ptr (gimple gs)
{
- return &gs->omp.body;
+ return &static_cast <gimple_statement_omp *> (gs)->body;
}
/* Return the body for the OMP statement GS. */
static inline void
gimple_omp_set_body (gimple gs, gimple_seq body)
{
- gs->omp.body = body;
+ static_cast <gimple_statement_omp *> (gs)->body = body;
}
static inline tree
gimple_omp_critical_name (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
- return gs->gimple_omp_critical.name;
+ const gimple_statement_omp_critical *omp_critical_stmt =
+ as_a <const gimple_statement_omp_critical> (gs);
+ return omp_critical_stmt->name;
}
static inline tree *
gimple_omp_critical_name_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
- return &gs->gimple_omp_critical.name;
+ gimple_statement_omp_critical *omp_critical_stmt =
+ as_a <gimple_statement_omp_critical> (gs);
+ return &omp_critical_stmt->name;
}
static inline void
gimple_omp_critical_set_name (gimple gs, tree name)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_CRITICAL);
- gs->gimple_omp_critical.name = name;
+ gimple_statement_omp_critical *omp_critical_stmt =
+ as_a <gimple_statement_omp_critical> (gs);
+ omp_critical_stmt->name = name;
}
gimple_omp_for_set_kind (gimple g, int kind)
{
GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
- g->gsbase.subcode = (g->gsbase.subcode & ~GF_OMP_FOR_KIND_MASK)
+ g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
| (kind & GF_OMP_FOR_KIND_MASK);
}
{
GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
if (combined_p)
- g->gsbase.subcode |= GF_OMP_FOR_COMBINED;
+ g->subcode |= GF_OMP_FOR_COMBINED;
else
- g->gsbase.subcode &= ~GF_OMP_FOR_COMBINED;
+ g->subcode &= ~GF_OMP_FOR_COMBINED;
}
{
GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
if (combined_p)
- g->gsbase.subcode |= GF_OMP_FOR_COMBINED_INTO;
+ g->subcode |= GF_OMP_FOR_COMBINED_INTO;
else
- g->gsbase.subcode &= ~GF_OMP_FOR_COMBINED_INTO;
+ g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
}
static inline tree
gimple_omp_for_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- return gs->gimple_omp_for.clauses;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ return omp_for_stmt->clauses;
}
static inline tree *
gimple_omp_for_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- return &gs->gimple_omp_for.clauses;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ return &omp_for_stmt->clauses;
}
static inline void
gimple_omp_for_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gs->gimple_omp_for.clauses = clauses;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ omp_for_stmt->clauses = clauses;
}
static inline size_t
gimple_omp_for_collapse (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- return gs->gimple_omp_for.collapse;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ return omp_for_stmt->collapse;
}
static inline tree
gimple_omp_for_index (const_gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return gs->gimple_omp_for.iter[i].index;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return omp_for_stmt->iter[i].index;
}
static inline tree *
gimple_omp_for_index_ptr (gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return &gs->gimple_omp_for.iter[i].index;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return &omp_for_stmt->iter[i].index;
}
static inline void
gimple_omp_for_set_index (gimple gs, size_t i, tree index)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- gs->gimple_omp_for.iter[i].index = index;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ omp_for_stmt->iter[i].index = index;
}
static inline tree
gimple_omp_for_initial (const_gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return gs->gimple_omp_for.iter[i].initial;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return omp_for_stmt->iter[i].initial;
}
static inline tree *
gimple_omp_for_initial_ptr (gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return &gs->gimple_omp_for.iter[i].initial;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return &omp_for_stmt->iter[i].initial;
}
static inline void
gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- gs->gimple_omp_for.iter[i].initial = initial;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ omp_for_stmt->iter[i].initial = initial;
}
static inline tree
gimple_omp_for_final (const_gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return gs->gimple_omp_for.iter[i].final;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return omp_for_stmt->iter[i].final;
}
static inline tree *
gimple_omp_for_final_ptr (gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return &gs->gimple_omp_for.iter[i].final;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return &omp_for_stmt->iter[i].final;
}
static inline void
gimple_omp_for_set_final (gimple gs, size_t i, tree final)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- gs->gimple_omp_for.iter[i].final = final;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ omp_for_stmt->iter[i].final = final;
}
static inline tree
gimple_omp_for_incr (const_gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return gs->gimple_omp_for.iter[i].incr;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return omp_for_stmt->iter[i].incr;
}
static inline tree *
gimple_omp_for_incr_ptr (gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return &gs->gimple_omp_for.iter[i].incr;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return &omp_for_stmt->iter[i].incr;
}
static inline void
gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- gs->gimple_omp_for.iter[i].incr = incr;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ omp_for_stmt->iter[i].incr = incr;
}
static inline gimple_seq *
gimple_omp_for_pre_body_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- return &gs->gimple_omp_for.pre_body;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ return &omp_for_stmt->pre_body;
}
static inline void
gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gs->gimple_omp_for.pre_body = pre_body;
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
+ omp_for_stmt->pre_body = pre_body;
}
static inline tree
gimple_omp_parallel_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return gs->gimple_omp_parallel.clauses;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->clauses;
}
static inline tree *
gimple_omp_parallel_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return &gs->gimple_omp_parallel.clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->clauses;
}
static inline void
gimple_omp_parallel_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- gs->gimple_omp_parallel.clauses = clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->clauses = clauses;
}
static inline tree
gimple_omp_parallel_child_fn (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return gs->gimple_omp_parallel.child_fn;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->child_fn;
}
/* Return a pointer to the child function used to hold the body of
static inline tree *
gimple_omp_parallel_child_fn_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return &gs->gimple_omp_parallel.child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->child_fn;
}
static inline void
gimple_omp_parallel_set_child_fn (gimple gs, tree child_fn)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- gs->gimple_omp_parallel.child_fn = child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->child_fn = child_fn;
}
static inline tree
gimple_omp_parallel_data_arg (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return gs->gimple_omp_parallel.data_arg;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->data_arg;
}
static inline tree *
gimple_omp_parallel_data_arg_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- return &gs->gimple_omp_parallel.data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->data_arg;
}
static inline void
gimple_omp_parallel_set_data_arg (gimple gs, tree data_arg)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_PARALLEL);
- gs->gimple_omp_parallel.data_arg = data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->data_arg = data_arg;
}
static inline tree
gimple_omp_task_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.clauses;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->clauses;
}
static inline tree *
gimple_omp_task_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.clauses;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->clauses;
}
static inline void
gimple_omp_task_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.clauses = clauses;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->clauses = clauses;
}
static inline tree
gimple_omp_task_child_fn (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.child_fn;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->child_fn;
}
/* Return a pointer to the child function used to hold the body of
static inline tree *
gimple_omp_task_child_fn_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.child_fn;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->child_fn;
}
static inline void
gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.child_fn = child_fn;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->child_fn = child_fn;
}
static inline tree
gimple_omp_task_data_arg (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.data_arg;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->data_arg;
}
static inline tree *
gimple_omp_task_data_arg_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.data_arg;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->data_arg;
}
static inline void
gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.data_arg = data_arg;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->data_arg = data_arg;
}
static inline tree
gimple_omp_taskreg_clauses (const_gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.clauses;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->clauses;
}
static inline tree *
gimple_omp_taskreg_clauses_ptr (gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->clauses;
}
static inline void
gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.clauses = clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->clauses = clauses;
}
static inline tree
gimple_omp_taskreg_child_fn (const_gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.child_fn;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->child_fn;
}
/* Return a pointer to the child function used to hold the body of
static inline tree *
gimple_omp_taskreg_child_fn_ptr (gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->child_fn;
}
static inline void
gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.child_fn = child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->child_fn = child_fn;
}
static inline tree
gimple_omp_taskreg_data_arg (const_gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_parallel.data_arg;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->data_arg;
}
static inline tree *
gimple_omp_taskreg_data_arg_ptr (gimple gs)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_parallel.data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->data_arg;
}
static inline void
gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
{
- if (gimple_code (gs) != GIMPLE_OMP_PARALLEL)
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_parallel.data_arg = data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->data_arg = data_arg;
}
static inline tree
gimple_omp_task_copy_fn (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_task.copy_fn;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->copy_fn;
}
/* Return a pointer to the copy function used to hold the body of
static inline tree *
gimple_omp_task_copy_fn_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_task.copy_fn;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->copy_fn;
}
static inline void
gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_task.copy_fn = copy_fn;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->copy_fn = copy_fn;
}
static inline tree
gimple_omp_task_arg_size (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_task.arg_size;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->arg_size;
}
static inline tree *
gimple_omp_task_arg_size_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_task.arg_size;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->arg_size;
}
static inline void
gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_task.arg_size = arg_size;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->arg_size = arg_size;
}
static inline tree
gimple_omp_task_arg_align (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return gs->gimple_omp_task.arg_align;
+ const gimple_statement_omp_task *omp_task_stmt =
+ as_a <const gimple_statement_omp_task> (gs);
+ return omp_task_stmt->arg_align;
}
static inline tree *
gimple_omp_task_arg_align_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- return &gs->gimple_omp_task.arg_align;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ return &omp_task_stmt->arg_align;
}
static inline void
gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TASK);
- gs->gimple_omp_task.arg_align = arg_align;
+ gimple_statement_omp_task *omp_task_stmt =
+ as_a <gimple_statement_omp_task> (gs);
+ omp_task_stmt->arg_align = arg_align;
}
static inline tree
gimple_omp_single_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
- return gs->gimple_omp_single.clauses;
+ const gimple_statement_omp_single *omp_single_stmt =
+ as_a <const gimple_statement_omp_single> (gs);
+ return omp_single_stmt->clauses;
}
static inline tree *
gimple_omp_single_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
- return &gs->gimple_omp_single.clauses;
+ gimple_statement_omp_single *omp_single_stmt =
+ as_a <gimple_statement_omp_single> (gs);
+ return &omp_single_stmt->clauses;
}
static inline void
gimple_omp_single_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SINGLE);
- gs->gimple_omp_single.clauses = clauses;
+ gimple_statement_omp_single *omp_single_stmt =
+ as_a <gimple_statement_omp_single> (gs);
+ omp_single_stmt->clauses = clauses;
}
static inline tree
gimple_omp_target_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return gs->gimple_omp_parallel.clauses;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->clauses;
}
static inline tree *
gimple_omp_target_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return &gs->gimple_omp_parallel.clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->clauses;
}
static inline void
gimple_omp_target_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- gs->gimple_omp_parallel.clauses = clauses;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->clauses = clauses;
}
gimple_omp_target_set_kind (gimple g, int kind)
{
GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
- g->gsbase.subcode = (g->gsbase.subcode & ~GF_OMP_TARGET_KIND_MASK)
+ g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
| (kind & GF_OMP_TARGET_KIND_MASK);
}
static inline tree
gimple_omp_target_child_fn (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return gs->gimple_omp_parallel.child_fn;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->child_fn;
}
/* Return a pointer to the child function used to hold the body of
static inline tree *
gimple_omp_target_child_fn_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return &gs->gimple_omp_parallel.child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->child_fn;
}
static inline void
gimple_omp_target_set_child_fn (gimple gs, tree child_fn)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- gs->gimple_omp_parallel.child_fn = child_fn;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->child_fn = child_fn;
}
static inline tree
gimple_omp_target_data_arg (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return gs->gimple_omp_parallel.data_arg;
+ const gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <const gimple_statement_omp_parallel> (gs);
+ return omp_parallel_stmt->data_arg;
}
static inline tree *
gimple_omp_target_data_arg_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- return &gs->gimple_omp_parallel.data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ return &omp_parallel_stmt->data_arg;
}
static inline void
gimple_omp_target_set_data_arg (gimple gs, tree data_arg)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TARGET);
- gs->gimple_omp_parallel.data_arg = data_arg;
+ gimple_statement_omp_parallel *omp_parallel_stmt =
+ as_a <gimple_statement_omp_parallel> (gs);
+ omp_parallel_stmt->data_arg = data_arg;
}
static inline tree
gimple_omp_teams_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TEAMS);
- return gs->gimple_omp_single.clauses;
+ const gimple_statement_omp_single *omp_single_stmt =
+ as_a <const gimple_statement_omp_single> (gs);
+ return omp_single_stmt->clauses;
}
static inline tree *
gimple_omp_teams_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TEAMS);
- return &gs->gimple_omp_single.clauses;
+ gimple_statement_omp_single *omp_single_stmt =
+ as_a <gimple_statement_omp_single> (gs);
+ return &omp_single_stmt->clauses;
}
static inline void
gimple_omp_teams_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_TEAMS);
- gs->gimple_omp_single.clauses = clauses;
+ gimple_statement_omp_single *omp_single_stmt =
+ as_a <gimple_statement_omp_single> (gs);
+ omp_single_stmt->clauses = clauses;
}
static inline tree
gimple_omp_sections_clauses (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- return gs->gimple_omp_sections.clauses;
+ const gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <const gimple_statement_omp_sections> (gs);
+ return omp_sections_stmt->clauses;
}
static inline tree *
gimple_omp_sections_clauses_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- return &gs->gimple_omp_sections.clauses;
+ gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <gimple_statement_omp_sections> (gs);
+ return &omp_sections_stmt->clauses;
}
static inline void
gimple_omp_sections_set_clauses (gimple gs, tree clauses)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- gs->gimple_omp_sections.clauses = clauses;
+ gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <gimple_statement_omp_sections> (gs);
+ omp_sections_stmt->clauses = clauses;
}
static inline tree
gimple_omp_sections_control (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- return gs->gimple_omp_sections.control;
+ const gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <const gimple_statement_omp_sections> (gs);
+ return omp_sections_stmt->control;
}
static inline tree *
gimple_omp_sections_control_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- return &gs->gimple_omp_sections.control;
+ gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <gimple_statement_omp_sections> (gs);
+ return &omp_sections_stmt->control;
}
static inline void
gimple_omp_sections_set_control (gimple gs, tree control)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_SECTIONS);
- gs->gimple_omp_sections.control = control;
+ gimple_statement_omp_sections *omp_sections_stmt =
+ as_a <gimple_statement_omp_sections> (gs);
+ omp_sections_stmt->control = control;
}
static inline void
gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
+ gimple_statement_omp_for *omp_for_stmt =
+ as_a <gimple_statement_omp_for> (gs);
gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
- && i < gs->gimple_omp_for.collapse);
- gs->gimple_omp_for.iter[i].cond = cond;
+ && i < omp_for_stmt->collapse);
+ omp_for_stmt->iter[i].cond = cond;
}
static inline enum tree_code
gimple_omp_for_cond (const_gimple gs, size_t i)
{
- GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
- gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
- return gs->gimple_omp_for.iter[i].cond;
+ const gimple_statement_omp_for *omp_for_stmt =
+ as_a <const gimple_statement_omp_for> (gs);
+ gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
+ return omp_for_stmt->iter[i].cond;
}
static inline void
gimple_omp_atomic_store_set_val (gimple g, tree val)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- g->gimple_omp_atomic_store.val = val;
+ gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <gimple_statement_omp_atomic_store> (g);
+ omp_atomic_store_stmt->val = val;
}
static inline tree
gimple_omp_atomic_store_val (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- return g->gimple_omp_atomic_store.val;
+ const gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <const gimple_statement_omp_atomic_store> (g);
+ return omp_atomic_store_stmt->val;
}
static inline tree *
gimple_omp_atomic_store_val_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- return &g->gimple_omp_atomic_store.val;
+ gimple_statement_omp_atomic_store *omp_atomic_store_stmt =
+ as_a <gimple_statement_omp_atomic_store> (g);
+ return &omp_atomic_store_stmt->val;
}
static inline void
gimple_omp_atomic_load_set_lhs (gimple g, tree lhs)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- g->gimple_omp_atomic_load.lhs = lhs;
+ gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <gimple_statement_omp_atomic_load> (g);
+ omp_atomic_load_stmt->lhs = lhs;
}
static inline tree
gimple_omp_atomic_load_lhs (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- return g->gimple_omp_atomic_load.lhs;
+ const gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <const gimple_statement_omp_atomic_load> (g);
+ return omp_atomic_load_stmt->lhs;
}
static inline tree *
gimple_omp_atomic_load_lhs_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- return &g->gimple_omp_atomic_load.lhs;
+ gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <gimple_statement_omp_atomic_load> (g);
+ return &omp_atomic_load_stmt->lhs;
}
static inline void
gimple_omp_atomic_load_set_rhs (gimple g, tree rhs)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- g->gimple_omp_atomic_load.rhs = rhs;
+ gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <gimple_statement_omp_atomic_load> (g);
+ omp_atomic_load_stmt->rhs = rhs;
}
static inline tree
gimple_omp_atomic_load_rhs (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- return g->gimple_omp_atomic_load.rhs;
+ const gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <const gimple_statement_omp_atomic_load> (g);
+ return omp_atomic_load_stmt->rhs;
}
static inline tree *
gimple_omp_atomic_load_rhs_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_LOAD);
- return &g->gimple_omp_atomic_load.rhs;
+ gimple_statement_omp_atomic_load *omp_atomic_load_stmt =
+ as_a <gimple_statement_omp_atomic_load> (g);
+ return &omp_atomic_load_stmt->rhs;
}
static inline tree
gimple_omp_continue_control_def (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- return g->gimple_omp_continue.control_def;
+ const gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <const gimple_statement_omp_continue> (g);
+ return omp_continue_stmt->control_def;
}
/* The same as above, but return the address. */
static inline tree *
gimple_omp_continue_control_def_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- return &g->gimple_omp_continue.control_def;
+ gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <gimple_statement_omp_continue> (g);
+ return &omp_continue_stmt->control_def;
}
/* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
static inline void
gimple_omp_continue_set_control_def (gimple g, tree def)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- g->gimple_omp_continue.control_def = def;
+ gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <gimple_statement_omp_continue> (g);
+ omp_continue_stmt->control_def = def;
}
static inline tree
gimple_omp_continue_control_use (const_gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- return g->gimple_omp_continue.control_use;
+ const gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <const gimple_statement_omp_continue> (g);
+ return omp_continue_stmt->control_use;
}
static inline tree *
gimple_omp_continue_control_use_ptr (gimple g)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- return &g->gimple_omp_continue.control_use;
+ gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <gimple_statement_omp_continue> (g);
+ return &omp_continue_stmt->control_use;
}
static inline void
gimple_omp_continue_set_control_use (gimple g, tree use)
{
- GIMPLE_CHECK (g, GIMPLE_OMP_CONTINUE);
- g->gimple_omp_continue.control_use = use;
+ gimple_statement_omp_continue *omp_continue_stmt =
+ as_a <gimple_statement_omp_continue> (g);
+ omp_continue_stmt->control_use = use;
}
/* Return a pointer to the body for the GIMPLE_TRANSACTION statement GS. */
static inline gimple_seq *
gimple_transaction_body_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- return &gs->gimple_transaction.body;
+ gimple_statement_transaction *transaction_stmt =
+ as_a <gimple_statement_transaction> (gs);
+ return &transaction_stmt->body;
}
/* Return the body for the GIMPLE_TRANSACTION statement GS. */
static inline tree
gimple_transaction_label (const_gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- return gs->gimple_transaction.label;
+ const gimple_statement_transaction *transaction_stmt =
+ as_a <const gimple_statement_transaction> (gs);
+ return transaction_stmt->label;
}
static inline tree *
gimple_transaction_label_ptr (gimple gs)
{
- GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- return &gs->gimple_transaction.label;
+ gimple_statement_transaction *transaction_stmt =
+ as_a <gimple_statement_transaction> (gs);
+ return &transaction_stmt->label;
}
/* Return the subcode associated with a GIMPLE_TRANSACTION. */
gimple_transaction_subcode (const_gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- return gs->gsbase.subcode;
+ return gs->subcode;
}
/* Set BODY to be the body for the GIMPLE_TRANSACTION statement GS. */
static inline void
gimple_transaction_set_body (gimple gs, gimple_seq body)
{
- GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- gs->gimple_transaction.body = body;
+ gimple_statement_transaction *transaction_stmt =
+ as_a <gimple_statement_transaction> (gs);
+ transaction_stmt->body = body;
}
/* Set the label associated with a GIMPLE_TRANSACTION. */
static inline void
gimple_transaction_set_label (gimple gs, tree label)
{
- GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- gs->gimple_transaction.label = label;
+ gimple_statement_transaction *transaction_stmt =
+ as_a <gimple_statement_transaction> (gs);
+ transaction_stmt->label = label;
}
/* Set the subcode associated with a GIMPLE_TRANSACTION. */
gimple_transaction_set_subcode (gimple gs, unsigned int subcode)
{
GIMPLE_CHECK (gs, GIMPLE_TRANSACTION);
- gs->gsbase.subcode = subcode;
+ gs->subcode = subcode;
}
gimple_predict_predictor (gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- return (enum br_predictor) (gs->gsbase.subcode & ~GF_PREDICT_TAKEN);
+ return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN);
}
gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- gs->gsbase.subcode = (gs->gsbase.subcode & GF_PREDICT_TAKEN)
+ gs->subcode = (gs->subcode & GF_PREDICT_TAKEN)
| (unsigned) predictor;
}
gimple_predict_outcome (gimple gs)
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- return (gs->gsbase.subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
+ return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
}
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
if (outcome == TAKEN)
- gs->gsbase.subcode |= GF_PREDICT_TAKEN;
+ gs->subcode |= GF_PREDICT_TAKEN;
else
- gs->gsbase.subcode &= ~GF_PREDICT_TAKEN;
+ gs->subcode &= ~GF_PREDICT_TAKEN;
}