On April 23, 2014 5:31:42 PM CEST, David Malcolm <dmalc...@redhat.com> wrote: >The is-a.h API currently implicitly injects a pointer into the type: > > template <typename T, typename U> > inline T * > ^^^ Note how it returns a (T*) > as_a (U *p) > { > gcc_checking_assert (is_a <T> (p)); > ^^^^^^^^ but uses the specialization of T, not T* > here > return is_a_helper <T>::cast (p); > ^^^^^^^^^^^^^^^ and here > > } > >so that currently one must write: > > Q* q = dyn_cast <Q> (p); > >This causes difficulties when dealing with typedefs to pointers. For >example, with: > > typedef struct foo_d foo; > typedef struct bar_d bar; > >we can't write: > > bar b = dyn_cast <bar> (f); > ^^^ ^^^ > >but have to write: > > bar b = dyn_cast <bar_d> (f); > ^^^ ^^^^^ Note the mismatching types. > >The following patch changes the is-a.h API to remove the implicit >injection of a pointer, so that one writes: > > Q* q = dyn_cast <Q*> (p); > >rather than: > > Q* q = dyn_cast <Q> (p); > >which also gives us more consistency with C++'s dynamic_cast<> >operator, and >allows the above cast to a typedef-ptr to be written as: > > bar b = dyn_cast <bar> (f); > ^^^ ^^^ they can now match. > >The patch also fixes up the users (a fair amount of cgraph/symtable >code, along >with the gimple accessors). > >The example motivating this is to better support as_a and dyn_cast in >gimple code, in the "Compile-time gimple-checking" patch series so >that, >with suitable typesdefs matching the names in gimple.def, such as: > > typedef struct gimple_statement_assign *gimple_assign; > >we can write: > > case GIMPLE_ASSIGN: > { > gimple_assign assign_stmt = as_a<gimple_assign> (stmt); > ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ > /* do assign-related things on assign_stmt */ > } > >instead of the clunkier: > > case GIMPLE_ASSIGN: > { > gimple_assign assign_stmt = as_a<gimple_statement_assign> (stmt); > ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ > /* do assign-related things on assign_stmt */ > } > >See the http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01259.html >subthread for more details, which also considered changing the names of >the structs and eliminating the typedefs. However, doing so without >the attached fix to the is-a API would introduce an inconsistency >between >decls for the base class vs subclass, so there'd be: > gimple stmt; /* no star */ > gimple_assign *stmt; /* star */ >(or to change the "gimple" typedef, which would be a monster patch). > >Successfully bootstrapped®rtested on x86_64-unknown-linux-gnu. > >OK for trunk?
OK for trunk, no need to wait for 4.9.1 for this. Thanks, Richard. Would the release managers prefer to make this >contingent >on holding off from committing until after 4.9.1 is out? (to minimize >impact of this change on backporting effort) > >Thanks >Dave > >gcc/ > * is-a.h: Update comments to reflect the following changes to the > "pointerness" of the API, making the template parameter match the > return type, allowing use of is-a.h with typedefs of pointers. > (is_a_helper::cast): Return a T rather then a pointer to a T, so > that the return type matches the parameter to the is_a_helper. > (as_a): Likewise. > (dyn_cast): Likewise. > > * cgraph.c (cgraph_node_for_asm): Update for removal of implicit > pointer from the is-a.h API. > > * cgraph.h (is_a_helper <cgraph_node>::test): Convert to... > (is_a_helper <cgraph_node *>::test): ...this, matching change to > is-a.h API. > (is_a_helper <varpool_node>::test): Likewise, convert to... > (is_a_helper <varpool_node *>::test): ...this. > > (varpool_first_variable): Update for removal of implicit pointer > from the is-a.h API. > (varpool_next_variable): Likewise. > (varpool_first_static_initializer): Likewise. > (varpool_next_static_initializer): Likewise. > (varpool_first_defined_variable): Likewise. > (varpool_next_defined_variable): Likewise. > (cgraph_first_defined_function): Likewise. > (cgraph_next_defined_function): Likewise. > (cgraph_first_function): Likewise. > (cgraph_next_function): Likewise. > (cgraph_first_function_with_gimple_body): Likewise. > (cgraph_next_function_with_gimple_body): Likewise. > (cgraph_alias_target): Likewise. > (varpool_alias_target): Likewise. > (cgraph_function_or_thunk_node): Likewise. > (varpool_variable_node): Likewise. > (symtab_real_symbol_p): Likewise. > * cgraphunit.c (referred_to_p): Likewise. > (analyze_functions): Likewise. > (handle_alias_pairs): Likewise. > * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. > * gimple-ssa.h (gimple_vuse_op): Likewise. > (gimple_vdef_op): Likewise. > * gimple-streamer-in.c (input_gimple_stmt): Likewise. > * gimple.c (gimple_build_asm_1): Likewise. > (gimple_build_try): Likewise. > (gimple_build_resx): Likewise. > (gimple_build_eh_dispatch): Likewise. > (gimple_build_omp_for): Likewise. > (gimple_omp_for_set_clauses): Likewise. > > * gimple.h (is_a_helper <gimple_statement_asm>::test): Convert to... > (is_a_helper <gimple_statement_asm *>::test): ...this. > (is_a_helper <gimple_statement_bind>::test): Convert to... > (is_a_helper <gimple_statement_bind *>::test): ...this. > (is_a_helper <gimple_statement_call>::test): Convert to... > (is_a_helper <gimple_statement_call *>::test): ...this. > (is_a_helper <gimple_statement_catch>::test): Convert to... > (is_a_helper <gimple_statement_catch *>::test): ...this. > (is_a_helper <gimple_statement_resx>::test): Convert to... > (is_a_helper <gimple_statement_resx *>::test): ...this. > (is_a_helper <gimple_statement_eh_dispatch>::test): Convert to... > (is_a_helper <gimple_statement_eh_dispatch *>::test): ...this. > (is_a_helper <gimple_statement_eh_else>::test): Convert to... > (is_a_helper <gimple_statement_eh_else *>::test): ...this. > (is_a_helper <gimple_statement_eh_filter>::test): Convert to... > (is_a_helper <gimple_statement_eh_filter *>::test): ...this. > (is_a_helper <gimple_statement_eh_mnt>::test): Convert to... > (is_a_helper <gimple_statement_eh_mnt *>::test): ...this. > (is_a_helper <gimple_statement_omp_atomic_load>::test): Convert to... > (is_a_helper <gimple_statement_omp_atomic_load *>::test): ...this. > (is_a_helper <gimple_statement_omp_atomic_store>::test): Convert to... > (is_a_helper <gimple_statement_omp_atomic_store *>::test): ...this. > (is_a_helper <gimple_statement_omp_return>::test): Convert to... > (is_a_helper <gimple_statement_omp_return *>::test): ...this. > (is_a_helper <gimple_statement_omp_continue>::test): Convert to... > (is_a_helper <gimple_statement_omp_continue *>::test): ...this. > (is_a_helper <gimple_statement_omp_critical>::test): Convert to... > (is_a_helper <gimple_statement_omp_critical *>::test): ...this. > (is_a_helper <gimple_statement_omp_for>::test): Convert to... > (is_a_helper <gimple_statement_omp_for *>::test): ...this. > (is_a_helper <gimple_statement_omp_taskreg>::test): Convert to... > (is_a_helper <gimple_statement_omp_taskreg *>::test): ...this. > (is_a_helper <gimple_statement_omp_parallel>::test): Convert to... > (is_a_helper <gimple_statement_omp_parallel *>::test): ...this. > (is_a_helper <gimple_statement_omp_target>::test): Convert to... > (is_a_helper <gimple_statement_omp_target *>::test): ...this. > (is_a_helper <gimple_statement_omp_sections>::test): Convert to... > (is_a_helper <gimple_statement_omp_sections *>::test): ...this. > (is_a_helper <gimple_statement_omp_single>::test): Convert to... > (is_a_helper <gimple_statement_omp_single *>::test): ...this. > (is_a_helper <gimple_statement_omp_teams>::test): Convert to... > (is_a_helper <gimple_statement_omp_teams *>::test): ...this. > (is_a_helper <gimple_statement_omp_task>::test): Convert to... > (is_a_helper <gimple_statement_omp_task *>::test): ...this. > (is_a_helper <gimple_statement_phi>::test): Convert to... > (is_a_helper <gimple_statement_phi *>::test): ...this. > (is_a_helper <gimple_statement_transaction>::test): Convert to... > (is_a_helper <gimple_statement_transaction *>::test): ...this. > (is_a_helper <gimple_statement_try>::test): Convert to... > (is_a_helper <gimple_statement_try *>::test): ...this. > (is_a_helper <gimple_statement_wce>::test): Convert to... > (is_a_helper <gimple_statement_wce *>::test): ...this. > (is_a_helper <const gimple_statement_asm>::test): Convert to... > (is_a_helper <const gimple_statement_asm *>::test): ...this. > (is_a_helper <const gimple_statement_bind>::test): Convert to... > (is_a_helper <const gimple_statement_bind *>::test): ...this. > (is_a_helper <const gimple_statement_call>::test): Convert to... > (is_a_helper <const gimple_statement_call *>::test): ...this. > (is_a_helper <const gimple_statement_catch>::test): Convert to... > (is_a_helper <const gimple_statement_catch *>::test): ...this. > (is_a_helper <const gimple_statement_resx>::test): Convert to... > (is_a_helper <const gimple_statement_resx *>::test): ...this. > (is_a_helper <const gimple_statement_eh_dispatch>::test): > Convert to... > (is_a_helper <const gimple_statement_eh_dispatch *>::test): > ...this. > (is_a_helper <const gimple_statement_eh_filter>::test): Convert > to... > (is_a_helper <const gimple_statement_eh_filter *>::test): ...this. > (is_a_helper <const gimple_statement_omp_atomic_load>::test): > Convert to... > (is_a_helper <const gimple_statement_omp_atomic_load *>::test): > ...this. > (is_a_helper <const gimple_statement_omp_atomic_store>::test): > Convert to... > (is_a_helper <const gimple_statement_omp_atomic_store *>::test): > ...this. > (is_a_helper <const gimple_statement_omp_return>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_return *>::test): ...this. > (is_a_helper <const gimple_statement_omp_continue>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_continue *>::test): ...this. > (is_a_helper <const gimple_statement_omp_critical>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_critical *>::test): ...this. > (is_a_helper <const gimple_statement_omp_for>::test): Convert to... > (is_a_helper <const gimple_statement_omp_for *>::test): ...this. > (is_a_helper <const gimple_statement_omp_taskreg>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_taskreg *>::test): ...this. > (is_a_helper <const gimple_statement_omp_parallel>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_parallel *>::test): ...this. > (is_a_helper <const gimple_statement_omp_target>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_target *>::test): ...this. > (is_a_helper <const gimple_statement_omp_sections>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_sections *>::test): ...this. > (is_a_helper <const gimple_statement_omp_single>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_single *>::test): ...this. > (is_a_helper <const gimple_statement_omp_teams>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_teams *>::test): ...this. > (is_a_helper <const gimple_statement_omp_task>::test): Convert > to... > (is_a_helper <const gimple_statement_omp_task *>::test): ...this. > (is_a_helper <const gimple_statement_phi>::test): Convert to... > (is_a_helper <const gimple_statement_phi *>::test): ...this. > (is_a_helper <const gimple_statement_transaction>::test): Convert > to... > (is_a_helper <const gimple_statement_transaction *>::test): ...this. > (is_a_helper <const gimple_statement_with_ops>::test): Convert > to... > (is_a_helper <const gimple_statement_with_ops *>::test): ...this. > (is_a_helper <gimple_statement_with_ops>::test): Convert to... > (is_a_helper <gimple_statement_with_ops *>::test): ...this. > (is_a_helper <const gimple_statement_with_memory_ops>::test): > Convert to... > (is_a_helper <const gimple_statement_with_memory_ops *>::test): > ...this. > (is_a_helper <gimple_statement_with_memory_ops>::test): Convert > to... > (is_a_helper <gimple_statement_with_memory_ops *>::test): ...this. > > (gimple_use_ops): Update for removal of implicit pointer from the > is-a.h API. > (gimple_set_use_ops): Likewise. > (gimple_vuse): Likewise. > (gimple_vdef): Likewise. > (gimple_vuse_ptr): Likewise. > (gimple_vdef_ptr): Likewise. > (gimple_set_vuse): Likewise. > (gimple_set_vdef): Likewise. > (gimple_omp_return_set_lhs): Likewise. > (gimple_omp_return_lhs): Likewise. > (gimple_omp_return_lhs_ptr): Likewise. > (gimple_call_fntype): Likewise. > (gimple_call_set_fntype): Likewise. > (gimple_call_set_internal_fn): Likewise. > (gimple_call_use_set): Likewise. > (gimple_call_clobber_set): Likewise. > (gimple_bind_vars): Likewise. > (gimple_bind_set_vars): Likewise. > (gimple_bind_body_ptr): Likewise. > (gimple_bind_set_body): Likewise. > (gimple_bind_add_stmt): Likewise. > (gimple_bind_block): Likewise. > (gimple_bind_set_block): Likewise. > (gimple_asm_ninputs): Likewise. > (gimple_asm_noutputs): Likewise. > (gimple_asm_nclobbers): Likewise. > (gimple_asm_nlabels): Likewise. > (gimple_asm_input_op): Likewise. > (gimple_asm_input_op_ptr): Likewise. > (gimple_asm_output_op): Likewise. > (gimple_asm_output_op_ptr): Likewise. > (gimple_asm_set_output_op): Likewise. > (gimple_asm_clobber_op): Likewise. > (gimple_asm_set_clobber_op): Likewise. > (gimple_asm_label_op): Likewise. > (gimple_asm_set_label_op): Likewise. > (gimple_asm_string): Likewise. > (gimple_catch_types): Likewise. > (gimple_catch_types_ptr): Likewise. > (gimple_catch_handler_ptr): Likewise. > (gimple_catch_set_types): Likewise. > (gimple_catch_set_handler): Likewise. > (gimple_eh_filter_types): Likewise. > (gimple_eh_filter_types_ptr): Likewise. > (gimple_eh_filter_failure_ptr): Likewise. > (gimple_eh_filter_set_types): Likewise. > (gimple_eh_filter_set_failure): Likewise. > (gimple_eh_must_not_throw_fndecl): Likewise. > (gimple_eh_must_not_throw_set_fndecl): Likewise. > (gimple_eh_else_n_body_ptr): Likewise. > (gimple_eh_else_e_body_ptr): Likewise. > (gimple_eh_else_set_n_body): Likewise. > (gimple_eh_else_set_e_body): Likewise. > (gimple_try_eval_ptr): Likewise. > (gimple_try_cleanup_ptr): Likewise. > (gimple_try_set_eval): Likewise. > (gimple_try_set_cleanup): Likewise. > (gimple_wce_cleanup_ptr): Likewise. > (gimple_wce_set_cleanup): Likewise. > (gimple_phi_capacity): Likewise. > (gimple_phi_num_args): Likewise. > (gimple_phi_result): Likewise. > (gimple_phi_result_ptr): Likewise. > (gimple_phi_set_result): Likewise. > (gimple_phi_arg): Likewise. > (gimple_phi_set_arg): Likewise. > (gimple_resx_region): Likewise. > (gimple_resx_set_region): Likewise. > (gimple_eh_dispatch_region): Likewise. > (gimple_eh_dispatch_set_region): Likewise. > (gimple_omp_critical_name): Likewise. > (gimple_omp_critical_name_ptr): Likewise. > (gimple_omp_critical_set_name): Likewise. > (gimple_omp_for_clauses): Likewise. > (gimple_omp_for_clauses_ptr): Likewise. > (gimple_omp_for_set_clauses): Likewise. > (gimple_omp_for_collapse): Likewise. > (gimple_omp_for_index): Likewise. > (gimple_omp_for_index_ptr): Likewise. > (gimple_omp_for_set_index): Likewise. > (gimple_omp_for_initial): Likewise. > (gimple_omp_for_initial_ptr): Likewise. > (gimple_omp_for_set_initial): Likewise. > (gimple_omp_for_final): Likewise. > (gimple_omp_for_final_ptr): Likewise. > (gimple_omp_for_set_final): Likewise. > (gimple_omp_for_incr): Likewise. > (gimple_omp_for_incr_ptr): Likewise. > (gimple_omp_for_set_incr): Likewise. > (gimple_omp_for_pre_body_ptr): Likewise. > (gimple_omp_for_set_pre_body): Likewise. > (gimple_omp_parallel_clauses): Likewise. > (gimple_omp_parallel_clauses_ptr): Likewise. > (gimple_omp_parallel_set_clauses): Likewise. > (gimple_omp_parallel_child_fn): Likewise. > (gimple_omp_parallel_child_fn_ptr): Likewise. > (gimple_omp_parallel_set_child_fn): Likewise. > (gimple_omp_parallel_data_arg): Likewise. > (gimple_omp_parallel_data_arg_ptr): Likewise. > (gimple_omp_parallel_set_data_arg): Likewise. > (gimple_omp_task_clauses): Likewise. > (gimple_omp_task_clauses_ptr): Likewise. > (gimple_omp_task_set_clauses): Likewise. > (gimple_omp_task_child_fn): Likewise. > (gimple_omp_task_child_fn_ptr): Likewise. > (gimple_omp_task_set_child_fn): Likewise. > (gimple_omp_task_data_arg): Likewise. > (gimple_omp_task_data_arg_ptr): Likewise. > (gimple_omp_task_set_data_arg): Likewise. > (gimple_omp_taskreg_clauses): Likewise. > (gimple_omp_taskreg_clauses_ptr): Likewise. > (gimple_omp_taskreg_set_clauses): Likewise. > (gimple_omp_taskreg_child_fn): Likewise. > (gimple_omp_taskreg_child_fn_ptr): Likewise. > (gimple_omp_taskreg_set_child_fn): Likewise. > (gimple_omp_taskreg_data_arg): Likewise. > (gimple_omp_taskreg_data_arg_ptr): Likewise. > (gimple_omp_taskreg_set_data_arg): Likewise. > (gimple_omp_task_copy_fn): Likewise. > (gimple_omp_task_copy_fn_ptr): Likewise. > (gimple_omp_task_set_copy_fn): Likewise. > (gimple_omp_task_arg_size): Likewise. > (gimple_omp_task_arg_size_ptr): Likewise. > (gimple_omp_task_set_arg_size): Likewise. > (gimple_omp_task_arg_align): Likewise. > (gimple_omp_task_arg_align_ptr): Likewise. > (gimple_omp_task_set_arg_align): Likewise. > (gimple_omp_single_clauses): Likewise. > (gimple_omp_single_clauses_ptr): Likewise. > (gimple_omp_single_set_clauses): Likewise. > (gimple_omp_target_clauses): Likewise. > (gimple_omp_target_clauses_ptr): Likewise. > (gimple_omp_target_set_clauses): Likewise. > (gimple_omp_target_child_fn): Likewise. > (gimple_omp_target_child_fn_ptr): Likewise. > (gimple_omp_target_set_child_fn): Likewise. > (gimple_omp_target_data_arg): Likewise. > (gimple_omp_target_data_arg_ptr): Likewise. > (gimple_omp_target_set_data_arg): Likewise. > (gimple_omp_teams_clauses): Likewise. > (gimple_omp_teams_clauses_ptr): Likewise. > (gimple_omp_teams_set_clauses): Likewise. > (gimple_omp_sections_clauses): Likewise. > (gimple_omp_sections_clauses_ptr): Likewise. > (gimple_omp_sections_set_clauses): Likewise. > (gimple_omp_sections_control): Likewise. > (gimple_omp_sections_control_ptr): Likewise. > (gimple_omp_sections_set_control): Likewise. > (gimple_omp_for_set_cond): Likewise. > (gimple_omp_for_cond): Likewise. > (gimple_omp_atomic_store_set_val): Likewise. > (gimple_omp_atomic_store_val): Likewise. > (gimple_omp_atomic_store_val_ptr): Likewise. > (gimple_omp_atomic_load_set_lhs): Likewise. > (gimple_omp_atomic_load_lhs): Likewise. > (gimple_omp_atomic_load_lhs_ptr): Likewise. > (gimple_omp_atomic_load_set_rhs): Likewise. > (gimple_omp_atomic_load_rhs): Likewise. > (gimple_omp_atomic_load_rhs_ptr): Likewise. > (gimple_omp_continue_control_def): Likewise. > (gimple_omp_continue_control_def_ptr): Likewise. > (gimple_omp_continue_set_control_def): Likewise. > (gimple_omp_continue_control_use): Likewise. > (gimple_omp_continue_control_use_ptr): Likewise. > (gimple_omp_continue_set_control_use): Likewise. > (gimple_transaction_body_ptr): Likewise. > (gimple_transaction_label): Likewise. > (gimple_transaction_label_ptr): Likewise. > (gimple_transaction_set_body): Likewise. > (gimple_transaction_set_label): Likewise. > > * ipa-devirt.c (build_type_inheritance_graph): Likewise. > * ipa-inline-analysis.c (inline_write_summary): Likewise. > * ipa-ref.c (ipa_record_reference): Likewise. > * ipa-reference.c (analyze_function): Likewise. > (ipa_reference_write_optimization_summary): Likewise. > * ipa.c (symtab_remove_unreachable_nodes): Likewise. > (address_taken_from_non_vtable_p): Likewise. > (comdat_can_be_unshared_p_1): Likewise. > * lto-cgraph.c (lto_output_ref): Likewise. > (add_references): Likewise. > (compute_ltrans_boundary): Likewise. > (output_symtab): Likewise. > (input_ref): Likewise. > (input_cgraph_1): Likewise. > (output_cgraph_opt_summary): Likewise. > * lto-streamer-out.c (lto_output): Likewise. > (output_symbol_p): Likewise. > * lto-streamer.h (lsei_next_function_in_partition): Likewise. > (lsei_start_function_in_partition): Likewise. > (lsei_next_variable_in_partition): Likewise. > (lsei_start_variable_in_partition): Likewise. > * symtab.c (insert_to_assembler_name_hash): Likewise. > (unlink_from_assembler_name_hash): Likewise. > (symtab_unregister_node): Likewise. > (symtab_remove_node): Likewise. > (dump_symtab_node): Likewise. > (verify_symtab_base): Likewise. > (verify_symtab_node): Likewise. > (symtab_make_decl_local): Likewise. > (symtab_alias_ultimate_target): Likewise. > (symtab_resolve_alias): Likewise. > (symtab_get_symbol_partitioning_class): Likewise. > * tree-phinodes.c (allocate_phi_node): Likewise. > (reserve_phi_args_for_new_edge): Likewise. > (remove_phi_args): Likewise. > * varpool.c (varpool_node_for_asm): Likewise. > (varpool_remove_unreferenced_decls): Likewise. > >gcc/lto/ > * lto-partition.c (add_references_to_partition): Update for > removal of implicit pointer from the is-a.h API. > (add_symbol_to_partition_1): Likewise. > (contained_in_symbol): Likewise. > (undo_partition): Likewise. > (lto_balanced_map): Likewise. > (promote_symbol): Likewise. > * lto-symtab.c (lto_symtab_merge_symbols_1): Likewise. > (lto_symtab_merge_symbols): Likewise. > * lto.c (lto_wpa_write_files): Likewise. >--- > gcc/cgraph.c | 2 +- > gcc/cgraph.h | 42 ++--- > gcc/cgraphunit.c | 12 +- > gcc/gimple-fold.c | 2 +- > gcc/gimple-ssa.h | 4 +- > gcc/gimple-streamer-in.c | 2 +- > gcc/gimple.c | 12 +- >gcc/gimple.h | 450 >+++++++++++++++++++++++----------------------- > gcc/ipa-devirt.c | 4 +- > gcc/ipa-inline-analysis.c | 4 +- > gcc/ipa-ref.c | 2 +- > gcc/ipa-reference.c | 8 +- > gcc/ipa.c | 8 +- > gcc/is-a.h | 34 ++-- > gcc/lto-cgraph.c | 20 +-- > gcc/lto-streamer-out.c | 8 +- > gcc/lto-streamer.h | 8 +- > gcc/lto/lto-partition.c | 18 +- > gcc/lto/lto-symtab.c | 10 +- > gcc/lto/lto.c | 4 +- > gcc/symtab.c | 44 ++--- > gcc/tree-phinodes.c | 6 +- > gcc/varpool.c | 6 +- > 23 files changed, 355 insertions(+), 355 deletions(-) > >diff --git a/gcc/cgraph.c b/gcc/cgraph.c >index be3661a..ee192ed 100644 >--- a/gcc/cgraph.c >+++ b/gcc/cgraph.c >@@ -674,7 +674,7 @@ cgraph_node_for_asm (tree asmname) > node; > node = node->next_sharing_asm_name) > { >- cgraph_node *cn = dyn_cast <cgraph_node> (node); >+ cgraph_node *cn = dyn_cast <cgraph_node *> (node); > if (cn && !cn->global.inlined_to) > return cn; > } >diff --git a/gcc/cgraph.h b/gcc/cgraph.h >index 15310d8..84fc1d9 100644 >--- a/gcc/cgraph.h >+++ b/gcc/cgraph.h >@@ -661,7 +661,7 @@ struct GTY(()) asm_node { > template <> > template <> > inline bool >-is_a_helper <cgraph_node>::test (symtab_node *p) >+is_a_helper <cgraph_node *>::test (symtab_node *p) > { > return p->type == SYMTAB_FUNCTION; > } >@@ -671,7 +671,7 @@ is_a_helper <cgraph_node>::test (symtab_node *p) > template <> > template <> > inline bool >-is_a_helper <varpool_node>::test (symtab_node *p) >+is_a_helper <varpool_node *>::test (symtab_node *p) > { > return p->type == SYMTAB_VARIABLE; > } >@@ -1029,7 +1029,7 @@ varpool_first_variable (void) > { > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) >- if (varpool_node *vnode = dyn_cast <varpool_node> (node)) >+ if (varpool_node *vnode = dyn_cast <varpool_node *> (node)) > return vnode; > return NULL; > } >@@ -1040,7 +1040,7 @@ varpool_next_variable (varpool_node *node) > { > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) >- if (varpool_node *vnode1 = dyn_cast <varpool_node> (node1)) >+ if (varpool_node *vnode1 = dyn_cast <varpool_node *> (node1)) > return vnode1; > return NULL; > } >@@ -1057,7 +1057,7 @@ varpool_first_static_initializer (void) > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) > { >- varpool_node *vnode = dyn_cast <varpool_node> (node); >+ varpool_node *vnode = dyn_cast <varpool_node *> (node); > if (vnode && DECL_INITIAL (node->decl)) > return vnode; > } >@@ -1071,7 +1071,7 @@ varpool_next_static_initializer (varpool_node >*node) > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) > { >- varpool_node *vnode1 = dyn_cast <varpool_node> (node1); >+ varpool_node *vnode1 = dyn_cast <varpool_node *> (node1); > if (vnode1 && DECL_INITIAL (node1->decl)) > return vnode1; > } >@@ -1090,7 +1090,7 @@ varpool_first_defined_variable (void) > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) > { >- varpool_node *vnode = dyn_cast <varpool_node> (node); >+ varpool_node *vnode = dyn_cast <varpool_node *> (node); > if (vnode && vnode->definition) > return vnode; > } >@@ -1104,7 +1104,7 @@ varpool_next_defined_variable (varpool_node >*node) > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) > { >- varpool_node *vnode1 = dyn_cast <varpool_node> (node1); >+ varpool_node *vnode1 = dyn_cast <varpool_node *> (node1); > if (vnode1 && vnode1->definition) > return vnode1; > } >@@ -1122,7 +1122,7 @@ cgraph_first_defined_function (void) > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) > { >- cgraph_node *cn = dyn_cast <cgraph_node> (node); >+ cgraph_node *cn = dyn_cast <cgraph_node *> (node); > if (cn && cn->definition) > return cn; > } >@@ -1136,7 +1136,7 @@ cgraph_next_defined_function (struct cgraph_node >*node) > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) > { >- cgraph_node *cn1 = dyn_cast <cgraph_node> (node1); >+ cgraph_node *cn1 = dyn_cast <cgraph_node *> (node1); > if (cn1 && cn1->definition) > return cn1; > } >@@ -1154,7 +1154,7 @@ cgraph_first_function (void) > { > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) >- if (cgraph_node *cn = dyn_cast <cgraph_node> (node)) >+ if (cgraph_node *cn = dyn_cast <cgraph_node *> (node)) > return cn; > return NULL; > } >@@ -1165,7 +1165,7 @@ cgraph_next_function (struct cgraph_node *node) > { > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) >- if (cgraph_node *cn1 = dyn_cast <cgraph_node> (node1)) >+ if (cgraph_node *cn1 = dyn_cast <cgraph_node *> (node1)) > return cn1; > return NULL; > } >@@ -1193,7 +1193,7 @@ cgraph_first_function_with_gimple_body (void) > symtab_node *node; > for (node = symtab_nodes; node; node = node->next) > { >- cgraph_node *cn = dyn_cast <cgraph_node> (node); >+ cgraph_node *cn = dyn_cast <cgraph_node *> (node); > if (cn && cgraph_function_with_gimple_body_p (cn)) > return cn; > } >@@ -1207,7 +1207,7 @@ cgraph_next_function_with_gimple_body (struct >cgraph_node *node) > symtab_node *node1 = node->next; > for (; node1; node1 = node1->next) > { >- cgraph_node *cn1 = dyn_cast <cgraph_node> (node1); >+ cgraph_node *cn1 = dyn_cast <cgraph_node *> (node1); > if (cn1 && cgraph_function_with_gimple_body_p (cn1)) > return cn1; > } >@@ -1415,13 +1415,13 @@ symtab_alias_target (symtab_node *n) > static inline struct cgraph_node * > cgraph_alias_target (struct cgraph_node *n) > { >- return dyn_cast <cgraph_node> (symtab_alias_target (n)); >+ return dyn_cast <cgraph_node *> (symtab_alias_target (n)); > } > > static inline varpool_node * > varpool_alias_target (varpool_node *n) > { >- return dyn_cast <varpool_node> (symtab_alias_target (n)); >+ return dyn_cast <varpool_node *> (symtab_alias_target (n)); > } > >/* Given NODE, walk the alias chain to return the function NODE is >alias of. >@@ -1434,8 +1434,8 @@ cgraph_function_or_thunk_node (struct cgraph_node >*node, > { > struct cgraph_node *n; > >- n = dyn_cast <cgraph_node> (symtab_alias_ultimate_target (node, >- availability)); >+ n = dyn_cast <cgraph_node *> (symtab_alias_ultimate_target (node, >+ availability)); > if (!n && availability) > *availability = AVAIL_NOT_AVAILABLE; > return n; >@@ -1451,8 +1451,8 @@ varpool_variable_node (varpool_node *node, > varpool_node *n; > > if (node) >- n = dyn_cast <varpool_node> (symtab_alias_ultimate_target (node, >- availability)); >+ n = dyn_cast <varpool_node *> (symtab_alias_ultimate_target (node, >+ availability)); > else > n = NULL; > >@@ -1502,7 +1502,7 @@ symtab_real_symbol_p (symtab_node *node) > > if (DECL_ABSTRACT (node->decl)) > return false; >- if (!is_a <cgraph_node> (node)) >+ if (!is_a <cgraph_node *> (node)) > return true; > cnode = cgraph (node); > if (cnode->global.inlined_to) >diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c >index 06283fc..7bf9a07 100644 >--- a/gcc/cgraphunit.c >+++ b/gcc/cgraphunit.c >@@ -406,7 +406,7 @@ referred_to_p (symtab_node *node) > if (ipa_ref_list_referring_iterate (&node->ref_list, 0, ref)) > return true; > /* For functions check also calls. */ >- cgraph_node *cn = dyn_cast <cgraph_node> (node); >+ cgraph_node *cn = dyn_cast <cgraph_node *> (node); > if (cn && cn->callers) > return true; > return false; >@@ -994,7 +994,7 @@ analyze_functions (void) > changed = true; > node = queued_nodes; > queued_nodes = (symtab_node *)queued_nodes->aux; >- cgraph_node *cnode = dyn_cast <cgraph_node> (node); >+ cgraph_node *cnode = dyn_cast <cgraph_node *> (node); > if (cnode && cnode->definition) > { > struct cgraph_edge *edge; >@@ -1045,7 +1045,7 @@ analyze_functions (void) > } > else > { >- varpool_node *vnode = dyn_cast <varpool_node> (node); >+ varpool_node *vnode = dyn_cast <varpool_node *> (node); > if (vnode && vnode->definition && !vnode->analyzed) > varpool_analyze_node (vnode); > } >@@ -1089,7 +1089,7 @@ analyze_functions (void) > symtab_remove_node (node); > continue; > } >- if (cgraph_node *cnode = dyn_cast <cgraph_node> (node)) >+ if (cgraph_node *cnode = dyn_cast <cgraph_node *> (node)) > { > tree decl = node->decl; > >@@ -1179,7 +1179,7 @@ handle_alias_pairs (void) > } > > if (TREE_CODE (p->decl) == FUNCTION_DECL >- && target_node && is_a <cgraph_node> (target_node)) >+ && target_node && is_a <cgraph_node *> (target_node)) > { > struct cgraph_node *src_node = cgraph_get_node (p->decl); > if (src_node && src_node->definition) >@@ -1188,7 +1188,7 @@ handle_alias_pairs (void) > alias_pairs->unordered_remove (i); > } > else if (TREE_CODE (p->decl) == VAR_DECL >- && target_node && is_a <varpool_node> (target_node)) >+ && target_node && is_a <varpool_node *> (target_node)) > { > varpool_create_variable_alias (p->decl, target_node->decl); > alias_pairs->unordered_remove (i); >diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c >index 6402cce..8b47f51 100644 >--- a/gcc/gimple-fold.c >+++ b/gcc/gimple-fold.c >@@ -96,7 +96,7 @@ can_refer_decl_in_current_unit_p (tree decl, tree >from_decl) > snode = symtab_get_node (decl); > if (!snode) > return false; >- node = dyn_cast <cgraph_node> (snode); >+ node = dyn_cast <cgraph_node *> (snode); > return !node || !node->global.inlined_to; > } > >diff --git a/gcc/gimple-ssa.h b/gcc/gimple-ssa.h >index 8bcbf67..904f002 100644 >--- a/gcc/gimple-ssa.h >+++ b/gcc/gimple-ssa.h >@@ -109,7 +109,7 @@ gimple_vuse_op (const_gimple g) > { > struct use_optype_d *ops; > const gimple_statement_with_memory_ops *mem_ops_stmt = >- dyn_cast <const gimple_statement_with_memory_ops> (g); >+ dyn_cast <const gimple_statement_with_memory_ops *> (g); > if (!mem_ops_stmt) > return NULL_USE_OPERAND_P; > ops = mem_ops_stmt->use_ops; >@@ -125,7 +125,7 @@ static inline def_operand_p > gimple_vdef_op (gimple g) > { > gimple_statement_with_memory_ops *mem_ops_stmt = >- dyn_cast <gimple_statement_with_memory_ops> (g); >+ dyn_cast <gimple_statement_with_memory_ops *> (g); > if (!mem_ops_stmt) > return NULL_DEF_OPERAND_P; > if (mem_ops_stmt->vdef) >diff --git a/gcc/gimple-streamer-in.c b/gcc/gimple-streamer-in.c >index fad04cd..f7b5d01 100644 >--- a/gcc/gimple-streamer-in.c >+++ b/gcc/gimple-streamer-in.c >@@ -137,7 +137,7 @@ input_gimple_stmt (struct lto_input_block *ib, >struct data_in *data_in, > case GIMPLE_ASM: > { > /* FIXME lto. Move most of this into a new gimple_asm_set_string(). >*/ >- gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm> (stmt); >+ gimple_statement_asm *asm_stmt = as_a <gimple_statement_asm *> >(stmt); > tree str; > asm_stmt->ni = streamer_read_uhwi (ib); > asm_stmt->no = streamer_read_uhwi (ib); >diff --git a/gcc/gimple.c b/gcc/gimple.c >index