use templates instead of gengtype for typed allocation functions

gcc/ChangeLog:

	* alias.c (record_alias_subset): Adjust.
	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.
	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	* cfgloop.c (alloc_loop): Likewise.
	(flow_loops_find): Likewise.
	(rescan_loop_exit): Likewise.
	* cfgrtl.c (init_rtl_bb_info): Likewise.
	* cgraph.c (insert_new_cgraph_node_version): Likewise.
	(cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_allocate_init_indirect_info): Likewise.
	* cgraphclones.c (cgraph_clone_edge): Likewise.
	* cgraphunit.c (add_asm_node): Likewise.
	(init_lowered_empty_function): Likewise.
	* config/aarch64/aarch64.c (aarch64_init_machine_status):
	Likewise.
	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_use_linkage): Likewise.
	* config/arc/arc.c (arc_init_machine_status): Likewise.
	* config/arm/arm.c (arm_init_machine_status): Likewise.
	* config/avr/avr.c (avr_init_machine_status): Likewise.
	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
	* config/c6x/c6x.c (c6x_init_machine_status): Likewise.
	* config/cris/cris.c (cris_init_machine_status): Likewise.
	* config/darwin.c (machopic_indirection_name): Likewise.
	(darwin_build_constant_cfstring): Likewise.
	(darwin_enter_string_into_cfstring_table): Likewise.
	* config/epiphany/epiphany.c (epiphany_init_machine_status):
	* Likewise.
	* config/frv/frv.c (frv_init_machine_status): Likewise.
	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.
	* config/i386/winnt.c (i386_pe_record_external_function):
	Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.
	(i386_pe_record_stub): Likewise.
	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
	(m32c_note_pragma_address): Likewise.
	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.
	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
	(mips16_local_alias): Likewise.
	(mips_init_machine_status): Likewise.
	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
	* config/msp430/msp430.c (msp430_init_machine_status): Likewise.
	* config/nds32/nds32.c (nds32_init_machine_status): Likewise.
	* config/nios2/nios2.c (nios2_init_machine_status): Likewise.
	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(pa_get_deferred_plabel): Likewise.
	* config/rl78/rl78.c (rl78_init_machine_status): Likewise.
	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.
	* config/s390/s390.c (s390_init_machine_status): Likewise.
	* config/score/score.c (score_output_external): Likewise.
	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
	* config/spu/spu.c (spu_init_machine_status): Likewise.
	* config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise.
	* config/tilepro/tilepro.c (tilepro_init_machine_status):
	* Likewise.
	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
	* coverage.c (coverage_end_function): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* doc/gty.texi: Don't mention variable_size attribute.
	* dwarf2cfi.c (new_cfi): Adjust.
	(new_cfi_row): Likewise.
	(copy_cfi_row): Likewise.
	(create_cie_data): Likewise.
	* dwarf2out.c (dwarf2out_alloc_current_fde): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string_in_table): Likewise.
	(add_addr_table_entry): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_location_or_const_value_attribute): Likewise.
	(add_linkage_name): Likewise.
	(lookup_filename): Likewise.
	(dwarf2out_var_location): Likewise.
	(new_line_info_table): Likewise.
	(dwarf2out_init): Likewise.
	(mem_loc_descriptor): Likewise.
	(loc_descriptor): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(comp_dir_string): Likewise.
	(dwarf2out_vms_debug_main_pointer): Likewise.
	(string_cst_pool_decl): Likewise.
	* emit-rtl.c (set_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.
	(init_emit_regs): Likewise.
	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.
	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(get_hard_reg_initial_val): Likewise.
	(allocate_struct_function): Likewise.
	(prepare_function_start): Likewise.
	(types_used_by_var_decl_insert): Likewise.
	* gengtype.c (variable_size_p): Remove function.
	(enum alloc_quantity): Remove enum.
	(write_typed_alloc_def): Remove function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(main): Adjust.
	* ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust.
	(ggc_cleared_alloc_ptr_array_two_args): Likewise.
	* ggc.h (ggc_alloc): new function.
	(ggc_cleared_alloc): Likewise.
	(ggc_vec_alloc): Template on type of vector element, and remove
	element size argument.
	(ggc_cleared_vec_alloc): Likewise.
	* gimple.c (gimple_build_omp_for): Adjust.
	(gimple_copy): Likewise.
	* ipa-cp.c (get_replacement_map): Likewise.
	(find_aggregate_values_for_callers_subset): Likewise.
	(known_aggs_to_agg_replacement_list): Likewise.
	* ipa-devirt.c (get_odr_type): Likewise.
	* ipa-prop.c (ipa_node_duplication_hook): Likewise.
	(read_agg_replacement_chain): Likewise.
	* loop-iv.c (get_simple_loop_desc): Likewise.
	* lto-cgraph.c (input_node_opt_summary): Likewise.
	* lto-section-in.c (lto_new_in_decl_state): Likewise.
	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(input_cfg): Likewise.
	* optabs.c (set_optab_libfunc): Likewise.
	(init_tree_optimization_optabs): Likewise.
	(set_conv_libfunc): Likewise.
	* passes.c (do_per_function_toporder): Likewise.
	* rtl.h: Don't use variable_size gty attribute.
	* sese.c (if_region_set_false_region): Adjust.
	* stringpool.c (gt_pch_save_stringpool): Likewise.
	* target-globals.c (save_target_globals): Likewise.
	* toplev.c (general_init): Likewise.
	* trans-mem.c (record_tm_replacement): Likewise.
	(split_bb_make_tm_edge): Likewise.
	* tree-cfg.c (move_sese_region_to_fn): Likewise.
	* tree-data-ref.h (lambda_vector_new): Likewise.
	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.
	* tree-scalar-evolution.c (new_scev_info_str): Likewise.
	* tree-ssa-loop-niter.c (record_estimate): Likewise.
	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
	* tree-ssa-operands.h: Don't use variable_size gty attribute.
	* tree-ssa.c (init_tree_ssa): Adjust.
	* tree-ssanames.c (set_range_info): Likewise.
	(get_ptr_info): Likewise.
	(duplicate_ssa_name_ptr_info): Likewise.
	(duplicate_ssa_name_range_info): Likewise.
	* tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise.
	(unpack_ts_fixed_cst_value_fields): Likewise.
	* tree.c (build_fixed): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_priority_info): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(decl_debug_args_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.
	* ubsan.c (decl_for_type_insert): Likewise.
	* varasm.c (get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(create_block_symbol): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.
	(record_tm_clone_pair): Likewise.
	* varpool.c (varpool_create_empty_node): Likewise.

gcc/c/ChangeLog:

	* c-decl.c (finish_struct): Adjust.
	(finish_enum): Likewise.
	(bind): Adjust.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(store_parm_decls): Likewise.
	(c_push_function_context): Likewise.
	* c-lang.h: Remove usage of variable_size gty attribute.
	* c-parser.c (c_parse_init): Adjust.
	(c_parse_file): Likewise.

gcc/java/ChangeLog:

	* class.c (add_method_1): Adjust.
	(java_treetreehash_new): Likewise.
	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.
	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.
	* expr.c (add_type_assertion): Likewise.
	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(lang_decl): don't use variable_size gty attribute.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust.
	(lang_type): Don't use variable_size gty attribute.
	* jcf-parse.c (java_parse_file): Adjust.
	(process_zip_dir): Likewise.
	* jcf.h: Remove usage of variable_size gty attribute.
	* jcf-reader.c (jcf_parse_constant_pool): Adjust.
	(jcf_parse_bootstrap_methods): Likewise.

gcc/objc/ChangeLog:

	* objc-act.c (objc_build_string_object): Adjust.
	(continue_class): Likewise.
	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise.
	* objc-map.c (objc_map_alloc_ggc): Likewise.
	(objc_map_private_resize): Likewise.
	* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init):
	Likewise.
	(hash_name_enter): Likewise.

gcc/cp/ChangeLog:

	* class.c (sorted_fields_type_new): Adjust.
	* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
	* cp-tree.h: Remove usage of variable_size gty attribute.
	* decl.c (make_label_decl): Adjust.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.
	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.
	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend_1): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.
	* parser.c (cp_lexer_alloc): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.
	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class_1): Likewise.
	(push_tinst_level): Likewise.
	* semantics.c (register_constexpr_fundef): Likewise.
	(cxx_eval_call_expression): Likewise.
	* typeck2.c (abstract_virtuals_error_sfinae): Likewise.

gcc/fortran/ChangeLog:

	* f95-lang.c (pushlevel): Adjust.
	* trans-decl.c (gfc_allocate_lang_decl): Adjust.
	(gfc_find_module): Likewise.
	* trans-types.c (gfc_get_nodesc_array_type): Likewise.
	(gfc_get_array_type_bounds): Likewise.
	(gfc_nonrestricted_type): Likewise.
	* trans.h: Don't use variable_size gty attribute.

gcc/ada/ChangeLog:

	* gcc-interface/ada-tree.h: Remove usage of variable_size gty
	annotation.
	* gcc-interface/decl.c (annotate_value): Adjust.
	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(push_range_check_info): Likewise.
	(Loop_Statement_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	* gcc-interface/utils.c (init_gnat_utils): Likewise.
	(gnat_pushlevel): Likewise.
	(maybe_pad_type): Likewise.

gcc/go/ChangeLog:

	* go-lang.c (struct GTY): Don't use variable_size gty attribute.

gcc/c-family/ChangeLog:

	* c-common.h (sorted_fields_type): Remove variable_size GTY attribute.
	* c-pragma.c (push_alignment): Adjust.
	(handle_pragma_push_options): Likewise.

gcc/lto/ChangeLog:

	* lto-tree.h: Don't use variable_size gty attribute.
	* lto.c (lto_read_in_decl_state): Adjust.
	(create_subid_section_table): Likewise.
	(lto_flatten_files): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objcp/ChangeLog:

	* objcp-decl.h: Adjust.

From-SVN: r210566
This commit is contained in:
Trevor Saunders 2014-05-17 23:07:23 +00:00 committed by Trevor Saunders
parent 231120e5d4
commit 766090c20f
134 changed files with 670 additions and 517 deletions

View File

@ -1,3 +1,198 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* alias.c (record_alias_subset): Adjust.
* bitmap.c (bitmap_element_allocate): Likewise.
(bitmap_gc_alloc_stat): Likewise.
* cfg.c (init_flow): Likewise.
(alloc_block): Likewise.
(unchecked_make_edge): Likewise.
* cfgloop.c (alloc_loop): Likewise.
(flow_loops_find): Likewise.
(rescan_loop_exit): Likewise.
* cfgrtl.c (init_rtl_bb_info): Likewise.
* cgraph.c (insert_new_cgraph_node_version): Likewise.
(cgraph_allocate_node): Likewise.
(cgraph_create_edge_1): Likewise.
(cgraph_allocate_init_indirect_info): Likewise.
* cgraphclones.c (cgraph_clone_edge): Likewise.
* cgraphunit.c (add_asm_node): Likewise.
(init_lowered_empty_function): Likewise.
* config/aarch64/aarch64.c (aarch64_init_machine_status):
Likewise.
* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
(alpha_use_linkage): Likewise.
* config/arc/arc.c (arc_init_machine_status): Likewise.
* config/arm/arm.c (arm_init_machine_status): Likewise.
* config/avr/avr.c (avr_init_machine_status): Likewise.
* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
* config/c6x/c6x.c (c6x_init_machine_status): Likewise.
* config/cris/cris.c (cris_init_machine_status): Likewise.
* config/darwin.c (machopic_indirection_name): Likewise.
(darwin_build_constant_cfstring): Likewise.
(darwin_enter_string_into_cfstring_table): Likewise.
* config/epiphany/epiphany.c (epiphany_init_machine_status):
* Likewise.
* config/frv/frv.c (frv_init_machine_status): Likewise.
* config/i386/i386.c (get_dllimport_decl): Likewise.
(ix86_init_machine_status): Likewise.
(assign_386_stack_local): Likewise.
* config/i386/winnt.c (i386_pe_record_external_function):
Likewise.
(i386_pe_maybe_record_exported_symbol): Likewise.
(i386_pe_record_stub): Likewise.
* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
(m32c_note_pragma_address): Likewise.
* config/mep/mep.c (mep_init_machine_status): Likewise.
(mep_note_pragma_flag): Likewise.
* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
(mips16_local_alias): Likewise.
(mips_init_machine_status): Likewise.
* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
* config/msp430/msp430.c (msp430_init_machine_status): Likewise.
* config/nds32/nds32.c (nds32_init_machine_status): Likewise.
* config/nios2/nios2.c (nios2_init_machine_status): Likewise.
* config/pa/pa.c (pa_init_machine_status): Likewise.
(pa_get_deferred_plabel): Likewise.
* config/rl78/rl78.c (rl78_init_machine_status): Likewise.
* config/rs6000/rs6000.c (builtin_function_type): Likewise.
(rs6000_init_machine_status): Likewise.
(output_toc): Likewise.
* config/s390/s390.c (s390_init_machine_status): Likewise.
* config/score/score.c (score_output_external): Likewise.
* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
* config/spu/spu.c (spu_init_machine_status): Likewise.
* config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise.
* config/tilepro/tilepro.c (tilepro_init_machine_status):
* Likewise.
* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
* coverage.c (coverage_end_function): Likewise.
* dbxout.c (dbxout_init): Likewise.
* doc/gty.texi: Don't mention variable_size attribute.
* dwarf2cfi.c (new_cfi): Adjust.
(new_cfi_row): Likewise.
(copy_cfi_row): Likewise.
(create_cie_data): Likewise.
* dwarf2out.c (dwarf2out_alloc_current_fde): Likewise.
(new_loc_descr): Likewise.
(find_AT_string_in_table): Likewise.
(add_addr_table_entry): Likewise.
(new_die): Likewise.
(add_var_loc_to_decl): Likewise.
(clone_die): Likewise.
(clone_as_declaration): Likewise.
(break_out_comdat_types): Likewise.
(new_loc_list): Likewise.
(add_loc_descr_to_each): Likewise.
(add_location_or_const_value_attribute): Likewise.
(add_linkage_name): Likewise.
(lookup_filename): Likewise.
(dwarf2out_var_location): Likewise.
(new_line_info_table): Likewise.
(dwarf2out_init): Likewise.
(mem_loc_descriptor): Likewise.
(loc_descriptor): Likewise.
(add_const_value_attribute): Likewise.
(tree_add_const_value_attribute): Likewise.
(comp_dir_string): Likewise.
(dwarf2out_vms_debug_main_pointer): Likewise.
(string_cst_pool_decl): Likewise.
* emit-rtl.c (set_mem_attrs): Likewise.
(get_reg_attrs): Likewise.
(start_sequence): Likewise.
(init_emit): Likewise.
(init_emit_regs): Likewise.
* except.c (init_eh_for_function): Likewise.
(gen_eh_region): Likewise.
(gen_eh_region_catch): Likewise.
(gen_eh_landing_pad): Likewise.
(add_call_site): Likewise.
* function.c (add_frame_space): Likewise.
(insert_temp_slot_address): Likewise.
(assign_stack_temp_for_type): Likewise.
(get_hard_reg_initial_val): Likewise.
(allocate_struct_function): Likewise.
(prepare_function_start): Likewise.
(types_used_by_var_decl_insert): Likewise.
* gengtype.c (variable_size_p): Remove function.
(enum alloc_quantity): Remove enum.
(write_typed_alloc_def): Remove function.
(write_typed_struct_alloc_def): Likewise.
(write_typed_typedef_alloc_def): Likewise.
(write_typed_alloc_defns): Likewise.
(main): Adjust.
* ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust.
(ggc_cleared_alloc_ptr_array_two_args): Likewise.
* ggc.h (ggc_alloc): new function.
(ggc_cleared_alloc): Likewise.
(ggc_vec_alloc): Template on type of vector element, and remove
element size argument.
(ggc_cleared_vec_alloc): Likewise.
* gimple.c (gimple_build_omp_for): Adjust.
(gimple_copy): Likewise.
* ipa-cp.c (get_replacement_map): Likewise.
(find_aggregate_values_for_callers_subset): Likewise.
(known_aggs_to_agg_replacement_list): Likewise.
* ipa-devirt.c (get_odr_type): Likewise.
* ipa-prop.c (ipa_node_duplication_hook): Likewise.
(read_agg_replacement_chain): Likewise.
* loop-iv.c (get_simple_loop_desc): Likewise.
* lto-cgraph.c (input_node_opt_summary): Likewise.
* lto-section-in.c (lto_new_in_decl_state): Likewise.
* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
(input_eh_region): Likewise.
(input_eh_lp): Likewise.
(input_cfg): Likewise.
* optabs.c (set_optab_libfunc): Likewise.
(init_tree_optimization_optabs): Likewise.
(set_conv_libfunc): Likewise.
* passes.c (do_per_function_toporder): Likewise.
* rtl.h: Don't use variable_size gty attribute.
* sese.c (if_region_set_false_region): Adjust.
* stringpool.c (gt_pch_save_stringpool): Likewise.
* target-globals.c (save_target_globals): Likewise.
* toplev.c (general_init): Likewise.
* trans-mem.c (record_tm_replacement): Likewise.
(split_bb_make_tm_edge): Likewise.
* tree-cfg.c (move_sese_region_to_fn): Likewise.
* tree-data-ref.h (lambda_vector_new): Likewise.
* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
* tree-iterator.c (tsi_link_before): Likewise.
(tsi_link_after): Likewise.
* tree-scalar-evolution.c (new_scev_info_str): Likewise.
* tree-ssa-loop-niter.c (record_estimate): Likewise.
* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
* tree-ssa-operands.h: Don't use variable_size gty attribute.
* tree-ssa.c (init_tree_ssa): Adjust.
* tree-ssanames.c (set_range_info): Likewise.
(get_ptr_info): Likewise.
(duplicate_ssa_name_ptr_info): Likewise.
(duplicate_ssa_name_range_info): Likewise.
* tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise.
(unpack_ts_fixed_cst_value_fields): Likewise.
* tree.c (build_fixed): Likewise.
(build_real): Likewise.
(build_string): Likewise.
(decl_priority_info): Likewise.
(decl_debug_expr_insert): Likewise.
(decl_value_expr_insert): Likewise.
(decl_debug_args_insert): Likewise.
(type_hash_add): Likewise.
(build_omp_clause): Likewise.
* ubsan.c (decl_for_type_insert): Likewise.
* varasm.c (get_unnamed_section): Likewise.
(get_noswitch_section): Likewise.
(get_section): Likewise.
(get_block_for_section): Likewise.
(create_block_symbol): Likewise.
(build_constant_desc): Likewise.
(create_constant_pool): Likewise.
(force_const_mem): Likewise.
(record_tm_clone_pair): Likewise.
* varpool.c (varpool_create_empty_node): Likewise.
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* dwarf2out.c (tree_add_const_value_attribute): Call

View File

@ -1,3 +1,18 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* gcc-interface/ada-tree.h: Remove usage of variable_size gty
annotation.
* gcc-interface/decl.c (annotate_value): Adjust.
* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
(push_range_check_info): Likewise.
(Loop_Statement_to_gnu): Likewise.
(Subprogram_Body_to_gnu): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(start_stmt_group): Likewise.
* gcc-interface/utils.c (init_gnat_utils): Likewise.
(gnat_pushlevel): Likewise.
(maybe_pad_type): Likewise.
2014-05-14 Eric Botcazou <ebotcazou@adacore.com>
* seh_init.c: Fix copyright year.

View File

@ -32,13 +32,9 @@ union GTY((desc ("0"),
desc ("tree_node_structure (&%h)"))) generic;
};
/* Ada uses the lang_decl and lang_type fields to hold a tree.
FIXME: the variable_size annotation here is needed because these types are
variable-sized in some other front-ends. Due to gengtype deficiency, the
GTY options of such types have to agree across all front-ends. */
struct GTY((variable_size)) lang_type { tree t; };
struct GTY((variable_size)) lang_decl { tree t; };
/* Ada uses the lang_decl and lang_type fields to hold a tree. */
struct GTY(()) lang_type { tree t; };
struct GTY(()) lang_decl { tree t; };
/* Macros to get and set the tree in TYPE_LANG_SPECIFIC. */
#define GET_TYPE_LANG_SPECIFIC(NODE) \
@ -49,7 +45,7 @@ do { \
tree tmp = (X); \
if (!TYPE_LANG_SPECIFIC (NODE)) \
TYPE_LANG_SPECIFIC (NODE) \
= ggc_alloc_lang_type (sizeof (struct lang_type)); \
= ggc_alloc<struct lang_type> (); \
TYPE_LANG_SPECIFIC (NODE)->t = tmp; \
} while (0)
@ -62,7 +58,7 @@ do { \
tree tmp = (X); \
if (!DECL_LANG_SPECIFIC (NODE)) \
DECL_LANG_SPECIFIC (NODE) \
= ggc_alloc_lang_decl (sizeof (struct lang_decl)); \
= ggc_alloc<struct lang_decl> (); \
DECL_LANG_SPECIFIC (NODE)->t = tmp; \
} while (0)

View File

@ -7578,7 +7578,7 @@ annotate_value (tree gnu_size)
h = (struct tree_int_map **)
htab_find_slot (annotate_value_cache, &in, INSERT);
gcc_assert (!*h);
*h = ggc_alloc_tree_int_map ();
*h = ggc_alloc<tree_int_map> ();
(*h)->base.from = gnu_size;
(*h)->to = ret;
}

View File

@ -2000,7 +2000,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
if (!pa)
{
pa = ggc_alloc_cleared_parm_attr_d ();
pa = ggc_cleared_alloc<parm_attr_d> ();
pa->id = gnat_param;
pa->dim = Dimension;
vec_safe_push (f_parm_attr_cache, pa);
@ -2522,7 +2522,7 @@ push_range_check_info (tree var)
if (iter)
{
struct range_check_info_d *rci = ggc_alloc_range_check_info_d ();
struct range_check_info_d *rci = ggc_alloc<range_check_info_d> ();
vec_safe_push (iter->checks, rci);
return rci;
}
@ -2600,7 +2600,7 @@ static tree
Loop_Statement_to_gnu (Node_Id gnat_node)
{
const Node_Id gnat_iter_scheme = Iteration_Scheme (gnat_node);
struct loop_info_d *gnu_loop_info = ggc_alloc_cleared_loop_info_d ();
struct loop_info_d *gnu_loop_info = ggc_cleared_alloc<loop_info_d> ();
tree gnu_loop_stmt = build4 (LOOP_STMT, void_type_node, NULL_TREE,
NULL_TREE, NULL_TREE, NULL_TREE);
tree gnu_loop_label = create_artificial_label (input_location);
@ -3617,7 +3617,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
/* Initialize the information structure for the function. */
allocate_struct_function (gnu_subprog_decl, false);
gnu_subprog_language = ggc_alloc_cleared_language_function ();
gnu_subprog_language = ggc_cleared_alloc<language_function> ();
DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language = gnu_subprog_language;
set_cfun (NULL);
@ -5140,7 +5140,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
/* Save away what we've made so far and record this potential elaboration
procedure. */
info = ggc_alloc_elab_info ();
info = ggc_alloc<elab_info> ();
set_current_block_context (gnu_elab_proc_decl);
gnat_poplevel ();
DECL_SAVED_TREE (gnu_elab_proc_decl) = end_stmt_group ();
@ -7439,7 +7439,7 @@ start_stmt_group (void)
if (group)
stmt_group_free_list = group->previous;
else
group = ggc_alloc_stmt_group ();
group = ggc_alloc<stmt_group> ();
group->previous = current_stmt_group;
group->stmt_list = group->block = group->cleanups = NULL_TREE;

View File

@ -245,10 +245,10 @@ void
init_gnat_utils (void)
{
/* Initialize the association of GNAT nodes to GCC trees. */
associate_gnat_to_gnu = ggc_alloc_cleared_vec_tree (max_gnat_nodes);
associate_gnat_to_gnu = ggc_cleared_vec_alloc<tree> (max_gnat_nodes);
/* Initialize the association of GNAT nodes to GCC trees as dummies. */
dummy_node_table = ggc_alloc_cleared_vec_tree (max_gnat_nodes);
dummy_node_table = ggc_cleared_vec_alloc<tree> (max_gnat_nodes);
/* Initialize the hash table of padded types. */
pad_type_hash_table
@ -428,7 +428,7 @@ gnat_pushlevel (void)
free_binding_level = free_binding_level->chain;
}
else
newlevel = ggc_alloc_gnat_binding_level ();
newlevel = ggc_alloc<gnat_binding_level> ();
/* Use a free BLOCK, if any; otherwise, allocate one. */
if (free_block_chain)
@ -1182,7 +1182,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
goto built;
}
h = ggc_alloc_pad_type_hash ();
h = ggc_alloc<pad_type_hash> ();
h->hash = hashcode;
h->type = record;
loc = htab_find_slot_with_hash (pad_type_hash_table, h, hashcode,

View File

@ -944,7 +944,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
{
/* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */
superset_entry = ggc_alloc_cleared_alias_set_entry_d ();
superset_entry = ggc_cleared_alloc<alias_set_entry_d> ();
superset_entry->alias_set = superset;
superset_entry->children
= splay_tree_new_ggc (splay_tree_compare_ints,

View File

@ -244,7 +244,7 @@ bitmap_element_allocate (bitmap head)
/* Inner list was just a singleton. */
bitmap_ggc_free = element->prev;
else
element = ggc_alloc_bitmap_element ();
element = ggc_alloc<bitmap_element> ();
}
if (GATHER_STATISTICS)
@ -388,7 +388,7 @@ bitmap_gc_alloc_stat (ALONE_MEM_STAT_DECL)
{
bitmap map;
map = ggc_alloc_bitmap_head ();
map = ggc_alloc<bitmap_head> ();
bitmap_initialize_stat (map, NULL PASS_MEM_STAT);
if (GATHER_STATISTICS)

View File

@ -1,3 +1,9 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* c-common.h (sorted_fields_type): Remove variable_size GTY attribute.
* c-pragma.c (push_alignment): Adjust.
(handle_pragma_push_options): Likewise.
2014-05-09 Marek Polacek <polacek@redhat.com>
PR c/50459

View File

@ -440,7 +440,7 @@ extern GTY(()) tree c_global_trees[CTI_MAX];
/* In a RECORD_TYPE, a sorted array of the fields of the type, not a
tree for size reasons. */
struct GTY((variable_size)) sorted_fields_type {
struct GTY(()) sorted_fields_type {
int len;
tree GTY((length ("%h.len"))) elts[1];
};

View File

@ -74,9 +74,7 @@ static void pop_alignment (tree);
static void
push_alignment (int alignment, tree id)
{
align_stack * entry;
entry = ggc_alloc_align_stack ();
align_stack * entry = ggc_alloc<align_stack> ();
entry->alignment = alignment;
entry->id = id;
@ -911,7 +909,6 @@ handle_pragma_push_options (cpp_reader *ARG_UNUSED(dummy))
{
enum cpp_ttype token;
tree x = 0;
opt_stack *p;
token = pragma_lex (&x);
if (token != CPP_EOF)
@ -920,7 +917,7 @@ handle_pragma_push_options (cpp_reader *ARG_UNUSED(dummy))
return;
}
p = ggc_alloc_opt_stack ();
opt_stack *p = ggc_alloc<opt_stack> ();
p->prev = options_stack;
options_stack = p;

View File

@ -1,3 +1,20 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* c-decl.c (finish_struct): Adjust.
(finish_enum): Likewise.
(bind): Adjust.
(record_inline_static): Likewise.
(push_scope): Likewise.
(make_label): Likewise.
(lookup_label_for_goto): Likewise.
(finish_struct): Likewise.
(finish_enum): Likewise.
(store_parm_decls): Likewise.
(c_push_function_context): Likewise.
* c-lang.h: Remove usage of variable_size gty attribute.
* c-parser.c (c_parse_init): Adjust.
(c_parse_file): Likewise.
2014-05-13 Marek Polacek <polacek@redhat.com>
PR c/61162

View File

@ -638,7 +638,7 @@ bind (tree name, tree decl, struct c_scope *scope, bool invisible,
binding_freelist = b->prev;
}
else
b = ggc_alloc_c_binding ();
b = ggc_alloc<c_binding> ();
b->shadowed = 0;
b->decl = decl;
@ -755,7 +755,7 @@ void
record_inline_static (location_t loc, tree func, tree decl,
enum c_inline_static_type type)
{
struct c_inline_static *csi = ggc_alloc_c_inline_static ();
c_inline_static *csi = ggc_alloc<c_inline_static> ();
csi->location = loc;
csi->function = func;
csi->static_decl = decl;
@ -952,7 +952,7 @@ push_scope (void)
scope_freelist = scope->outer;
}
else
scope = ggc_alloc_cleared_c_scope ();
scope = ggc_cleared_alloc<c_scope> ();
/* The FLOAT_CONST_DECIMAL64 pragma applies to nested scopes. */
if (current_scope)
@ -3084,12 +3084,10 @@ make_label (location_t location, tree name, bool defining,
struct c_label_vars **p_label_vars)
{
tree label = build_decl (location, LABEL_DECL, name, void_type_node);
struct c_label_vars *label_vars;
DECL_CONTEXT (label) = current_function_decl;
DECL_MODE (label) = VOIDmode;
label_vars = ggc_alloc_c_label_vars ();
c_label_vars *label_vars = ggc_alloc<c_label_vars> ();
label_vars->shadowed = NULL;
set_spot_bindings (&label_vars->label_bindings, defining);
label_vars->decls_in_scope = make_tree_vector ();
@ -3185,9 +3183,8 @@ lookup_label_for_goto (location_t loc, tree name)
list for possible later warnings. */
if (label_vars->label_bindings.scope == NULL)
{
struct c_goto_bindings *g;
c_goto_bindings *g = ggc_alloc<c_goto_bindings> ();
g = ggc_alloc_c_goto_bindings ();
g->loc = loc;
set_spot_bindings (&g->goto_bindings, true);
vec_safe_push (label_vars->gotos, g);
@ -7423,8 +7420,8 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
ensure that this lives as long as the rest of the struct decl.
All decls in an inline function need to be saved. */
space = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
space2 = ggc_alloc_sorted_fields_type
space = ggc_cleared_alloc<struct lang_type> ();
space2 = (sorted_fields_type *) ggc_internal_alloc
(sizeof (struct sorted_fields_type) + len * sizeof (tree));
len = 0;
@ -7705,7 +7702,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
/* Record the min/max values so that we can warn about bit-field
enumerations that are too small for the values. */
lt = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
lt = ggc_cleared_alloc<struct lang_type> ();
lt->enum_min = minnode;
lt->enum_max = maxnode;
TYPE_LANG_SPECIFIC (enumtype) = lt;
@ -8479,7 +8476,7 @@ store_parm_decls (void)
allocate_struct_function (fndecl, false);
if (warn_unused_local_typedefs)
cfun->language = ggc_alloc_cleared_language_function ();
cfun->language = ggc_cleared_alloc<language_function> ();
/* Begin the statement tree for this function. */
DECL_SAVED_TREE (fndecl) = push_stmt_list ();
@ -8803,7 +8800,7 @@ c_push_function_context (void)
/* cfun->language might have been already allocated by the use of
-Wunused-local-typedefs. In that case, just re-use it. */
if (p == NULL)
cfun->language = p = ggc_alloc_cleared_language_function ();
cfun->language = p = ggc_cleared_alloc<language_function> ();
p->base.x_stmt_tree = c_stmt_tree;
c_stmt_tree.x_cur_stmt_list = vec_safe_copy (c_stmt_tree.x_cur_stmt_list);

View File

@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-common.h"
#include "ggc.h"
struct GTY((variable_size)) lang_type {
struct GTY(()) lang_type {
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
/* In an ENUMERAL_TYPE, the min and max values. */
@ -35,7 +35,7 @@ struct GTY((variable_size)) lang_type {
tree objc_info;
};
struct GTY((variable_size)) lang_decl {
struct GTY(()) lang_decl {
char dummy;
};

View File

@ -90,7 +90,7 @@ c_parse_init (void)
if (!c_dialect_objc ())
mask |= D_OBJC | D_CXX_OBJC;
ridpointers = ggc_alloc_cleared_vec_tree ((int) RID_MAX);
ridpointers = ggc_cleared_vec_alloc<tree> ((int) RID_MAX);
for (i = 0; i < num_c_common_reswords; i++)
{
/* If a keyword is disabled, do not enter it into the table
@ -14061,7 +14061,7 @@ c_parse_file (void)
if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS)
c_parser_pragma_pch_preprocess (&tparser);
the_parser = ggc_alloc_c_parser ();
the_parser = ggc_alloc<c_parser> ();
*the_parser = tparser;
if (tparser.tokens == &tparser.tokens_buf[0])
the_parser->tokens = &the_parser->tokens_buf[0];

View File

@ -68,13 +68,13 @@ void
init_flow (struct function *the_fun)
{
if (!the_fun->cfg)
the_fun->cfg = ggc_alloc_cleared_control_flow_graph ();
the_fun->cfg = ggc_cleared_alloc<control_flow_graph> ();
n_edges_for_fn (the_fun) = 0;
ENTRY_BLOCK_PTR_FOR_FN (the_fun)
= ggc_alloc_cleared_basic_block_def ();
= ggc_cleared_alloc<basic_block_def> ();
ENTRY_BLOCK_PTR_FOR_FN (the_fun)->index = ENTRY_BLOCK;
EXIT_BLOCK_PTR_FOR_FN (the_fun)
= ggc_alloc_cleared_basic_block_def ();
= ggc_cleared_alloc<basic_block_def> ();
EXIT_BLOCK_PTR_FOR_FN (the_fun)->index = EXIT_BLOCK;
ENTRY_BLOCK_PTR_FOR_FN (the_fun)->next_bb
= EXIT_BLOCK_PTR_FOR_FN (the_fun);
@ -123,7 +123,7 @@ basic_block
alloc_block (void)
{
basic_block bb;
bb = ggc_alloc_cleared_basic_block_def ();
bb = ggc_cleared_alloc<basic_block_def> ();
return bb;
}
@ -261,7 +261,7 @@ edge
unchecked_make_edge (basic_block src, basic_block dst, int flags)
{
edge e;
e = ggc_alloc_cleared_edge_def ();
e = ggc_cleared_alloc<edge_def> ();
n_edges_for_fn (cfun)++;
e->src = src;

View File

@ -331,9 +331,9 @@ flow_loop_tree_node_remove (struct loop *loop)
struct loop *
alloc_loop (void)
{
struct loop *loop = ggc_alloc_cleared_loop ();
struct loop *loop = ggc_cleared_alloc<struct loop> ();
loop->exits = ggc_alloc_cleared_loop_exit ();
loop->exits = ggc_cleared_alloc<loop_exit> ();
loop->exits->next = loop->exits->prev = loop->exits;
loop->can_be_parallel = false;
loop->nb_iterations_upper_bound = 0;
@ -415,7 +415,7 @@ flow_loops_find (struct loops *loops)
if (!loops)
{
loops = ggc_alloc_cleared_loops ();
loops = ggc_cleared_alloc<struct loops> ();
init_loops_structure (cfun, loops, 1);
}
@ -1029,7 +1029,7 @@ rescan_loop_exit (edge e, bool new_edge, bool removed)
aloop != cloop;
aloop = loop_outer (aloop))
{
exit = ggc_alloc_loop_exit ();
exit = ggc_alloc<loop_exit> ();
exit->e = e;
exit->next = aloop->exits->next;

View File

@ -4954,7 +4954,7 @@ init_rtl_bb_info (basic_block bb)
{
gcc_assert (!bb->il.x.rtl);
bb->il.x.head_ = NULL;
bb->il.x.rtl = ggc_alloc_cleared_rtl_bb_info ();
bb->il.x.rtl = ggc_cleared_alloc<rtl_bb_info> ();
}
/* Returns true if it is possible to remove edge E by redirecting

View File

@ -198,7 +198,7 @@ insert_new_cgraph_node_version (struct cgraph_node *node)
void **slot;
version_info_node = NULL;
version_info_node = ggc_alloc_cleared_cgraph_function_version_info ();
version_info_node = ggc_cleared_alloc<cgraph_function_version_info> ();
version_info_node->this_node = node;
if (cgraph_fnver_htab == NULL)
@ -507,7 +507,7 @@ cgraph_allocate_node (void)
}
else
{
node = ggc_alloc_cleared_cgraph_node ();
node = ggc_cleared_alloc<cgraph_node> ();
node->uid = cgraph_max_uid++;
}
@ -865,7 +865,7 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
}
else
{
edge = ggc_alloc_cgraph_edge ();
edge = ggc_alloc<struct cgraph_edge> ();
edge->uid = cgraph_edge_max_uid++;
}
@ -937,7 +937,7 @@ cgraph_allocate_init_indirect_info (void)
{
struct cgraph_indirect_call_info *ii;
ii = ggc_alloc_cleared_cgraph_indirect_call_info ();
ii = ggc_cleared_alloc<cgraph_indirect_call_info> ();
ii->param_index = -1;
return ii;
}

View File

@ -146,7 +146,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
if (e->indirect_info)
{
new_edge->indirect_info
= ggc_alloc_cleared_cgraph_indirect_call_info ();
= ggc_cleared_alloc<cgraph_indirect_call_info> ();
*new_edge->indirect_info = *e->indirect_info;
}
}

View File

@ -570,7 +570,7 @@ add_asm_node (tree asm_str)
{
struct asm_node *node;
node = ggc_alloc_cleared_asm_node ();
node = ggc_cleared_alloc<asm_node> ();
node->asm_str = asm_str;
node->order = symtab_order++;
node->next = NULL;
@ -1337,7 +1337,7 @@ init_lowered_empty_function (tree decl, bool in_ssa)
cfun->curr_properties |= (PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_any
| PROP_cfg | PROP_loops);
set_loops_for_fn (cfun, ggc_alloc_cleared_loops ());
set_loops_for_fn (cfun, ggc_cleared_alloc<loops> ());
init_loops_structure (cfun, loops_for_fn (cfun), 1);
loops_for_fn (cfun)->state |= LOOPS_MAY_HAVE_MULTIPLE_LATCHES;

View File

@ -6235,7 +6235,7 @@ static struct machine_function *
aarch64_init_machine_status (void)
{
struct machine_function *machine;
machine = ggc_alloc_cleared_machine_function ();
machine = ggc_cleared_alloc<machine_function> ();
return machine;
}

View File

@ -4748,7 +4748,7 @@ struct GTY(()) machine_function
static struct machine_function *
alpha_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Support for frame based VMS condition handlers. */
@ -9576,7 +9576,7 @@ alpha_use_linkage (rtx func, bool lflag, bool rflag)
linksym = (char *) alloca (buf_len);
snprintf (linksym, buf_len, "$%d..%s..lk", cfun->funcdef_no, name);
al = ggc_alloc_alpha_links ();
al = ggc_alloc<alpha_links> ();
al->func = func;
al->linkage = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (linksym));

View File

@ -8722,7 +8722,7 @@ static struct machine_function *
arc_init_machine_status (void)
{
struct machine_function *machine;
machine = ggc_alloc_cleared_machine_function ();
machine = ggc_cleared_alloc<machine_function> ();
machine->fn_type = ARC_FUNCTION_UNKNOWN;
machine->force_short_suffix = -1;

View File

@ -26710,7 +26710,7 @@ static struct machine_function *
arm_init_machine_status (void)
{
struct machine_function *machine;
machine = ggc_alloc_cleared_machine_function ();
machine = ggc_cleared_alloc<machine_function> ();
#if ARM_FT_UNKNOWN != 0
machine->func_type = ARM_FT_UNKNOWN;

View File

@ -359,7 +359,7 @@ avr_option_override (void)
static struct machine_function *
avr_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}

View File

@ -2317,7 +2317,7 @@ bfin_class_likely_spilled_p (reg_class_t rclass)
static struct machine_function *
bfin_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implement the TARGET_OPTION_OVERRIDE hook. */

View File

@ -205,7 +205,7 @@ unsigned const dbx_register_map[FIRST_PSEUDO_REGISTER] =
static struct machine_function *
c6x_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implement TARGET_OPTION_OVERRIDE. */

View File

@ -2808,7 +2808,7 @@ cris_init_expanders (void)
static struct machine_function *
cris_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Split a 2 word move (DI or presumably DF) into component parts.

View File

@ -561,7 +561,7 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
}
else
{
p = ggc_alloc_machopic_indirection ();
p = ggc_alloc<machopic_indirection> ();
p->symbol = sym_ref;
p->ptr_name = xstrdup (buffer);
p->stub_p = stub_p;
@ -3499,7 +3499,7 @@ darwin_build_constant_cfstring (tree str)
}
}
*loc = desc = ggc_alloc_cleared_cfstring_descriptor ();
*loc = desc = ggc_cleared_alloc<cfstring_descriptor> ();
desc->literal = str;
/* isa *. */
@ -3586,7 +3586,7 @@ darwin_enter_string_into_cfstring_table (tree str)
if (!*loc)
{
*loc = ggc_alloc_cleared_cfstring_descriptor ();
*loc = ggc_cleared_alloc<cfstring_descriptor> ();
((struct cfstring_descriptor *)*loc)->literal = str;
}
}

View File

@ -982,7 +982,7 @@ epiphany_init_machine_status (void)
/* Reset state info for each function. */
current_frame_info = zero_frame_info;
machine = ggc_alloc_cleared_machine_function_t ();
machine = ggc_cleared_alloc<machine_function_t> ();
return machine;
}

View File

@ -7009,7 +7009,7 @@ frv_assemble_integer (rtx value, unsigned int size, int aligned_p)
static struct machine_function *
frv_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implement TARGET_SCHED_ISSUE_RATE. */

View File

@ -13673,7 +13673,7 @@ get_dllimport_decl (tree decl, bool beimport)
if (h)
return h->to;
*loc = h = ggc_alloc_tree_map ();
*loc = h = ggc_alloc<tree_map> ();
h->hash = in.hash;
h->base.from = decl;
h->to = to = build_decl (DECL_SOURCE_LOCATION (decl),
@ -25035,7 +25035,7 @@ ix86_init_machine_status (void)
{
struct machine_function *f;
f = ggc_alloc_cleared_machine_function ();
f = ggc_cleared_alloc<machine_function> ();
f->use_fast_prologue_epilogue_nregs = -1;
f->call_abi = ix86_abi;
@ -25059,7 +25059,7 @@ assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
if (s->mode == mode && s->n == n)
return validize_mem (copy_rtx (s->rtl));
s = ggc_alloc_stack_local_entry ();
s = ggc_alloc<stack_local_entry> ();
s->n = n;
s->mode = mode;
s->rtl = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);

View File

@ -649,7 +649,7 @@ i386_pe_record_external_function (tree decl, const char *name)
{
struct extern_list *p;
p = ggc_alloc_extern_list ();
p = ggc_alloc<extern_list> ();
p->next = extern_head;
p->decl = decl;
p->name = name;
@ -700,7 +700,7 @@ i386_pe_maybe_record_exported_symbol (tree decl, const char *name, int is_data)
gcc_assert (TREE_PUBLIC (decl));
p = ggc_alloc_export_list ();
p = ggc_alloc<export_list> ();
p->next = export_head;
p->name = name;
p->is_data = is_data;
@ -724,7 +724,7 @@ i386_pe_record_stub (const char *name)
p = p->next;
}
p = ggc_alloc_stub_list ();
p = ggc_alloc<stub_list> ();
p->next = stub_head;
p->name = name;
stub_head = p;

View File

@ -6046,7 +6046,7 @@ void ia64_init_expanders (void)
static struct machine_function *
ia64_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
static enum attr_itanium_class ia64_safe_itanium_class (rtx);

View File

@ -1424,7 +1424,7 @@ iq2000_va_start (tree valist, rtx nextarg)
static struct machine_function *
iq2000_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Detect any conflicts in the switches. */

View File

@ -460,7 +460,7 @@ m32c_override_options_after_change (void)
static struct machine_function *
m32c_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implements INIT_EXPANDERS. We just set up to call the above
@ -3075,7 +3075,7 @@ m32c_note_pragma_address (const char *varname, unsigned address)
if (!*slot)
{
*slot = ggc_alloc_pragma_entry ();
*slot = ggc_alloc<pragma_entry> ();
(*slot)->varname = ggc_strdup (varname);
}
(*slot)->address = address;

View File

@ -2225,7 +2225,7 @@ mep_register_move_cost (enum machine_mode mode, enum reg_class from, enum reg_cl
static struct machine_function *
mep_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
static rtx
@ -4099,7 +4099,7 @@ mep_note_pragma_flag (const char *funcname, int flag)
if (!*slot)
{
*slot = ggc_alloc_pragma_entry ();
*slot = ggc_alloc<pragma_entry> ();
(*slot)->flag = 0;
(*slot)->used = 0;
(*slot)->funcname = ggc_strdup (funcname);

View File

@ -1241,7 +1241,7 @@ mflip_mips16_use_mips16_p (tree decl)
if (!entry)
{
mips16_flipper = !mips16_flipper;
entry = ggc_alloc_mflip_mips16_entry ();
entry = ggc_alloc<mflip_mips16_entry> ();
entry->name = name;
entry->mips16_p = mips16_flipper ? !base_is_mips16 : base_is_mips16;
*slot = entry;
@ -6451,7 +6451,7 @@ mips16_local_alias (rtx func)
SYMBOL_REF_FLAGS (local) = SYMBOL_REF_FLAGS (func) | SYMBOL_FLAG_LOCAL;
/* Create a new structure to represent the mapping. */
alias = ggc_alloc_mips16_local_alias ();
alias = ggc_alloc<struct mips16_local_alias> ();
alias->func = func;
alias->local = local;
*slot = alias;
@ -16829,7 +16829,7 @@ mips_set_current_function (tree fndecl)
static struct machine_function *
mips_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Return the processor associated with the given ISA level, or null

View File

@ -313,7 +313,7 @@ mmix_init_expanders (void)
static struct machine_function *
mmix_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* DATA_ABI_ALIGNMENT.

View File

@ -229,7 +229,7 @@ struct GTY(()) machine_function
static struct machine_function *
moxie_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}

View File

@ -90,7 +90,7 @@ msp430_init_machine_status (void)
{
struct machine_function *m;
m = ggc_alloc_cleared_machine_function ();
m = ggc_cleared_alloc<machine_function> ();
return m;
}

View File

@ -131,7 +131,7 @@ static struct machine_function *
nds32_init_machine_status (void)
{
struct machine_function *machine;
machine = ggc_alloc_cleared_machine_function ();
machine = ggc_cleared_alloc<machine_function> ();
/* Initially assume this function needs prologue/epilogue. */
machine->naked_p = 0;

View File

@ -986,7 +986,7 @@ nios2_handle_custom_fpu_insn_option (int fpu_insn_index)
static struct machine_function *
nios2_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implement TARGET_OPTION_OVERRIDE. */

View File

@ -668,7 +668,7 @@ pa_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
static struct machine_function *
pa_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* If FROM is a probable pointer register, mark TO as a probable
@ -5583,7 +5583,7 @@ pa_get_deferred_plabel (rtx symbol)
tree id;
if (deferred_plabels == 0)
deferred_plabels = ggc_alloc_deferred_plabel ();
deferred_plabels = ggc_alloc<deferred_plabel> ();
else
deferred_plabels = GGC_RESIZEVEC (struct deferred_plabel,
deferred_plabels,

View File

@ -111,7 +111,7 @@ rl78_init_machine_status (void)
{
struct machine_function *m;
m = ggc_alloc_cleared_machine_function ();
m = ggc_cleared_alloc<machine_function> ();
m->virt_insns_ok = 1;
return m;

View File

@ -15103,7 +15103,7 @@ builtin_function_type (enum machine_mode mode_ret, enum machine_mode mode_arg0,
found = htab_find_slot (builtin_hash_table, &h, INSERT);
if (*found == NULL)
{
h2 = ggc_alloc_builtin_hash_struct ();
h2 = ggc_alloc<builtin_hash_struct> ();
*h2 = h;
*found = (void *)h2;
@ -17635,7 +17635,7 @@ static struct machine_function *
rs6000_init_machine_status (void)
{
stack_info.reload_completed = 0;
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
#define INT_P(X) (GET_CODE (X) == CONST_INT && GET_MODE (X) == VOIDmode)
@ -25459,7 +25459,7 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode)
toc_hash_table = htab_create_ggc (1021, toc_hash_function,
toc_hash_eq, NULL);
h = ggc_alloc_toc_hash_struct ();
h = ggc_alloc<toc_hash_struct> ();
h->key = x;
h->key_mode = mode;
h->labelno = labelno;

View File

@ -1675,7 +1675,7 @@ s390_narrow_logical_operator (enum rtx_code code, rtx *memop, rtx *immop)
static struct machine_function *
s390_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Map for smallest class containing reg regno. */

View File

@ -1199,7 +1199,7 @@ score_output_external (FILE *file ATTRIBUTE_UNUSED,
if (score_in_small_data_p (decl))
{
p = ggc_alloc_extern_list ();
p = ggc_alloc<extern_list> ();
p->next = extern_head;
p->name = name;
p->size = int_size_in_bytes (TREE_TYPE (decl));

View File

@ -11478,7 +11478,7 @@ sparc_can_output_mi_thunk (const_tree thunk_fndecl ATTRIBUTE_UNUSED,
static struct machine_function *
sparc_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Locate some local-dynamic symbol still in use by this function

View File

@ -223,7 +223,7 @@ struct GTY(()) machine_function
static struct machine_function *
spu_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}
/* Implement TARGET_OPTION_OVERRIDE. */

View File

@ -735,7 +735,7 @@ create_temp_reg_if_possible (enum machine_mode mode, rtx default_reg)
static struct machine_function *
tilegx_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}

View File

@ -674,7 +674,7 @@ create_temp_reg_if_possible (enum machine_mode mode, rtx default_reg)
static struct machine_function *
tilepro_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}

View File

@ -1355,7 +1355,7 @@ xtensa_expand_nonlocal_goto (rtx *operands)
static struct machine_function *
xtensa_init_machine_status (void)
{
return ggc_alloc_cleared_machine_function ();
return ggc_cleared_alloc<machine_function> ();
}

View File

@ -667,7 +667,7 @@ coverage_end_function (unsigned lineno_checksum, unsigned cfg_checksum)
list. */
if (!DECL_EXTERNAL (current_function_decl))
{
item = ggc_alloc_coverage_data ();
item = ggc_alloc<coverage_data> ();
item->ident = current_function_funcdef_no + 1;
item->lineno_checksum = lineno_checksum;

View File

@ -1,3 +1,41 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* class.c (sorted_fields_type_new): Adjust.
* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
* cp-tree.h: Remove usage of variable_size gty attribute.
* decl.c (make_label_decl): Adjust.
(check_goto): Likewise.
(start_preparsed_function): Likewise.
(save_function_data): Likewise.
* lex.c (init_reswords): Likewise.
(retrofit_lang_decl): Likewise.
(cxx_dup_lang_specific_decl): Likewise.
(copy_lang_type): Likewise.
(cxx_make_type): Likewise.
* name-lookup.c (binding_entry_make): Likewise.
(binding_table_construct): Likewise.
(binding_table_new): Likewise.
(cxx_binding_make): Likewise.
(pushdecl_maybe_friend_1): Likewise.
(begin_scope): Likewise.
(push_to_top_level): Likewise.
* parser.c (cp_lexer_alloc): Likewise.
(cp_lexer_new_from_tokens): Likewise.
(cp_token_cache_new): Likewise.
(cp_parser_context_new): Likewise.
(cp_parser_new): Likewise.
(cp_parser_nested_name_specifier_opt): Likewise.
(cp_parser_template_id): Likewise.
* pt.c (maybe_process_partial_specialization): Likewise.
(register_specialization): Likewise.
(add_pending_template): Likewise.
(lookup_template_class_1): Likewise.
(push_tinst_level): Likewise.
* semantics.c (register_constexpr_fundef): Likewise.
(cxx_eval_call_expression): Likewise.
* typeck2.c (abstract_virtuals_error_sfinae): Likewise.
2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51640

View File

@ -6487,7 +6487,7 @@ static struct sorted_fields_type *
sorted_fields_type_new (int n)
{
struct sorted_fields_type *sft;
sft = ggc_alloc_sorted_fields_type (sizeof (struct sorted_fields_type)
sft = (sorted_fields_type *) ggc_internal_alloc (sizeof (sorted_fields_type)
+ n * sizeof (tree));
sft->len = n;

View File

@ -118,7 +118,7 @@ cilk_install_body_with_frame_cleanup (tree fndecl, tree orig_body, void *wd)
tree dtor = create_cilk_function_exit (frame, false, false);
add_local_decl (cfun, frame);
cfun->language = ggc_alloc_cleared_language_function ();
cfun->language = ggc_cleared_alloc<language_function> ();
location_t loc = EXPR_LOCATION (orig_body);
tree list = alloc_stmt_list ();

View File

@ -208,7 +208,7 @@ decl_shadowed_for_var_insert (tree from, tree to)
struct tree_decl_map *h;
void **loc;
h = ggc_alloc_tree_decl_map ();
h = ggc_alloc<tree_decl_map> ();
h->base.from = from;
h->to = to;
loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, DECL_UID (from),

View File

@ -1484,7 +1484,7 @@ struct GTY(()) lang_type_ptrmem {
tree record;
};
struct GTY((variable_size)) lang_type {
struct GTY(()) lang_type {
union lang_type_u
{
struct lang_type_header GTY((skip (""))) h;
@ -2062,7 +2062,7 @@ struct GTY(()) lang_decl_parm {
union rather than a struct containing a union as its only field, but
tree.h declares it as a struct. */
struct GTY((variable_size)) lang_decl {
struct GTY(()) lang_decl {
union GTY((desc ("%h.base.selector"))) lang_decl_u {
struct lang_decl_base GTY ((default)) base;
struct lang_decl_min GTY((tag ("0"))) min;
@ -3591,7 +3591,8 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
do { \
if (TYPE_LANG_SPECIFIC (NODE) == NULL) \
{ \
TYPE_LANG_SPECIFIC (NODE) = ggc_alloc_cleared_lang_type \
TYPE_LANG_SPECIFIC (NODE) \
= (struct lang_type *) ggc_internal_cleared_alloc \
(sizeof (struct lang_type_ptrmem)); \
TYPE_LANG_SPECIFIC (NODE)->u.ptrmem.h.is_lang_type_class = 0; \
} \

View File

@ -2700,7 +2700,7 @@ make_label_decl (tree id, int local_p)
/* Record this label on the list of labels used in this function.
We do this before calling make_label_decl so that we get the
IDENTIFIER_LABEL_VALUE before the new label is declared. */
ent = ggc_alloc_cleared_named_label_entry ();
ent = ggc_cleared_alloc<named_label_entry> ();
ent->label_decl = decl;
slot = htab_find_slot (named_labels, ent, INSERT);
@ -2931,7 +2931,7 @@ check_goto (tree decl)
&& ent->uses->names_in_scope == current_binding_level->names)
return;
new_use = ggc_alloc_named_label_use_entry ();
new_use = ggc_alloc<named_label_use_entry> ();
new_use->binding_level = current_binding_level;
new_use->names_in_scope = current_binding_level->names;
new_use->o_goto_locus = input_location;
@ -13303,7 +13303,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
/* Initialize the language data structures. Whenever we start
a new function, we destroy temporaries in the usual way. */
cfun->language = ggc_alloc_cleared_language_function ();
cfun->language = ggc_cleared_alloc<language_function> ();
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
current_binding_level = bl;
@ -13608,7 +13608,7 @@ save_function_data (tree decl)
gcc_assert (!DECL_PENDING_INLINE_P (decl));
/* Make a copy. */
f = ggc_alloc_language_function ();
f = ggc_alloc<language_function> ();
memcpy (f, cp_function_chain, sizeof (struct language_function));
DECL_SAVED_FUNCTION_DATA (decl) = f;

View File

@ -182,7 +182,7 @@ init_reswords (void)
/* The Objective-C keywords are all context-dependent. */
mask |= D_OBJC;
ridpointers = ggc_alloc_cleared_vec_tree ((int) RID_MAX);
ridpointers = ggc_cleared_vec_alloc<tree> ((int) RID_MAX);
for (i = 0; i < num_c_common_reswords; i++)
{
if (c_common_reswords[i].disable & D_CONLY)
@ -555,7 +555,7 @@ retrofit_lang_decl (tree t)
else
gcc_unreachable ();
ld = ggc_alloc_cleared_lang_decl (size);
ld = (struct lang_decl *) ggc_internal_cleared_alloc (size);
ld->u.base.selector = sel;
@ -597,7 +597,7 @@ cxx_dup_lang_specific_decl (tree node)
else
gcc_unreachable ();
ld = ggc_alloc_lang_decl (size);
ld = (struct lang_decl *) ggc_internal_alloc (size);
memcpy (ld, DECL_LANG_SPECIFIC (node), size);
DECL_LANG_SPECIFIC (node) = ld;
@ -635,7 +635,7 @@ copy_lang_type (tree node)
size = sizeof (struct lang_type);
else
size = sizeof (struct lang_type_ptrmem);
lt = ggc_alloc_lang_type (size);
lt = (struct lang_type *) ggc_internal_alloc (size);
memcpy (lt, TYPE_LANG_SPECIFIC (node), size);
TYPE_LANG_SPECIFIC (node) = lt;
@ -668,7 +668,8 @@ cxx_make_type (enum tree_code code)
|| code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
struct lang_type *pi
= ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
= (struct lang_type *) ggc_internal_cleared_alloc
(sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (t) = pi;
pi->u.c.h.is_lang_type_class = 1;

View File

@ -105,7 +105,7 @@ binding_entry_make (tree name, tree type)
free_binding_entry = entry->chain;
}
else
entry = ggc_alloc_binding_entry_s ();
entry = ggc_alloc<binding_entry_s> ();
entry->name = name;
entry->type = type;
@ -147,7 +147,7 @@ binding_table_construct (binding_table table, size_t chain_count)
{
table->chain_count = chain_count;
table->entry_count = 0;
table->chain = ggc_alloc_cleared_vec_binding_entry (table->chain_count);
table->chain = ggc_cleared_vec_alloc<binding_entry> (table->chain_count);
}
/* Make TABLE's entries ready for reuse. */
@ -181,7 +181,7 @@ binding_table_free (binding_table table)
static inline binding_table
binding_table_new (size_t chain_count)
{
binding_table table = ggc_alloc_binding_table_s ();
binding_table table = ggc_alloc<binding_table_s> ();
table->chain = NULL;
binding_table_construct (table, chain_count);
return table;
@ -299,7 +299,7 @@ cxx_binding_make (tree value, tree type)
free_bindings = binding->previous;
}
else
binding = ggc_alloc_cxx_binding ();
binding = ggc_alloc<cxx_binding> ();
cxx_binding_init (binding, value, type);
@ -775,7 +775,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
= htab_create_ggc (20, cxx_int_tree_map_hash,
cxx_int_tree_map_eq, NULL);
h = ggc_alloc_cxx_int_tree_map ();
h = ggc_alloc<cxx_int_tree_map> ();
h->uid = DECL_UID (x);
h->to = t;
loc = htab_find_slot_with_hash
@ -1544,7 +1544,7 @@ begin_scope (scope_kind kind, tree entity)
free_binding_level = scope->level_chain;
}
else
scope = ggc_alloc_cleared_cp_binding_level ();
scope = ggc_cleared_alloc<cp_binding_level> ();
scope->this_entity = entity;
scope->more_cleanups_ok = true;
@ -6074,7 +6074,7 @@ push_to_top_level (void)
bool need_pop;
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
s = ggc_alloc_cleared_saved_scope ();
s = ggc_cleared_alloc<saved_scope> ();
b = scope_chain ? current_binding_level : 0;

View File

@ -602,7 +602,7 @@ cp_lexer_alloc (void)
c_common_no_more_pch ();
/* Allocate the memory. */
lexer = ggc_alloc_cleared_cp_lexer ();
lexer = ggc_cleared_alloc<cp_lexer> ();
/* Initially we are not debugging. */
lexer->debugging_p = false;
@ -665,7 +665,7 @@ cp_lexer_new_from_tokens (cp_token_cache *cache)
{
cp_token *first = cache->first;
cp_token *last = cache->last;
cp_lexer *lexer = ggc_alloc_cleared_cp_lexer ();
cp_lexer *lexer = ggc_cleared_alloc<cp_lexer> ();
/* We do not own the buffer. */
lexer->buffer = NULL;
@ -1240,7 +1240,7 @@ cp_lexer_stop_debugging (cp_lexer* lexer)
static cp_token_cache *
cp_token_cache_new (cp_token *first, cp_token *last)
{
cp_token_cache *cache = ggc_alloc_cp_token_cache ();
cp_token_cache *cache = ggc_alloc<cp_token_cache> ();
cache->first = first;
cache->last = last;
return cache;
@ -1822,7 +1822,7 @@ cp_parser_context_new (cp_parser_context* next)
memset (context, 0, sizeof (*context));
}
else
context = ggc_alloc_cleared_cp_parser_context ();
context = ggc_cleared_alloc<cp_parser_context> ();
/* No errors have occurred yet in this context. */
context->status = CP_PARSER_STATUS_KIND_NO_ERROR;
@ -3421,7 +3421,7 @@ cp_parser_new (void)
for (i = 0; i < sizeof (binops) / sizeof (binops[0]); i++)
binops_by_token[binops[i].token_type] = binops[i];
parser = ggc_alloc_cleared_cp_parser ();
parser = ggc_cleared_alloc<cp_parser> ();
parser->lexer = lexer;
parser->context = cp_parser_context_new (NULL);
@ -5435,7 +5435,7 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
token->type = CPP_NESTED_NAME_SPECIFIER;
/* Retrieve any deferred checks. Do not pop this access checks yet
so the memory will not be reclaimed during token replacing below. */
token->u.tree_check_value = ggc_alloc_cleared_tree_check ();
token->u.tree_check_value = ggc_cleared_alloc<struct tree_check> ();
token->u.tree_check_value->value = parser->scope;
token->u.tree_check_value->checks = get_deferred_access_checks ();
token->u.tree_check_value->qualifying_scope =
@ -13510,7 +13510,7 @@ cp_parser_template_id (cp_parser *parser,
token->type = CPP_TEMPLATE_ID;
/* Retrieve any deferred checks. Do not pop this access checks yet
so the memory will not be reclaimed during token replacing below. */
token->u.tree_check_value = ggc_alloc_cleared_tree_check ();
token->u.tree_check_value = ggc_cleared_alloc<struct tree_check> ();
token->u.tree_check_value->value = template_id;
token->u.tree_check_value->checks = get_deferred_access_checks ();
token->keyword = RID_MAX;

View File

@ -944,7 +944,7 @@ maybe_process_partial_specialization (tree type)
elt.args = INNERMOST_TEMPLATE_ARGS (elt.args);
slot = htab_find_slot (type_specializations, &elt, INSERT);
entry = ggc_alloc_spec_entry ();
entry = ggc_alloc<spec_entry> ();
*entry = elt;
*slot = entry;
}
@ -1481,7 +1481,7 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend,
if (slot != NULL /* !optimize_specialization_lookup_p (tmpl) */)
{
spec_entry *entry = ggc_alloc_spec_entry ();
spec_entry *entry = ggc_alloc<spec_entry> ();
gcc_assert (tmpl && args && spec);
*entry = elt;
*slot = entry;
@ -7207,7 +7207,7 @@ add_pending_template (tree d)
if (level)
push_tinst_level (d);
pt = ggc_alloc_pending_template ();
pt = ggc_alloc<pending_template> ();
pt->next = NULL;
pt->tinst = current_tinst_level;
if (last_pending_template)
@ -7837,7 +7837,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
elt.spec = t;
slot = htab_find_slot_with_hash (type_specializations,
&elt, hash, INSERT);
entry = ggc_alloc_spec_entry ();
entry = ggc_alloc<spec_entry> ();
*entry = elt;
*slot = entry;
@ -8262,7 +8262,7 @@ push_tinst_level (tree d)
if (limit_bad_template_recursion (d))
return 0;
new_level = ggc_alloc_tinst_level ();
new_level = ggc_alloc<tinst_level> ();
new_level->decl = d;
new_level->locus = input_location;
new_level->errors = errorcount+sorrycount;

View File

@ -8024,7 +8024,7 @@ register_constexpr_fundef (tree fun, tree body)
htab_find_slot (constexpr_fundef_table, &entry, INSERT);
gcc_assert (*slot == NULL);
*slot = ggc_alloc_constexpr_fundef ();
*slot = ggc_alloc<constexpr_fundef> ();
**slot = entry;
return fun;
@ -8468,7 +8468,7 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t,
{
/* We need to keep a pointer to the entry, not just the slot, as the
slot can move in the call to cxx_eval_builtin_function_call. */
*slot = entry = ggc_alloc_constexpr_call ();
*slot = entry = ggc_alloc<constexpr_call> ();
*entry = new_call;
}
/* Calls which are in progress have their result set to NULL

View File

@ -294,7 +294,7 @@ abstract_virtuals_error_sfinae (tree decl, tree type, abstract_class_use use,
slot = htab_find_slot_with_hash (abstract_pending_vars, type,
(hashval_t)TYPE_UID (type), INSERT);
pat = ggc_alloc_pending_abstract_type ();
pat = ggc_alloc<pending_abstract_type> ();
pat->type = type;
pat->decl = decl;
pat->use = use;

View File

@ -976,7 +976,7 @@ dbxout_init (const char *input_file_name)
const char *mapped_name;
typevec_len = 100;
typevec = ggc_alloc_cleared_vec_typeinfo (typevec_len);
typevec = ggc_cleared_vec_alloc<typeinfo> (typevec_len);
/* stabstr_ob contains one string, which will be just fine with
1-byte alignment. */

View File

@ -382,38 +382,6 @@ of pointers. @code{reorder} functions can be expensive. When
possible, it is better to depend on properties of the data, like an ID
number or the hash of a string instead.
@findex variable_size
@item variable_size
The type machinery expects the types to be of constant size. When this
is not true, for example, with structs that have array fields or unions,
the type machinery cannot tell how many bytes need to be allocated at
each allocation. The @code{variable_size} is used to mark such types.
The type machinery then provides allocators that take a parameter
indicating an exact size of object being allocated. Note that the size
must be provided in bytes whereas the @code{length} option works with
array lengths in number of elements.
For example,
@smallexample
struct GTY((variable_size)) sorted_fields_type @{
int len;
tree GTY((length ("%h.len"))) elts[1];
@};
@end smallexample
Then the objects of @code{struct sorted_fields_type} are allocated in GC
memory as follows:
@smallexample
field_vec = ggc_alloc_sorted_fields_type (size);
@end smallexample
If @var{field_vec->elts} stores @var{n} elements, then @var{size}
could be calculated as follows:
@smallexample
size_t size = sizeof (struct sorted_fields_type) + n * sizeof (tree);
@end smallexample
@findex atomic
@item atomic

View File

@ -356,7 +356,7 @@ need_data_align_sf_opcode (HOST_WIDE_INT off)
static inline dw_cfi_ref
new_cfi (void)
{
dw_cfi_ref cfi = ggc_alloc_dw_cfi_node ();
dw_cfi_ref cfi = ggc_alloc<dw_cfi_node> ();
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
cfi->dw_cfi_oprnd2.dw_cfi_reg_num = 0;
@ -369,7 +369,7 @@ new_cfi (void)
static dw_cfi_row *
new_cfi_row (void)
{
dw_cfi_row *row = ggc_alloc_cleared_dw_cfi_row ();
dw_cfi_row *row = ggc_cleared_alloc<dw_cfi_row> ();
row->cfa.reg = INVALID_REGNUM;
@ -381,7 +381,7 @@ new_cfi_row (void)
static dw_cfi_row *
copy_cfi_row (dw_cfi_row *src)
{
dw_cfi_row *dst = ggc_alloc_dw_cfi_row ();
dw_cfi_row *dst = ggc_alloc<dw_cfi_row> ();
*dst = *src;
dst->reg_save = vec_safe_copy (src->reg_save);
@ -2892,7 +2892,7 @@ create_cie_data (void)
case 0:
break;
case 1:
cie_return_save = ggc_alloc_reg_saved_in_data ();
cie_return_save = ggc_alloc<reg_saved_in_data> ();
*cie_return_save = cie_trace.regs_saved_in_regs[0];
cie_trace.regs_saved_in_regs.release ();
break;

View File

@ -992,7 +992,7 @@ dwarf2out_alloc_current_fde (void)
{
dw_fde_ref fde;
fde = ggc_alloc_cleared_dw_fde_node ();
fde = ggc_cleared_alloc<dw_fde_node> ();
fde->decl = current_function_decl;
fde->funcdef_number = current_function_funcdef_no;
fde->fde_index = vec_safe_length (fde_vec);
@ -1315,7 +1315,7 @@ static inline dw_loc_descr_ref
new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INT oprnd1,
unsigned HOST_WIDE_INT oprnd2)
{
dw_loc_descr_ref descr = ggc_alloc_cleared_dw_loc_descr_node ();
dw_loc_descr_ref descr = ggc_cleared_alloc<dw_loc_descr_node> ();
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@ -3814,7 +3814,7 @@ add_AT_wide (dw_die_ref die, enum dwarf_attribute attr_kind,
attr.dw_attr = attr_kind;
attr.dw_attr_val.val_class = dw_val_class_wide_int;
attr.dw_attr_val.v.val_wide = ggc_alloc_cleared_wide_int ();
attr.dw_attr_val.v.val_wide = ggc_cleared_alloc<wide_int> ();
*attr.dw_attr_val.v.val_wide = w;
add_dwarf_attr (die, &attr);
}
@ -3933,7 +3933,7 @@ find_AT_string_in_table (const char *str, htab_t table)
htab_hash_string (str), INSERT);
if (*slot == NULL)
{
node = ggc_alloc_cleared_indirect_string_node ();
node = ggc_cleared_alloc<indirect_string_node> ();
node->str = ggc_strdup (str);
*slot = node;
}
@ -4264,7 +4264,7 @@ add_addr_table_entry (void *addr, enum ate_kind kind)
if (*slot == HTAB_EMPTY_ENTRY)
{
node = ggc_alloc_cleared_addr_table_entry ();
node = ggc_cleared_alloc<addr_table_entry> ();
init_addr_table_entry (node, kind, addr);
*slot = node;
}
@ -4840,7 +4840,7 @@ splice_child_die (dw_die_ref parent, dw_die_ref child)
static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
dw_die_ref die = ggc_alloc_cleared_die_node ();
dw_die_ref die = ggc_cleared_alloc<die_node> ();
die->die_tag = tag_value;
@ -4850,7 +4850,7 @@ new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
limbo_die_node *limbo_node;
limbo_node = ggc_alloc_cleared_limbo_die_node ();
limbo_node = ggc_cleared_alloc<limbo_die_node> ();
limbo_node->die = die;
limbo_node->created_for = t;
limbo_node->next = limbo_die_list;
@ -5167,7 +5167,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
slot = htab_find_slot_with_hash (decl_loc_table, decl, decl_id, INSERT);
if (*slot == NULL)
{
temp = ggc_alloc_cleared_var_loc_list ();
temp = ggc_cleared_alloc<var_loc_list> ();
temp->decl_id = decl_id;
*slot = temp;
}
@ -5192,7 +5192,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
|| (NOTE_VAR_LOCATION_STATUS (temp->first->loc)
!= NOTE_VAR_LOCATION_STATUS (loc_note))))
{
loc = ggc_alloc_cleared_var_loc_node ();
loc = ggc_cleared_alloc<var_loc_node> ();
temp->first->next = loc;
temp->last = loc;
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
@ -5282,7 +5282,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
memset (loc, '\0', sizeof (*loc));
}
else
loc = ggc_alloc_cleared_var_loc_node ();
loc = ggc_cleared_alloc<var_loc_node> ();
if (bitsize == -1 || piece_loc == NULL)
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
else
@ -5299,7 +5299,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
}
else
{
loc = ggc_alloc_cleared_var_loc_node ();
loc = ggc_cleared_alloc<var_loc_node> ();
temp->first = loc;
temp->last = loc;
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
@ -6955,7 +6955,7 @@ clone_die (dw_die_ref die)
dw_attr_ref a;
unsigned ix;
clone = ggc_alloc_cleared_die_node ();
clone = ggc_cleared_alloc<die_node> ();
clone->die_tag = die->die_tag;
FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
@ -7001,7 +7001,7 @@ clone_as_declaration (dw_die_ref die)
return clone;
}
clone = ggc_alloc_cleared_die_node ();
clone = ggc_cleared_alloc<die_node> ();
clone->die_tag = die->die_tag;
FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
@ -7361,7 +7361,7 @@ break_out_comdat_types (dw_die_ref die)
unit = new_die (DW_TAG_type_unit, NULL, NULL);
add_AT_unsigned (unit, DW_AT_language,
get_AT_unsigned (comp_unit_die (), DW_AT_language));
type_node = ggc_alloc_cleared_comdat_type_node ();
type_node = ggc_cleared_alloc<comdat_type_node> ();
type_node->root_die = unit;
type_node->next = comdat_type_list;
comdat_type_list = type_node;
@ -8455,7 +8455,7 @@ static inline dw_loc_list_ref
new_loc_list (dw_loc_descr_ref expr, const char *begin, const char *end,
const char *section)
{
dw_loc_list_ref retlist = ggc_alloc_cleared_dw_loc_list_node ();
dw_loc_list_ref retlist = ggc_cleared_alloc<dw_loc_list_node> ();
retlist->begin = begin;
retlist->begin_entry = NULL;
@ -12964,8 +12964,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
#endif
{
unsigned int length = GET_MODE_SIZE (mode);
unsigned char *array
= (unsigned char*) ggc_alloc_atomic (length);
unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
mem_loc_result->dw_loc_oprnd2.val_class = dw_val_class_vec;
@ -12991,7 +12990,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
mem_loc_result->dw_loc_oprnd1.v.val_die_ref.external = 0;
mem_loc_result->dw_loc_oprnd2.val_class
= dw_val_class_wide_int;
mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc_cleared_wide_int ();
mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
*mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
}
break;
@ -13474,8 +13473,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
#endif
{
unsigned int length = GET_MODE_SIZE (mode);
unsigned char *array
= (unsigned char*) ggc_alloc_atomic (length);
unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
loc_result->dw_loc_oprnd2.val_class = dw_val_class_vec;
@ -13495,7 +13493,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
loc_result = new_loc_descr (DW_OP_implicit_value,
GET_MODE_SIZE (mode), 0);
loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int;
loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc_cleared_wide_int ();
loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
*loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
}
break;
@ -13508,8 +13506,8 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
{
unsigned int elt_size = GET_MODE_UNIT_SIZE (GET_MODE (rtl));
unsigned int length = CONST_VECTOR_NUNITS (rtl);
unsigned char *array = (unsigned char *)
ggc_alloc_atomic (length * elt_size);
unsigned char *array
= ggc_vec_alloc<unsigned char> (length * elt_size);
unsigned int i;
unsigned char *p;
enum machine_mode imode = GET_MODE_INNER (mode);
@ -14058,12 +14056,12 @@ add_loc_descr_to_each (dw_loc_list_ref list, dw_loc_descr_ref ref)
list = list->dw_loc_next;
while (list)
{
copy = ggc_alloc_dw_loc_descr_node ();
copy = ggc_alloc<dw_loc_descr_node> ();
memcpy (copy, ref, sizeof (dw_loc_descr_node));
add_loc_descr (&list->expr, copy);
while (copy->dw_loc_next)
{
dw_loc_descr_ref new_copy = ggc_alloc_dw_loc_descr_node ();
dw_loc_descr_ref new_copy = ggc_alloc<dw_loc_descr_node> ();
memcpy (new_copy, copy->dw_loc_next, sizeof (dw_loc_descr_node));
copy->dw_loc_next = new_copy;
copy = new_copy;
@ -15247,7 +15245,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
else
{
unsigned int length = GET_MODE_SIZE (mode);
unsigned char *array = (unsigned char *) ggc_alloc_atomic (length);
unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
add_AT_vec (die, DW_AT_const_value, length / 4, 4, array);
@ -15260,8 +15258,8 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
enum machine_mode mode = GET_MODE (rtl);
unsigned int elt_size = GET_MODE_UNIT_SIZE (mode);
unsigned int length = CONST_VECTOR_NUNITS (rtl);
unsigned char *array = (unsigned char *) ggc_alloc_atomic
(length * elt_size);
unsigned char *array
= ggc_vec_alloc<unsigned char> (length * elt_size);
unsigned int i;
unsigned char *p;
enum machine_mode imode = GET_MODE_INNER (mode);
@ -15851,7 +15849,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p,
{
slot = htab_find_slot_with_hash (cached_dw_loc_list_table, decl,
DECL_UID (decl), INSERT);
cache = ggc_alloc_cleared_cached_dw_loc_list ();
cache = ggc_cleared_alloc<cached_dw_loc_list> ();
cache->decl_id = DECL_UID (decl);
cache->loc_list = list;
*slot = cache;
@ -16047,8 +16045,7 @@ tree_add_const_value_attribute (dw_die_ref die, tree t)
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (init));
if (size > 0 && (int) size == size)
{
unsigned char *array = (unsigned char *)
ggc_internal_cleared_alloc (size);
unsigned char *array = ggc_cleared_vec_alloc<unsigned char> (size);
if (native_encode_initializer (init, array, size))
{
@ -16316,7 +16313,7 @@ comp_dir_string (void)
int wdlen;
wdlen = strlen (wd);
wd1 = (char *) ggc_alloc_atomic (wdlen + 2);
wd1 = ggc_vec_alloc<char> (wdlen + 2);
strcpy (wd1, wd);
wd1 [wdlen] = DIR_SEPARATOR;
wd1 [wdlen + 1] = 0;
@ -16811,7 +16808,7 @@ add_linkage_name (dw_die_ref die, tree decl)
{
limbo_die_node *asm_name;
asm_name = ggc_alloc_cleared_limbo_die_node ();
asm_name = ggc_cleared_alloc<limbo_die_node> ();
asm_name->die = die;
asm_name->created_for = decl;
asm_name->next = deferred_asm_name;
@ -16864,7 +16861,7 @@ dwarf2out_vms_debug_main_pointer (void)
dw_die_ref die;
/* Allocate the VMS debug main subprogram die. */
die = ggc_alloc_cleared_die_node ();
die = ggc_cleared_alloc<die_node> ();
die->die_tag = DW_TAG_subprogram;
add_name_attribute (die, VMS_DEBUG_MAIN_POINTER);
ASM_GENERATE_INTERNAL_LABEL (label, PROLOGUE_END_LABEL,
@ -21139,7 +21136,7 @@ lookup_filename (const char *file_name)
if (*slot)
return (struct dwarf_file_data *) *slot;
created = ggc_alloc_dwarf_file_data ();
created = ggc_alloc<dwarf_file_data> ();
created->filename = file_name;
created->emitted_number = 0;
*slot = created;
@ -21449,7 +21446,7 @@ dwarf2out_var_location (rtx loc_note)
if (!var_loc_p)
{
struct call_arg_loc_node *ca_loc
= ggc_alloc_cleared_call_arg_loc_node ();
= ggc_cleared_alloc<call_arg_loc_node> ();
rtx prev = prev_real_insn (loc_note), x;
ca_loc->call_arg_loc_note = loc_note;
ca_loc->next = NULL;
@ -21524,7 +21521,7 @@ new_line_info_table (void)
{
dw_line_info_table *table;
table = ggc_alloc_cleared_dw_line_info_table_struct ();
table = ggc_cleared_alloc<dw_line_info_table_struct> ();
table->file_num = 1;
table->line_num = 1;
table->is_stmt = DWARF_LINE_DEFAULT_IS_STMT_START;
@ -22293,7 +22290,7 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
vec_alloc (decl_scope_table, 256);
/* Allocate the initial hunk of the abbrev_die_table. */
abbrev_die_table = ggc_alloc_cleared_vec_dw_die_ref
abbrev_die_table = ggc_cleared_vec_alloc<dw_die_ref>
(ABBREV_DIE_TABLE_INCREMENT);
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused. */
@ -23198,7 +23195,7 @@ string_cst_pool_decl (tree t)
len = TREE_STRING_LENGTH (t);
vec_safe_push (used_rtx_array, rtl);
ref = new_die (DW_TAG_dwarf_procedure, comp_unit_die (), decl);
array = (unsigned char *) ggc_alloc_atomic (len);
array = ggc_vec_alloc<unsigned char> (len);
memcpy (array, TREE_STRING_POINTER (t), len);
l = new_loc_descr (DW_OP_implicit_value, len, 0);
l->dw_loc_oprnd2.val_class = dw_val_class_vec;

View File

@ -319,7 +319,7 @@ set_mem_attrs (rtx mem, mem_attrs *attrs)
if (!MEM_ATTRS (mem)
|| !mem_attrs_eq_p (attrs, MEM_ATTRS (mem)))
{
MEM_ATTRS (mem) = ggc_alloc_mem_attrs ();
MEM_ATTRS (mem) = ggc_alloc<mem_attrs> ();
memcpy (MEM_ATTRS (mem), attrs, sizeof (mem_attrs));
}
}
@ -366,7 +366,7 @@ get_reg_attrs (tree decl, int offset)
slot = htab_find_slot (reg_attrs_htab, &attrs, INSERT);
if (*slot == 0)
{
*slot = ggc_alloc_reg_attrs ();
*slot = ggc_alloc<reg_attrs> ();
memcpy (*slot, &attrs, sizeof (reg_attrs));
}
@ -5243,7 +5243,7 @@ start_sequence (void)
free_sequence_stack = tem->next;
}
else
tem = ggc_alloc_sequence_stack ();
tem = ggc_alloc<sequence_stack> ();
tem->next = seq_stack;
tem->first = get_insns ();
@ -5576,7 +5576,7 @@ init_emit (void)
crtl->emit.regno_pointer_align
= XCNEWVEC (unsigned char, crtl->emit.regno_pointer_align_length);
regno_reg_rtx = ggc_alloc_vec_rtx (crtl->emit.regno_pointer_align_length);
regno_reg_rtx = ggc_vec_alloc<rtx> (crtl->emit.regno_pointer_align_length);
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
@ -5726,7 +5726,7 @@ init_emit_regs (void)
for (i = 0; i < (int) MAX_MACHINE_MODE; i++)
{
mode = (enum machine_mode) i;
attrs = ggc_alloc_cleared_mem_attrs ();
attrs = ggc_cleared_alloc<mem_attrs> ();
attrs->align = BITS_PER_UNIT;
attrs->addrspace = ADDR_SPACE_GENERIC;
if (mode != BLKmode)

View File

@ -333,7 +333,7 @@ init_eh (void)
void
init_eh_for_function (void)
{
cfun->eh = ggc_alloc_cleared_eh_status ();
cfun->eh = ggc_cleared_alloc<eh_status> ();
/* Make sure zero'th entries are used. */
vec_safe_push (cfun->eh->region_array, (eh_region)0);
@ -350,7 +350,7 @@ gen_eh_region (enum eh_region_type type, eh_region outer)
eh_region new_eh;
/* Insert a new blank region as a leaf in the tree. */
new_eh = ggc_alloc_cleared_eh_region_d ();
new_eh = ggc_cleared_alloc<eh_region_d> ();
new_eh->type = type;
new_eh->outer = outer;
if (outer)
@ -407,7 +407,7 @@ gen_eh_region_catch (eh_region t, tree type_or_list)
add_type_for_runtime (TREE_VALUE (type_node));
}
c = ggc_alloc_cleared_eh_catch_d ();
c = ggc_cleared_alloc<eh_catch_d> ();
c->type_list = type_list;
l = t->u.eh_try.last_catch;
c->prev_catch = l;
@ -441,7 +441,7 @@ gen_eh_region_must_not_throw (eh_region outer)
eh_landing_pad
gen_eh_landing_pad (eh_region region)
{
eh_landing_pad lp = ggc_alloc_cleared_eh_landing_pad_d ();
eh_landing_pad lp = ggc_cleared_alloc<eh_landing_pad_d> ();
lp->next_lp = region->landing_pads;
lp->region = region;
@ -2450,7 +2450,7 @@ add_call_site (rtx landing_pad, int action, int section)
{
call_site_record record;
record = ggc_alloc_call_site_record_d ();
record = ggc_alloc<call_site_record_d> ();
record->landing_pad = landing_pad;
record->action = action;

View File

@ -1,3 +1,13 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* f95-lang.c (pushlevel): Adjust.
* trans-decl.c (gfc_allocate_lang_decl): Adjust.
(gfc_find_module): Likewise.
* trans-types.c (gfc_get_nodesc_array_type): Likewise.
(gfc_get_array_type_bounds): Likewise.
(gfc_nonrestricted_type): Likewise.
* trans.h: Don't use variable_size gty attribute.
2014-05-17 Dominique d'Humieres <dominiq@lps.ens.fr>
* check.c (gfc_check_fn_rc2008): move "argument" to the right

View File

@ -323,7 +323,7 @@ getdecls (void)
void
pushlevel (void)
{
struct binding_level *newlevel = ggc_alloc_binding_level ();
struct binding_level *newlevel = ggc_alloc<binding_level> ();
*newlevel = clear_binding_level;

View File

@ -615,8 +615,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
void
gfc_allocate_lang_decl (tree decl)
{
DECL_LANG_SPECIFIC (decl) = ggc_alloc_cleared_lang_decl(sizeof
(struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ggc_cleared_alloc<struct lang_decl> ();
}
/* Remember a symbol to generate initialization/cleanup code at function
@ -4160,7 +4159,7 @@ gfc_find_module (const char *name)
htab_hash_string (name), INSERT);
if (*slot == NULL)
{
struct module_htab_entry *entry = ggc_alloc_cleared_module_htab_entry ();
module_htab_entry *entry = ggc_cleared_alloc<module_htab_entry> ();
entry->name = gfc_get_string (name);
entry->decls = htab_create_ggc (10, module_htab_decls_hash,

View File

@ -1513,8 +1513,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
type = build_variant_type_copy (etype);
GFC_ARRAY_TYPE_P (type) = 1;
TYPE_LANG_SPECIFIC (type)
= ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (type) = ggc_cleared_alloc<struct lang_type> ();
known_stride = (packed != PACKED_NO);
known_offset = 1;
@ -1816,8 +1815,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
TYPE_NAMELESS (fat_type) = 1;
GFC_DESCRIPTOR_TYPE_P (fat_type) = 1;
TYPE_LANG_SPECIFIC (fat_type)
= ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (fat_type) = ggc_cleared_alloc<struct lang_type> ();
GFC_TYPE_ARRAY_RANK (fat_type) = dimen;
GFC_TYPE_ARRAY_CORANK (fat_type) = codimen;
@ -1991,8 +1989,7 @@ gfc_nonrestricted_type (tree t)
return t;
if (!TYPE_LANG_SPECIFIC (t))
TYPE_LANG_SPECIFIC (t)
= ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
TYPE_LANG_SPECIFIC (t) = ggc_cleared_alloc<struct lang_type> ();
/* If we're dealing with this very node already further up
the call chain (recursion via pointers and struct members)
we haven't yet determined if we really need a new type node.
@ -2044,8 +2041,7 @@ gfc_nonrestricted_type (tree t)
if (dataptr_type != GFC_TYPE_ARRAY_DATAPTR_TYPE (t))
{
TYPE_LANG_SPECIFIC (ret)
= ggc_alloc_cleared_lang_type (sizeof (struct
lang_type));
= ggc_cleared_alloc<struct lang_type> ();
*TYPE_LANG_SPECIFIC (ret) = *TYPE_LANG_SPECIFIC (t);
GFC_TYPE_ARRAY_DATAPTR_TYPE (ret) = dataptr_type;
}

View File

@ -793,10 +793,7 @@ enum gfc_array_kind
};
/* Array types only. */
/* FIXME: the variable_size annotation here is needed because these types are
variable-sized in some other frontends. Due to gengtype deficiency the GTY
options of such types have to agree across all frontends. */
struct GTY((variable_size)) lang_type {
struct GTY(()) lang_type {
int rank, corank;
enum gfc_array_kind akind;
tree lbound[GFC_MAX_DIMENSIONS];
@ -813,7 +810,7 @@ struct GTY((variable_size)) lang_type {
tree caf_offset;
};
struct GTY((variable_size)) lang_decl {
struct GTY(()) lang_decl {
/* Dummy variables. */
tree saved_descriptor;
/* Assigned integer nodes. Stringlength is the IO format string's length.

View File

@ -307,7 +307,7 @@ try_fit_stack_local (HOST_WIDE_INT start, HOST_WIDE_INT length,
static void
add_frame_space (HOST_WIDE_INT start, HOST_WIDE_INT end)
{
struct frame_space *space = ggc_alloc_frame_space ();
struct frame_space *space = ggc_alloc<frame_space> ();
space->next = crtl->frame_space_list;
crtl->frame_space_list = space;
space->start = start;
@ -655,7 +655,7 @@ static void
insert_temp_slot_address (rtx address, struct temp_slot *temp_slot)
{
void **slot;
struct temp_slot_address_entry *t = ggc_alloc_temp_slot_address_entry ();
struct temp_slot_address_entry *t = ggc_alloc<temp_slot_address_entry> ();
t->address = address;
t->temp_slot = temp_slot;
t->hash = temp_slot_address_compute_hash (t);
@ -802,7 +802,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size,
if (best_p->size - rounded_size >= alignment)
{
p = ggc_alloc_temp_slot ();
p = ggc_alloc<temp_slot> ();
p->in_use = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
@ -826,7 +826,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size,
{
HOST_WIDE_INT frame_offset_old = frame_offset;
p = ggc_alloc_temp_slot ();
p = ggc_alloc<temp_slot> ();
/* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE
@ -1254,10 +1254,10 @@ get_hard_reg_initial_val (enum machine_mode mode, unsigned int regno)
ivs = crtl->hard_reg_initial_vals;
if (ivs == 0)
{
ivs = ggc_alloc_initial_value_struct ();
ivs = ggc_alloc<initial_value_struct> ();
ivs->num_entries = 0;
ivs->max_entries = 5;
ivs->entries = ggc_alloc_vec_initial_value_pair (5);
ivs->entries = ggc_vec_alloc<initial_value_pair> (5);
crtl->hard_reg_initial_vals = ivs;
}
@ -4499,7 +4499,7 @@ allocate_struct_function (tree fndecl, bool abstract_p)
{
tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE;
cfun = ggc_alloc_cleared_function ();
cfun = ggc_cleared_alloc<function> ();
init_eh_for_function ();
@ -4573,7 +4573,7 @@ prepare_function_start (void)
if (flag_stack_usage_info)
{
cfun->su = ggc_alloc_cleared_stack_usage ();
cfun->su = ggc_cleared_alloc<stack_usage> ();
cfun->su->static_stack_size = -1;
}
@ -6153,7 +6153,7 @@ types_used_by_var_decl_insert (tree type, tree var_decl)
if (*slot == NULL)
{
struct types_used_by_vars_entry *entry;
entry = ggc_alloc_types_used_by_vars_entry ();
entry = ggc_alloc<types_used_by_vars_entry> ();
entry->type = type;
entry->var_decl = var_decl;
*slot = entry;

View File

@ -4972,130 +4972,6 @@ write_roots (pair_p variables, bool emit_pch)
"gt_pch_scalar_rtab");
}
/* TRUE if type S has the GTY variable_size annotation. */
static bool
variable_size_p (const type_p s)
{
options_p o;
for (o = s->u.s.opt; o; o = o->next)
if (strcmp (o->name, "variable_size") == 0)
return true;
return false;
}
enum alloc_quantity
{ single, vector };
/* Writes one typed allocator definition into output F for type
identifier TYPE_NAME with optional type specifier TYPE_SPECIFIER.
The allocator name will contain ALLOCATOR_TYPE. If VARIABLE_SIZE
is true, the allocator will have an extra parameter specifying
number of bytes to allocate. If QUANTITY is set to VECTOR, a
vector allocator will be output. */
static void
write_typed_alloc_def (outf_p f,
bool variable_size, const char *type_specifier,
const char *type_name, const char *allocator_type,
enum alloc_quantity quantity)
{
bool two_args = variable_size && (quantity == vector);
gcc_assert (f != NULL);
const char *type_name_as_id = filter_type_name (type_name);
oprintf (f, "#define ggc_alloc_%s%s", allocator_type, type_name_as_id);
oprintf (f, "(%s%s%s) ",
(variable_size ? "SIZE" : ""),
(two_args ? ", " : ""),
(quantity == vector) ? "n" : "");
oprintf (f, "((%s%s *)", type_specifier, type_name);
oprintf (f, "(ggc_internal_%salloc (", allocator_type);
if (variable_size)
oprintf (f, "SIZE");
else
oprintf (f, "sizeof (%s%s)", type_specifier, type_name);
if (quantity == vector)
oprintf (f, ", n");
oprintf (f, " MEM_STAT_INFO)))\n");
if (type_name_as_id != type_name)
free (CONST_CAST (char *, type_name_as_id));
}
/* Writes a typed allocator definition into output F for a struct or
union S, with a given ALLOCATOR_TYPE and QUANTITY for ZONE. */
static void
write_typed_struct_alloc_def (outf_p f,
const type_p s, const char *allocator_type,
enum alloc_quantity quantity)
{
gcc_assert (union_or_struct_p (s));
write_typed_alloc_def (f, variable_size_p (s), get_type_specifier (s),
s->u.s.tag, allocator_type, quantity);
}
/* Writes a typed allocator definition into output F for a typedef P,
with a given ALLOCATOR_TYPE and QUANTITY for ZONE. */
static void
write_typed_typedef_alloc_def (outf_p f,
const pair_p p, const char *allocator_type,
enum alloc_quantity quantity)
{
write_typed_alloc_def (f, variable_size_p (p->type), "", p->name,
allocator_type, quantity);
}
/* Writes typed allocator definitions into output F for the types in
STRUCTURES and TYPEDEFS that are used by GC. */
static void
write_typed_alloc_defns (outf_p f,
const type_p structures, const pair_p typedefs)
{
type_p s;
pair_p p;
gcc_assert (f != NULL);
oprintf (f,
"\n/* Allocators for known structs and unions. */\n\n");
for (s = structures; s; s = s->next)
{
if (!USED_BY_TYPED_GC_P (s))
continue;
gcc_assert (union_or_struct_p (s));
/* In plugin mode onput output ggc_alloc macro definitions
relevant to plugin input files. */
if (nb_plugin_files > 0
&& ((s->u.s.line.file == NULL) || !s->u.s.line.file->inpisplugin))
continue;
write_typed_struct_alloc_def (f, s, "", single);
write_typed_struct_alloc_def (f, s, "cleared_", single);
write_typed_struct_alloc_def (f, s, "vec_", vector);
write_typed_struct_alloc_def (f, s, "cleared_vec_", vector);
}
oprintf (f, "\n/* Allocators for known typedefs. */\n");
for (p = typedefs; p; p = p->next)
{
s = p->type;
if (!USED_BY_TYPED_GC_P (s) || (strcmp (p->name, s->u.s.tag) == 0))
continue;
/* In plugin mode onput output ggc_alloc macro definitions
relevant to plugin input files. */
if (nb_plugin_files > 0)
{
struct fileloc* filoc = type_fileloc (s);
if (!filoc || !filoc->file->inpisplugin)
continue;
};
write_typed_typedef_alloc_def (f, p, "", single);
write_typed_typedef_alloc_def (f, p, "cleared_", single);
write_typed_typedef_alloc_def (f, p, "vec_", vector);
write_typed_typedef_alloc_def (f, p, "cleared_vec_", vector);
}
}
/* Prints not-as-ugly version of a typename of T to OF. Trades the uniquness
guaranteee for somewhat increased readability. If name conflicts do happen,
this funcion will have to be adjusted to be more like
@ -5808,7 +5684,6 @@ main (int argc, char **argv)
open_base_files ();
output_header = plugin_output ? plugin_output : header_file;
write_typed_alloc_defns (output_header, structures, typedefs);
DBGPRINT_COUNT_TYPE ("structures before write_types outputheader",
structures);
DBGPRINT_COUNT_TYPE ("param_structs before write_types outputheader",

View File

@ -232,7 +232,7 @@ ggc_cleared_alloc_htab_ignore_args (size_t c ATTRIBUTE_UNUSED,
size_t n ATTRIBUTE_UNUSED)
{
gcc_assert (c * n == sizeof (struct htab));
return ggc_alloc_cleared_htab ();
return ggc_cleared_alloc<htab> ();
}
/* TODO: once we actually use type information in GGC, create a new tag
@ -241,7 +241,7 @@ void *
ggc_cleared_alloc_ptr_array_two_args (size_t c, size_t n)
{
gcc_assert (sizeof (PTR *) == n);
return ggc_internal_cleared_vec_alloc (sizeof (PTR *), c);
return ggc_cleared_vec_alloc<PTR *> (c);
}
/* These are for splay_tree_new_ggc. */

View File

@ -156,16 +156,35 @@ extern void dump_ggc_loc_statistics (bool);
#define GGC_RESIZEVEC(T, P, N) \
((T *) ggc_realloc ((P), (N) * sizeof (T) MEM_STAT_INFO))
static inline void *
ggc_internal_vec_alloc (size_t s, size_t c CXX_MEM_STAT_INFO)
template<typename T>
static inline T *
ggc_alloc (ALONE_CXX_MEM_STAT_INFO)
{
return ggc_internal_alloc (c * s PASS_MEM_STAT);
return static_cast<T *> (ggc_internal_alloc (sizeof (T) PASS_MEM_STAT));
}
static inline void *
ggc_internal_cleared_vec_alloc (size_t s, size_t c CXX_MEM_STAT_INFO)
template<typename T>
static inline T *
ggc_cleared_alloc (ALONE_CXX_MEM_STAT_INFO)
{
return ggc_internal_cleared_alloc (c * s PASS_MEM_STAT);
return static_cast<T *> (ggc_internal_cleared_alloc (sizeof (T)
PASS_MEM_STAT));
}
template<typename T>
static inline T *
ggc_vec_alloc (size_t c CXX_MEM_STAT_INFO)
{
return static_cast<T *> (ggc_internal_alloc (c * sizeof (T)
PASS_MEM_STAT));
}
template<typename T>
static inline T *
ggc_cleared_vec_alloc (size_t c CXX_MEM_STAT_INFO)
{
return static_cast<T *> (ggc_internal_cleared_alloc (c * sizeof (T)
PASS_MEM_STAT));
}
static inline void *
@ -230,7 +249,7 @@ extern void stringpool_statistics (void);
extern void init_ggc_heuristics (void);
#define ggc_alloc_rtvec_sized(NELT) \
ggc_alloc_rtvec_def (sizeof (struct rtvec_def) \
(rtvec_def *) ggc_internal_alloc (sizeof (struct rtvec_def) \
+ ((NELT) - 1) * sizeof (rtx)) \
/* Memory statistics passing versions of some allocators. Too few of them to

View File

@ -835,8 +835,7 @@ gimple_build_omp_for (gimple_seq body, int kind, tree clauses, size_t collapse,
gimple_omp_for_set_clauses (p, clauses);
gimple_omp_for_set_kind (p, kind);
p->collapse = collapse;
p->iter = static_cast <struct gimple_omp_for_iter *> (
ggc_internal_cleared_vec_alloc (sizeof (*p->iter), collapse));
p->iter = ggc_cleared_vec_alloc<gimple_omp_for_iter> (collapse);
if (pre_body)
gimple_omp_for_set_pre_body (p, pre_body);
@ -1664,10 +1663,8 @@ gimple_copy (gimple stmt)
{
gimple_statement_omp_for *omp_for_copy =
as_a <gimple_statement_omp_for *> (copy);
omp_for_copy->iter =
static_cast <struct gimple_omp_for_iter *> (
ggc_internal_vec_alloc (sizeof (struct gimple_omp_for_iter),
gimple_omp_for_collapse (stmt)));
omp_for_copy->iter = ggc_vec_alloc<gimple_omp_for_iter>
( gimple_omp_for_collapse (stmt));
}
for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
{

View File

@ -1,3 +1,7 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* go-lang.c (struct GTY): Don't use variable_size gty attribute.
2014-05-06 Chris Manghane <cmang@google.com>
* go-gcc.cc (Gcc_backend::nil_pointer_expression): New method.

View File

@ -51,7 +51,7 @@ struct GTY(()) lang_type
/* Language-dependent contents of a decl. */
struct GTY((variable_size)) lang_decl
struct GTY(()) lang_decl
{
char dummy;
};

View File

@ -2599,7 +2599,7 @@ get_replacement_map (struct ipa_node_params *info, tree value, int parm_num)
struct ipa_replace_map *replace_map;
replace_map = ggc_alloc_ipa_replace_map ();
replace_map = ggc_alloc<ipa_replace_map> ();
if (dump_file)
{
fprintf (dump_file, " replacing ");
@ -3182,7 +3182,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
if (!item->value)
continue;
v = ggc_alloc_ipa_agg_replacement_value ();
v = ggc_alloc<ipa_agg_replacement_value> ();
v->index = i;
v->offset = item->offset;
v->value = item->value;
@ -3212,7 +3212,7 @@ known_aggs_to_agg_replacement_list (vec<ipa_agg_jump_function> known_aggs)
FOR_EACH_VEC_SAFE_ELT (aggjf->items, j, item)
{
struct ipa_agg_replacement_value *v;
v = ggc_alloc_ipa_agg_replacement_value ();
v = ggc_alloc<ipa_agg_replacement_value> ();
v->index = i;
v->offset = item->offset;
v->value = item->value;

View File

@ -491,7 +491,7 @@ get_odr_type (tree type, bool insert)
tree binfo = TYPE_BINFO (type);
unsigned int i;
val = ggc_alloc_cleared_odr_type_d ();
val = ggc_cleared_alloc<odr_type_d> ();
val->type = type;
val->bases = vNULL;
val->derived_types = vNULL;

View File

@ -3315,7 +3315,7 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
{
struct ipa_agg_replacement_value *v;
v = ggc_alloc_ipa_agg_replacement_value ();
v = ggc_alloc<ipa_agg_replacement_value> ();
memcpy (v, old_av, sizeof (*v));
v->next = new_av;
new_av = v;
@ -4674,7 +4674,7 @@ read_agg_replacement_chain (struct lto_input_block *ib,
struct ipa_agg_replacement_value *av;
struct bitpack_d bp;
av = ggc_alloc_ipa_agg_replacement_value ();
av = ggc_alloc<ipa_agg_replacement_value> ();
av->offset = streamer_read_uhwi (ib);
av->index = streamer_read_uhwi (ib);
av->value = stream_read_tree (ib, data_in);

View File

@ -1,3 +1,22 @@
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* class.c (add_method_1): Adjust.
(java_treetreehash_new): Likewise.
* constants.c (set_constant_entry): Likewise.
(cpool_for_class): Likewise.
* decl.c (make_binding_level): Likewise.
(java_dup_lang_specific_decl): Likewise.
* expr.c (add_type_assertion): Likewise.
* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
(lang_decl): don't use variable_size gty attribute.
(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust.
(lang_type): Don't use variable_size gty attribute.
* jcf-parse.c (java_parse_file): Adjust.
(process_zip_dir): Likewise.
* jcf.h: Remove usage of variable_size gty attribute.
* jcf-reader.c (jcf_parse_constant_pool): Adjust.
(jcf_parse_bootstrap_methods): Likewise.
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* constants.c (set_constant_entry): Adjust.

View File

@ -764,8 +764,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
fndecl = build_decl (input_location, FUNCTION_DECL, name, method_type);
DECL_CONTEXT (fndecl) = this_class;
DECL_LANG_SPECIFIC (fndecl)
= ggc_alloc_cleared_lang_decl(sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (fndecl) = ggc_cleared_alloc<struct lang_decl> ();
DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC;
/* Initialize the static initializer test table. */
@ -3194,7 +3193,7 @@ java_treetreehash_new (htab_t ht, tree t)
e = htab_find_slot_with_hash (ht, t, hv, INSERT);
if (*e == NULL)
{
tthe = ggc_alloc_cleared_treetreehash_entry ();
tthe = ggc_cleared_alloc<treetreehash_entry> ();
tthe->key = t;
*e = tthe;
}

View File

@ -46,11 +46,8 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
if (cpool->data == NULL)
{
cpool->capacity = 100;
cpool->tags = (uint8 *) ggc_internal_cleared_alloc (sizeof (uint8)
* cpool->capacity);
cpool->data = ggc_alloc_cleared_vec_cpool_entry (sizeof
(union cpool_entry),
cpool->capacity);
cpool->tags = ggc_cleared_vec_alloc<uint8> (cpool->capacity);
cpool->data = ggc_cleared_vec_alloc<cpool_entry> (cpool->capacity);
cpool->count = 1;
}
if (index >= cpool->capacity)
@ -338,7 +335,7 @@ cpool_for_class (tree klass)
if (cpool == NULL)
{
cpool = ggc_alloc_cleared_CPool ();
cpool = ggc_cleared_alloc<CPool> ();
TYPE_CPOOL (klass) = cpool;
}
return cpool;

View File

@ -1307,7 +1307,7 @@ static struct binding_level *
make_binding_level (void)
{
/* NOSTRICT */
return ggc_alloc_cleared_binding_level ();
return ggc_cleared_alloc<binding_level> ();
}
void
@ -1646,7 +1646,7 @@ java_dup_lang_specific_decl (tree node)
return;
lang_decl_size = sizeof (struct lang_decl);
x = ggc_alloc_lang_decl (lang_decl_size);
x = ggc_alloc<struct lang_decl> ();
memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size);
DECL_LANG_SPECIFIC (node) = x;
}

View File

@ -471,7 +471,7 @@ add_type_assertion (tree klass, int assertion_code, tree op1, tree op2)
if (*as_pp)
return;
*as_pp = ggc_alloc_type_assertion ();
*as_pp = ggc_alloc<type_assertion> ();
**(type_assertion **)as_pp = as;
}

View File

@ -699,8 +699,7 @@ union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
#define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \
if (DECL_LANG_SPECIFIC (T) == NULL) \
{ \
DECL_LANG_SPECIFIC ((T)) \
= ggc_alloc_cleared_lang_decl (sizeof (struct lang_decl)); \
DECL_LANG_SPECIFIC ((T)) = ggc_cleared_alloc<struct lang_decl> (); \
DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \
}
@ -808,7 +807,7 @@ struct GTY(()) lang_decl_var {
enum lang_decl_desc {LANG_DECL_FUNC, LANG_DECL_VAR};
struct GTY((variable_size)) lang_decl {
struct GTY(()) lang_decl {
enum lang_decl_desc desc;
union lang_decl_u
{
@ -825,8 +824,7 @@ struct GTY((variable_size)) lang_decl {
#define TYPE_CPOOL_DATA_REF(T) (TYPE_LANG_SPECIFIC (T)->cpool_data_ref)
#define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \
if (TYPE_LANG_SPECIFIC ((T)) == NULL) \
TYPE_LANG_SPECIFIC ((T)) \
= ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
TYPE_LANG_SPECIFIC ((T)) = ggc_cleared_alloc<struct lang_type> ();
#define TYPE_DUMMY(T) (TYPE_LANG_SPECIFIC(T)->dummy_class)
@ -869,10 +867,7 @@ typedef struct GTY(()) method_entry_d {
} method_entry;
/* FIXME: the variable_size annotation here is needed because these types are
variable-sized in some other frontends. Due to gengtype deficiency the GTY
options of such types have to agree across all frontends. */
struct GTY((variable_size)) lang_type {
struct GTY(()) lang_type {
tree signature;
struct JCF *jcf;
struct CPool *cpool;

View File

@ -1905,7 +1905,7 @@ java_parse_file (void)
if (magic == 0xcafebabe)
{
CLASS_FILE_P (node) = 1;
current_jcf = ggc_alloc_cleared_JCF ();
current_jcf = ggc_cleared_alloc<JCF> ();
current_jcf->read_state = finput;
current_jcf->filbuf = jcf_filbuf_from_stdio;
jcf_parse (current_jcf);
@ -1922,7 +1922,7 @@ java_parse_file (void)
}
else if (magic == (JCF_u4)ZIPMAGIC)
{
main_jcf = ggc_alloc_cleared_JCF ();
main_jcf = ggc_cleared_alloc<JCF> ();
main_jcf->read_state = finput;
main_jcf->filbuf = jcf_filbuf_from_stdio;
linemap_add (line_table, LC_ENTER, false, filename, 0);
@ -2178,7 +2178,7 @@ process_zip_dir (FILE *finput)
class_name = compute_class_name (zdir);
file_name = XNEWVEC (char, zdir->filename_length+1);
jcf = ggc_alloc_cleared_JCF ();
jcf = ggc_cleared_alloc<JCF> ();
strncpy (file_name, class_name_in_zip_dir, zdir->filename_length);
file_name [zdir->filename_length] = '\0';

View File

@ -341,7 +341,8 @@ jcf_parse_constant_pool (JCF* jcf)
int i, n;
JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf));
jcf->cpool.tags = (uint8 *) ggc_alloc_atomic (JPOOL_SIZE (jcf));
jcf->cpool.data = ggc_alloc_cpool_entry (sizeof (jword) * JPOOL_SIZE (jcf));
jcf->cpool.data = (cpool_entry *) ggc_internal_cleared_alloc
(sizeof (jword) * JPOOL_SIZE (jcf));
jcf->cpool.tags[0] = 0;
#ifdef HANDLE_START_CONSTANT_POOL
HANDLE_START_CONSTANT_POOL (JPOOL_SIZE (jcf));
@ -551,9 +552,7 @@ jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED)
int i;
uint16 num_methods = JCF_readu2 (jcf);
jcf->bootstrap_methods.count = num_methods;
jcf->bootstrap_methods.methods
= (bootstrap_method *) ggc_alloc_atomic (num_methods
* sizeof (bootstrap_method));
jcf->bootstrap_methods.methods = ggc_vec_alloc<bootstrap_method> (num_methods);
#ifdef HANDLE_START_BOOTSTRAP_METHODS
HANDLE_START_BOOTSTRAP_METHODS (jcf, num_methods);
#endif
@ -564,9 +563,7 @@ jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED)
bootstrap_method *m = &jcf->bootstrap_methods.methods[i];
m->method_ref = JCF_readu2 (jcf);
m->num_arguments = JCF_readu2 (jcf);
m->bootstrap_arguments
= (unsigned *) ggc_alloc_atomic (m->num_arguments
* sizeof (unsigned));
m->bootstrap_arguments = ggc_vec_alloc<unsigned> (m->num_arguments);
for (j = 0; j < m->num_arguments; j++)
m->bootstrap_arguments[j] = JCF_readu2 (jcf);
}

View File

@ -65,7 +65,7 @@ jcf_open_exact_case (const char* filename, int oflag);
struct JCF;
typedef int (*jcf_filbuf_t) (struct JCF*, int needed);
union GTY((variable_size)) cpool_entry {
union GTY(()) cpool_entry {
jword GTY ((tag ("0"))) w;
tree GTY ((tag ("1"))) t;
};

View File

@ -3032,7 +3032,7 @@ get_simple_loop_desc (struct loop *loop)
/* At least desc->infinite is not always initialized by
find_simple_loop_exit. */
desc = ggc_alloc_cleared_niter_desc ();
desc = ggc_cleared_alloc<niter_desc> ();
iv_analysis_loop_init (loop);
find_simple_exit (loop, desc);
loop->simple_loop_desc = desc;

View File

@ -1756,7 +1756,7 @@ input_node_opt_summary (struct cgraph_node *node,
count = streamer_read_uhwi (ib_main);
for (i = 0; i < count; i++)
{
struct ipa_replace_map *map = ggc_alloc_ipa_replace_map ();
struct ipa_replace_map *map = ggc_alloc<ipa_replace_map> ();
vec_safe_push (node->clone.tree_map, map);
map->parm_num = streamer_read_uhwi (ib_main);

View File

@ -364,7 +364,7 @@ lto_get_decl_name_mapping (struct lto_file_decl_data *decl_data,
struct lto_in_decl_state *
lto_new_in_decl_state (void)
{
return ggc_alloc_cleared_lto_in_decl_state ();
return ggc_cleared_alloc<lto_in_decl_state> ();
}
/* Delete STATE and its components. */

Some files were not shown because too many files have changed in this diff Show More