]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
use templates instead of gengtype for typed allocation functions
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 May 2014 23:07:23 +0000 (23:07 +0000)
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 May 2014 23:07:23 +0000 (23:07 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210566 138bc75d-0d04-0410-961f-82ee72b054a4

134 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/ada-tree.h
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c
gcc/alias.c
gcc/bitmap.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.h
gcc/c-family/c-pragma.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-lang.h
gcc/c/c-parser.c
gcc/cfg.c
gcc/cfgloop.c
gcc/cfgrtl.c
gcc/cgraph.c
gcc/cgraphclones.c
gcc/cgraphunit.c
gcc/config/aarch64/aarch64.c
gcc/config/alpha/alpha.c
gcc/config/arc/arc.c
gcc/config/arm/arm.c
gcc/config/avr/avr.c
gcc/config/bfin/bfin.c
gcc/config/c6x/c6x.c
gcc/config/cris/cris.c
gcc/config/darwin.c
gcc/config/epiphany/epiphany.c
gcc/config/frv/frv.c
gcc/config/i386/i386.c
gcc/config/i386/winnt.c
gcc/config/ia64/ia64.c
gcc/config/iq2000/iq2000.c
gcc/config/m32c/m32c.c
gcc/config/mep/mep.c
gcc/config/mips/mips.c
gcc/config/mmix/mmix.c
gcc/config/moxie/moxie.c
gcc/config/msp430/msp430.c
gcc/config/nds32/nds32.c
gcc/config/nios2/nios2.c
gcc/config/pa/pa.c
gcc/config/rl78/rl78.c
gcc/config/rs6000/rs6000.c
gcc/config/s390/s390.c
gcc/config/score/score.c
gcc/config/sparc/sparc.c
gcc/config/spu/spu.c
gcc/config/tilegx/tilegx.c
gcc/config/tilepro/tilepro.c
gcc/config/xtensa/xtensa.c
gcc/coverage.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-cilkplus.c
gcc/cp/cp-objcp-common.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/lex.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/typeck2.c
gcc/dbxout.c
gcc/doc/gty.texi
gcc/dwarf2cfi.c
gcc/dwarf2out.c
gcc/emit-rtl.c
gcc/except.c
gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/fortran/trans-decl.c
gcc/fortran/trans-types.c
gcc/fortran/trans.h
gcc/function.c
gcc/gengtype.c
gcc/ggc-common.c
gcc/ggc.h
gcc/gimple.c
gcc/go/ChangeLog
gcc/go/go-lang.c
gcc/ipa-cp.c
gcc/ipa-devirt.c
gcc/ipa-prop.c
gcc/java/ChangeLog
gcc/java/class.c
gcc/java/constants.c
gcc/java/decl.c
gcc/java/expr.c
gcc/java/java-tree.h
gcc/java/jcf-parse.c
gcc/java/jcf-reader.c
gcc/java/jcf.h
gcc/loop-iv.c
gcc/lto-cgraph.c
gcc/lto-section-in.c
gcc/lto-streamer-in.c
gcc/lto/ChangeLog
gcc/lto/lto-tree.h
gcc/lto/lto.c
gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/objc/objc-act.h
gcc/objc/objc-map.c
gcc/objc/objc-next-runtime-abi-02.c
gcc/objcp/ChangeLog
gcc/objcp/objcp-decl.h
gcc/optabs.c
gcc/passes.c
gcc/rtl.h
gcc/sese.c
gcc/stringpool.c
gcc/target-globals.c
gcc/toplev.c
gcc/trans-mem.c
gcc/tree-cfg.c
gcc/tree-data-ref.h
gcc/tree-eh.c
gcc/tree-iterator.c
gcc/tree-scalar-evolution.c
gcc/tree-ssa-loop-niter.c
gcc/tree-ssa-operands.c
gcc/tree-ssa-operands.h
gcc/tree-ssa.c
gcc/tree-ssanames.c
gcc/tree-streamer-in.c
gcc/tree.c
gcc/ubsan.c
gcc/varasm.c
gcc/varpool.c

index a82873adc0f872b9ad65fe9c9beac70882683d50..1680aaeaf1393eabf4b418b706b9c961cfd53ad5 100644 (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
index 544f7fafcbb287e31558379d92f7970c3a2bcdb4..0102460767c69ed9c59b8cd79b286382a0ea5165 100644 (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.
index 5ea386f860c3b55b4fa4f18e887876ebf8aa19b1..d43eefa004e57752729b03de9730220979b6d3fc 100644 (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)
 
index e18583cb06a9d215abfc9d23e2d67179e6e106f4..ff1210e6c87cd166df357e140eb95515b53a81d6 100644 (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;
     }
index 26194b64d23248380bdb6390b0d96d871127897f..c691a16b3d0a137d62212644564f88c1573b21d3 100644 (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;
index b9b9dc1c52d8bfe624fb9f205986301bba7206fb..cc6f874c5fc3eb19502ae5feeba68ebffca5488e 100644 (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,
index 5f50fc245c97a5444eec7ef488b73f05bb444dec..0246dd792f00f5afb901ee087737b5190141fc9a 100644 (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,
index c4d81581f14c0dfea75eccb3859162b498d919e4..119cb66d901c60dacb586028b22c3d694b5431fb 100644 (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)
index 3a978fa40b9d77d4419d4273a669578ade09a996..c88cf59c459c1636e3c62c338f3e97ee41b0bb56 100644 (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
index d34d2bb2eb99cd07d97d8450aa092773724c2985..59e809a1886c01a3d411e864ee09add946040e73 100644 (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];
 };
index 9e2a00eb16e122b178387d2adf48b38e33251269..7b016abad08a1e01e9b993ea6604d1dfe9942489 100644 (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;
 
index 7b7d6650ae01ac18886448453bcf827291d19dff..1266d4ea96997d354c1db02b6a95c529c1db4f89 100644 (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
index d52dcc9b25ba47d3c9279268b7b32b6d4d9620db..75d12205b04d1942ed3fd1dff862c4ab6826e26f 100644 (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);
index 7fcf333b78f2355886a56dc327a1bde64ac24b2e..e97490642e7c70b53c5c83ada448cedcf75ce0dc 100644 (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;
 };
 
index 6e8554dc7d2cc2b94011c7e352b6d2128c99bc46..bfc714736fd31341bb27432cdbc9103afb48d4ff 100644 (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];
index 3b6349aec495efaf54cdcd5cd0a2422e8205616e..aef11458daf13f24a66d5023f6a673768bce3efe 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -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;
index 91e8800560b09944fdcc689952664e6b42f7ba0d..73f79ef368c98842786effe05621ecaf2ff57fb7 100644 (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;
index 555fdf9ef15e5f6d235c9b5c35199f7ef3b1fbb0..51dbb9e3d22db2ff9677bbf8478f66023c15ea3b 100644 (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
index 2b4ce813c9028e699f4eb2eda205819891bd627e..e3ddc235009377500c407d790deacd73003177a3 100644 (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;
 }
index 48b5379f2161a6010db279f4d64ee6d467a7258e..d61e0f74db79f471d6b1706baeb76203282dee1a 100644 (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;
        }
     }
index 9b51135646f03c951b51bd1b33e9afc2e83a86b7..f5d95942f083148822eaab9c7d348fdd49c31c7e 100644 (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;
 
index 0a7f441941cded20d8701b888030bb617b8e7857..66ab1b7a5ff905ba7f19cd636c1a9a9e1f86ded1 100644 (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;
 }
 
index dc07a02c0cf7b58f733a6a3ff294452aa491906b..efef1e982d386624be43290c4093d27bc5aeba9e 100644 (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));
 
index 8c170e0f391f2f0af6f9f411919afd36298e8483..a9161b30a710e62334931044508d667285115bac 100644 (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;
 
index 6f4ba74c8ece74486d2f8b5c6fcf72c1d7b616e3..bd86a58f2ee7fe03476d6b8a2a1f3adc771dc1e5 100644 (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;
index fc6c9f60072b627356e79fc8bed16b8aaab6e0e9..2b6b4878e3ceced7b5aba4aac718cbdb48e7ea51 100644 (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> ();
 }
 
 
index 84b2d01c7300d34de8f8cdd3225697a05a31999e..f8600998d5ea80fd2c8901867505bf5264b3956d 100644 (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.  */
index 9ba10df73c6cd444ff63a2f815274085ac1048c7..2da2790bf533feb7d55eb19f7db92a95ac1057c3 100644 (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.  */
index 209f127a6ca5283c9dd1f46c44e9d67ed311b26b..194dd14f9bfdf2ab284b772ba7cdb8578b2e1b2f 100644 (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.
index 3c50e24edf2670c90f32b3b6cd8623348ca8d0b9..462c81d0a08706268e1e2cd6c7474eba14a5cced 100644 (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;
     }
 }
index 7ee5d0a8019de8b77641b2e6448264a152816e85..598f61b4e52fc4ca85787e4cd6b67c992cae43f6 100644 (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;
 }
index f2dadc3d9ba580624cb06dc520aec02e80555a5d..2b0a0b233a5ce43516008944b87106f0c6ce0ac6 100644 (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> ();
 }
 \f
 /* Implement TARGET_SCHED_ISSUE_RATE.  */
index 6724b84d02f00992d96d182905a592b298e89906..6ffb7884008fd64b8070e5b050e16455a51669b8 100644 (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);
index bcfd48a03dc673fd010b3ab41f08037374f54bdd..6cdc29f3ed3f6f1d4c66d04e980096de57c646ba 100644 (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;
index 41adc4adc963aace42b3066a626dacdfda142b6f..e1dd86adc0b21ffb53a2cab12e6dbacf9f737235 100644 (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> ();
 }
 \f
 static enum attr_itanium_class ia64_safe_itanium_class (rtx);
index ed7aecbd46997d282beb53ab1f48265b627aa31b..717df2e9d3842cf2e0c590f07882eed4cd1457e6 100644 (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.  */
index 837c22b2d772fb1df4d78d67d021e9856e48477d..75f67f741e2304d0508039278349865867582dab 100644 (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;
index 858136b988cbd184119e6db0bdd90316b95cf88d..c780b5afdea006e8f70a7f0fd212c348841246bc 100644 (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);
index 35844ad275ab5fb76b1a4fcdee1395ff29c95dcb..a754353a98b80dbc69170097dd146a3817f8579a 100644 (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
index 2616dd54a92d3b504387b36da8899b57bb45aeaf..d40b67c7a09addfbd49b7f46980ef9610f44a912 100644 (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.
index b646a432bb2fa4173053c07d40160c4b8eb17e42..a5eaa5f59b0c7f2301fa1b0f7bd1211ff08a5471 100644 (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> ();
 }
 
 
index 55b6f0be6b17e5a552bd0f889b4a57b0eff6c793..e851a1440ec84c015ad4d4e5f43e5efada0b2a50 100644 (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;
 }
index 6e5595c09f5311959fd9525f35eb24d73916a9d2..47b1318bb0ea48192e6e8a569d32dcb613537a85 100644 (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;
index 548a8d2747120f507468946c12eaee623d5d08d0..ff3536d1c2177e5a47e39cd8cdddbe8c620a88b3 100644 (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.  */
index 871e4e5c6e8e7f5a1749bbdafb9c5cbe23915258..95dcbb917cf1ed72c25bbc738d20ddc845a7977d 100644 (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,
index 0731491a23f3d0ae021c7aa0dd95a8424782bbcc..09baa76b984b4fe2eb7015c35a0c8ba0ff4a55ab 100644 (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;
index 37b6b7d5ed99b464c25d36db413035e5a0e93af1..cd7b8c1f49d85f277c2ac548b9dc592cda159e34 100644 (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> ();
 }
 \f
 #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;
index ef080ad6c799694e6e84c1af6fa5a62e34e0f0b0..417e2a826b708969f0c9b37ef46f7c93c725864c 100644 (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.  */
index e238d6d092cad20ffa0c00edb1e9acf4267f3dc0..e42960289c7caa96bde9c5ae859475ada052cdad 100644 (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));
index 4b84760ec251a638744798bbddd0cd3d1d02fe9e..30d4159a4977cae300ab9082f7c68e21ce37b5a0 100644 (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
index 88e3f5e5909ca44ebdbd86a3deae9fe3e8b05d8d..41d3c2c5e0316534da0f866a49c160f23521bdf9 100644 (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.  */
index c3b71261501bde22aea6c7ea7a4b4f5e64a092bd..70fce93bd6a407ab8349f3b778b466641966dd5f 100644 (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> ();
 }
 
 
index 74f88008fc7cdc677785fc1e7d5fcebe479cd285..e89a733746b57028970145417b530a2dc2c55800 100644 (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> ();
 }
 
 
index 06e1eb78ada7012fa7ffa6c9fd33e1e5241657be..6b6693ff3414e25d7e67ea5b2723ac74ee1a1c3b 100644 (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> ();
 }
 
 
index ff1e67d0a0360a209c7c8838037a978967477964..5e9005eb1b89a49e6bc129387fa0ed64a037aad1 100644 (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;
index 2714cd3e9bb897ba98d603b76a9702d354cb9cfd..b5ad1af0e5f152f225cd2dce279ede6d909dd9b2 100644 (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
index c96d79dbc82a84df601c386724e6e79b04bd216e..05aacfa859821d642de31d4ca14d45ff4c2e03ca 100644 (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;
 
index f3a2aff048db65dfa2725a887086fc7ed11e2675..daa9b8ebb38ea6ed06d576a6788bf0827863420d 100644 (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 ();
index aa0ff839ceef7fc1f232d9017c025137a1c76e13..78dddef70d1a617eeca7a6930d6bf24d2f1b63c3 100644 (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),
index 3bd2e8c2bc51f0d32da054c5079b64bd24c74200..d13d71dcad9a1d7308a63130abedb5cf8d086c6b 100644 (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;   \
       }                                                                        \
index 51df30cfcc08950cb405955c573b1bc08522c4aa..a29e3e3b2a06a407ed114f76c78bdcc66305f39f 100644 (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;
 
index 3fe275e4933a205d14e779b54fd6bd5e05738ab9..57b779d77e18828cbe756f8117b58d514ee99935 100644 (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;
index d900560490e3487a4e28c04e9f26b4c57aec7d14..2baeeb76d184ec422738acf1dd4f5078dcb34943 100644 (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;
 
index 7d9f81d314f9eb4c75962d04a5177f9de7083962..031fa9da7a93fd0464092362d15eec42a3f1df42 100644 (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;
index bfae68062946f1d378d592de7e8d5fca7c72d2e4..c9eddb8b1c10b70f4138343332f843bc4758fb66 100644 (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;
index 583b87048a96b934abd0cfccbee1fabfc5239b0a..6c5bdf7391b51552789323d9e7ca6d15bf80e578 100644 (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
index 1d8b78278bf00ce355ec7cc5fe8f12d6248b3a1b..a0f39b6553ecb300bb97802efdf04cf885146c93 100644 (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;
index e6c98850063f2b994a31bae592be3b192bfbee6e..6cb43411917858dbff62ece31dc4944938e27e0e 100644 (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.  */
index d32ac00e48ebb5adbd01f4b4a068c45512b1907b..e50eef66b3e6af320fd0c416ca8ea14a2a860c99 100644 (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
 
index 41808905bc18858e64b4001ef3674dd2ae9af355..47fd0287a67eef7b8f2f6aec93e47aa0acd43cea 100644 (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;
index 21833edb0102d05c2226bb8e4923e8af8c79504d..4ea05a5b8420ac926c9000f392ce083cb3378f53 100644 (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;
index d48d761479986ee1479fe4041e5061b908ebef41..9282a29520b4c16ba18f9f27a90d2ab19bddc4fb 100644 (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)
index dff0adee681b73ff01adbceae9603c96b0ac3929..49ebaae9dd6b23e5758969fef1f749cf93b3fee4 100644 (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;
 
index 64174b0c10f70a211d49b5e96b299a8d157bfac6..f547e872c4ffc4bfd617a362ef45a3d4200e02df 100644 (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
index e25e92a5533629986a4bec8334f762d9e5834829..adee07cbaa552b370f9fd633949bb5f1fe4d9173 100644 (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;
 
index 5b9661224d00887866aa9cb35b6455b559f7c58d..4a5ba1da3b494dd58f64a692a1733c3849dc5014 100644 (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,
index 77d0e785e0be36d52606e875b7787dbe9d63e5b2..d9aab474a7537305dc2a3ebf96507a581fa5890d 100644 (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;
                    }
index baae780ed6a299fb7da9c07b52518228086fc09f..def6b9df00c85321c89e08ed3c04627c968f5718 100644 (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.
index d269c5434e25e37dc8c842af4943be8d77d03450..ec2ea26628b8d2fce34456a626c66f29bd64809b 100644 (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;
index 4abeba6b33554e020d2fead3b85b40db95da8fc6..808ef45bdf14de36e994361ac677e790083f1fd5 100644 (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",
index e1cc48e6e676150e63e35022ca6cd94ea562dc8d..e89cc64b958096195a9e030ea3bc625fa0805818 100644 (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.  */
index 9bb0642e61098c562e0d8bfdf87d6e58126e034c..2c567dee32513f90bc6c4ad92c1562c323b65ed5 100644 (file)
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -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 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 ggc_internal_cleared_alloc (c * s PASS_MEM_STAT);
+    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
index 3dfe97cf5d74c7f873741fcc08334e32d8500cb2..03a84fb44f6f198dea5f717a8fb5d0cbdf36e8a3 100644 (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++)
            {
index 26a1c45791c004468dcbb4ff7de62408c5270eec..8374c7adc1b90aa819dcf4b54fbc8a642bd0a698 100644 (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.
index f6e865e08cf79f7f6bcb3ea5a1a093cf7dd296ca..24b64375469e62cdfa1cb9d04609255fbf76d1bd 100644 (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;
 };
index 479963cdb6baebf237e502a3b051d68b55b0c559..d1f882adebf947fa445c061039cc94f2b6f59c5b 100644 (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;
index d0296e7e4c7684646240bccbf9c5b457489c59de..a0e845a6b3a1a4de323591ced3e83218d8692f1b 100644 (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;
index e372171114e8750d2960648d5e5c8bd6f0d3ba98..fd57f32bad8bfcafdf3cc2e1f936cfc40851d777 100644 (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);
index b6b6c19d2ce69c5717ef3767b19bfcc046859f91..70991cc46938d6649449cf48843920e2e5c11473 100644 (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.
index bbe7c8631772d7e29cdbeb9bf9afc53662eb354f..a1e4a86033b0f5a230b5c0d33d2c9a3b0462a844 100644 (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;
     }
index c0295e9a2facc7764244291529bfb92e38e3a510..2e317c91bb69b9f14a7c36ea78f9ec2e4bc3a840 100644 (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;
index 53d6f89b2d5bf4bc4f37c3fdcdf7c8756540ea6f..841fb4cbad1712e5ad0a2df6ebc652d615b9faa7 100644 (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;
 }
index e66bdb152aba3d043493d81c9d2324a80270705b..51b8f0f7c8f319569b2791cde9a05d9a218b6fb8 100644 (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;
 }
 
index 806d2d7a54d5c17b68c4631b0c71104a9a6889ae..e832f44fb0feb52d7a09cdb54588701d67584aba 100644 (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;
index 748f7c3e06189e35da272b5bcfd27ee226a83a25..7425b4e05e3c2d0ad64ad3f7bb7cd6e77cc542dd 100644 (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';
index 10def13ca96f1d0d1a25836bf2a689d0d1eb7e48..ed175cb24c1a6966571d80f6cb32f796bf5f78b3 100644 (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);
     }
index 8aa077e4c875151253c4471fa39bc14e84946725..0988d658dccc2b3ddccc0028801223cefa8fc537 100644 (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;
 };
index 796bd59f2d67154e2ac08355cb0382ebf1d568b2..c81b6472de6d2c0218207dc438bcf7e32aeef4cc 100644 (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;
index b22eb46ac3e772e30b51f0346bd663289e64529f..2329d1a6be52b1aa9a54119f7cbe7a8648549b46 100644 (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);
index 9aa7639099cb044e9c62f1259966ad4aba332b3e..d88776398bac3fe3b0d848ed9af7d2d5974c99c6 100644 (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. */
index d0c86626c66a9afe2cba351b731efecb50a29f3d..a18c64e060ddd5aaff9ed0a7e7f1017f0fa533d0 100644 (file)
@@ -279,7 +279,7 @@ lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in,
       lto_tag_check_range (tag, LTO_eh_catch, LTO_eh_catch);
 
       /* Read the catch node.  */
-      n = ggc_alloc_cleared_eh_catch_d ();
+      n = ggc_cleared_alloc<eh_catch_d> ();
       n->type_list = stream_read_tree (ib, data_in);
       n->filter_list = stream_read_tree (ib, data_in);
       n->label = stream_read_tree (ib, data_in);
@@ -319,7 +319,7 @@ input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix)
   if (tag == LTO_null)
     return NULL;
 
-  r = ggc_alloc_cleared_eh_region_d ();
+  r = ggc_cleared_alloc<eh_region_d> ();
   r->index = streamer_read_hwi (ib);
 
   gcc_assert (r->index == ix);
@@ -396,7 +396,7 @@ input_eh_lp (struct lto_input_block *ib, struct data_in *data_in, int ix)
 
   lto_tag_check_range (tag, LTO_eh_landing_pad, LTO_eh_landing_pad);
 
-  lp = ggc_alloc_cleared_eh_landing_pad_d ();
+  lp = ggc_cleared_alloc<eh_landing_pad_d> ();
   lp->index = streamer_read_hwi (ib);
   gcc_assert (lp->index == ix);
   lp->next_lp = (eh_landing_pad) (intptr_t) streamer_read_hwi (ib);
@@ -697,7 +697,7 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in,
   if (n_loops == 0)
     return;
 
-  struct loops *loops = ggc_alloc_cleared_loops ();
+  struct loops *loops = ggc_cleared_alloc<struct loops> ();
   init_loops_structure (fn, loops, n_loops);
   set_loops_for_fn (fn, loops);
 
index 038f8a95a5239ee3c10458ba9bb3d668d39c5c3d..7c93cb7d6a0e2ebabcf953630d99eca7b53f301d 100644 (file)
@@ -1,3 +1,11 @@
+2014-05-17  Trevor Saunders  <tsaunders@mozilla.com>
+
+       * 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.
+
 2014-05-06  Kenneth Zadeck  <zadeck@naturalbridge.com>
            Mike Stump  <mikestump@comcast.net>
            Richard Sandiford  <rdsandiford@googlemail.com>
index b1c3d2a848a2d8d5c54f7d60340c7e794882ffa2..4e3f5d612ebaf5632708905e42b45ef04b7b4108 100644 (file)
@@ -28,12 +28,12 @@ struct GTY(()) lang_identifier
   struct tree_identifier base;
 };
 
-struct GTY((variable_size)) lang_decl
+struct GTY(()) lang_decl
 {
   int dummy;  /* Added because ggc does not like empty structs.  */
 };
 
-struct GTY((variable_size)) lang_type
+struct GTY(()) lang_type
 {
   int dummy;  /* Added because ggc does not like empty structs.  */
 };
index 1d9ac2c9ecd1affd3853fc8315f953e6667a5310..8af49466152123cfbd6f68a5e3d0db61005a92d2 100644 (file)
@@ -244,7 +244,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data,
   for (i = 0; i < LTO_N_DECL_STREAMS; i++)
     {
       uint32_t size = *data++;
-      tree *decls = ggc_alloc_vec_tree (size);
+      tree *decls = ggc_vec_alloc<tree> (size);
 
       for (j = 0; j < size; j++)
        decls[j] = streamer_tree_cache_get_tree (data_in->reader_cache, data[j]);
@@ -2159,7 +2159,7 @@ create_subid_section_table (struct lto_section_slot *ls, splay_tree file_ids,
     }
   else
     {
-      file_data = ggc_alloc_lto_file_decl_data ();
+      file_data = ggc_alloc<lto_file_decl_data> ();
       memset(file_data, 0, sizeof (struct lto_file_decl_data));
       file_data->id = id;
       file_data->section_hash_table = lto_obj_create_section_hash_table ();;
@@ -2860,7 +2860,7 @@ lto_flatten_files (struct lto_file_decl_data **orig, int count, int last_file_ix
 
   lto_stats.num_input_files = count;
   all_file_decl_data
-    = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (count + 1);
+    = ggc_cleared_vec_alloc<lto_file_decl_data_ptr> (count + 1);
   /* Set the hooks so that all of the ipa passes can read in their data.  */
   lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
   for (i = 0, k = 0; i < last_file_ix; i++) 
@@ -2903,7 +2903,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
   timevar_push (TV_IPA_LTO_DECL_IN);
 
   real_file_decl_data
-    = decl_data = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (nfiles + 1);
+    = decl_data = ggc_cleared_vec_alloc<lto_file_decl_data_ptr> (nfiles + 1);
   real_file_count = nfiles;
 
   /* Read the resolution file.  */
index bcc5b82f97b2d44acc4d58604f169021940d5111..73a41b6bcea9d68dfa07e9e519427e834746cb05 100644 (file)
@@ -1,3 +1,14 @@
+2014-05-17  Trevor Saunders  <tsaunders@mozilla.com>
+
+       * 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.
+
 2014-05-06  Kenneth Zadeck  <zadeck@naturalbridge.com>
            Mike Stump  <mikestump@comcast.net>
            Richard Sandiford  <rdsandiford@googlemail.com>
index ff5d1e5d7aade1cf0abc96e1f4d28c186ab4c832..03b41504c4ad4ea7cc346bc9ceba7a59b4888e6f 100644 (file)
@@ -3199,7 +3199,7 @@ objc_build_string_object (tree string)
 
   if (!desc)
     {
-      *loc = desc = ggc_alloc_string_descriptor ();
+      *loc = desc = ggc_alloc<string_descriptor> ();
       desc->literal = string;
       desc->constructor =
        (*runtime.build_const_string_constructor) (input_location, string, length);
@@ -7032,7 +7032,7 @@ continue_class (tree klass)
        uprivate_record = CLASS_STATIC_TEMPLATE (implementation_template);
        objc_instance_type = build_pointer_type (uprivate_record);
 
-       imp_entry = ggc_alloc_imp_entry ();
+       imp_entry = ggc_alloc<struct imp_entry> ();
 
        imp_entry->next = imp_list;
        imp_entry->imp_context = klass;
index 0c7fa0456d3a5395bca9ca113da727eacef5e4d9..7e1e265bf08948c5787e50b43950b30e18522722 100644 (file)
@@ -192,8 +192,7 @@ typedef enum objc_property_assign_semantics {
 #define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type)
 #define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE)                            \
   do {                                                                 \
-    TYPE_LANG_SPECIFIC (NODE)                                          \
-      = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));       \
+      TYPE_LANG_SPECIFIC (NODE) = ggc_cleared_alloc<struct lang_type> (); \
   } while (0)
 
 #define TYPE_HAS_OBJC_INFO(TYPE)                               \
index 386d2c5f6a8f670d5604499694b842ab091cefe8..aaee7295a9f6e07948f27ab342713f4008d02377 100644 (file)
@@ -56,7 +56,7 @@ next_power_of_two (size_t x)
 objc_map_t
 objc_map_alloc_ggc (size_t initial_capacity)
 {
-  objc_map_t map = (objc_map_t) ggc_internal_cleared_vec_alloc (1, sizeof (struct objc_map_private));
+  objc_map_t map = ggc_cleared_alloc<objc_map_private> ();
   if (map == NULL)
     OUT_OF_MEMORY;
   
@@ -67,8 +67,8 @@ objc_map_alloc_ggc (size_t initial_capacity)
   map->maximum_load_factor = 70;
   map->max_number_of_non_empty_slots = (initial_capacity * map->maximum_load_factor) / 100;
 
-  map->slots = (tree *)ggc_internal_cleared_vec_alloc (initial_capacity, sizeof (tree));
-  map->values = (tree *)ggc_internal_cleared_vec_alloc (initial_capacity, sizeof (tree));
+  map->slots = ggc_cleared_vec_alloc<tree> (initial_capacity);
+  map->values = ggc_cleared_vec_alloc<tree> (initial_capacity);
 
   if (map->slots == NULL)
     OUT_OF_MEMORY;
@@ -112,8 +112,8 @@ objc_map_private_resize (objc_map_t map, size_t new_number_of_slots)
   map->max_number_of_non_empty_slots = (map->number_of_slots * map->maximum_load_factor) / 100;
 
 
-  map->slots = (tree *)ggc_internal_cleared_vec_alloc (map->number_of_slots, sizeof (tree));
-  map->values = (tree *)ggc_internal_cleared_vec_alloc (map->number_of_slots, sizeof (tree));
+  map->slots = ggc_cleared_vec_alloc<tree> (map->number_of_slots);
+  map->values = ggc_cleared_vec_alloc<tree> (map->number_of_slots);
 
   if (map->slots == NULL)
     OUT_OF_MEMORY;
index ee43d2d0ce851275d26dfe0aa289f9dd3dba0a73..85033a3074c5a042f0b684e6cdc94b40f617df8d 100644 (file)
@@ -238,7 +238,7 @@ static GTY ((length ("SIZEHASHTABLE"))) hash *extern_names;
 bool
 objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
 {
-  extern_names = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
+  extern_names = ggc_cleared_vec_alloc<hash> (SIZEHASHTABLE);
 
   if (flag_objc_exceptions && flag_objc_sjlj_exceptions)
     {
@@ -857,7 +857,7 @@ hash_name_enter (hash *hashlist, tree id)
   hash obj;
   int slot = IDENTIFIER_HASH_VALUE (DECL_NAME (id)) % SIZEHASHTABLE;
 
-  obj = ggc_alloc_hashed_entry ();
+  obj = ggc_alloc<hashed_entry> ();
   obj->list = 0;
   obj->next = hashlist[slot];
   obj->key = id;
index 63b37304887adac95d8a40a681cd8b1bc55554bc..247113820840b4a3cd94c67bb05fbd521b85bd47 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-17  Trevor Saunders  <tsaunders@mozilla.com>
+
+       * objcp-decl.h: Adjust.
+
 2014-04-14  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * objcp-decl.h (OBJC_TYPE_NAME, OBJC_SET_TYPE_NAME): Use
index 652f9933895d5d15393c4c15fed287b549a68851..46eb4f3314c765027ac26b3f5ca98aa154dd1074 100644 (file)
@@ -66,8 +66,8 @@ extern tree objcp_end_compound_stmt (tree, int);
 #undef ALLOC_OBJC_TYPE_LANG_SPECIFIC
 #define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE)                            \
   do {                                                                 \
-    TYPE_LANG_SPECIFIC (NODE) = ggc_alloc_cleared_lang_type            \
-      (sizeof (struct lang_type_class));               \
+    TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *) \
+      ggc_internal_cleared_alloc (sizeof (struct lang_type_class));    \
     TYPE_LANG_SPECIFIC (NODE)->u.c.h.is_lang_type_class = 1;           \
   } while (0)
 
index abc36ed41f854201e63ab1a1056cc2e24a132c2f..fc58b63b9ee4a328d65595ac746518760231fe0b 100644 (file)
@@ -6153,7 +6153,7 @@ set_optab_libfunc (optab op, enum machine_mode mode, const char *name)
     val = 0;
   slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
   if (*slot == NULL)
-    *slot = ggc_alloc_libfunc_entry ();
+    *slot = ggc_alloc<libfunc_entry> ();
   (*slot)->op = op;
   (*slot)->mode1 = mode;
   (*slot)->mode2 = VOIDmode;
@@ -6181,7 +6181,7 @@ set_conv_libfunc (convert_optab optab, enum machine_mode tmode,
     val = 0;
   slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
   if (*slot == NULL)
-    *slot = ggc_alloc_libfunc_entry ();
+    *slot = ggc_alloc<libfunc_entry> ();
   (*slot)->op = optab;
   (*slot)->mode1 = tmode;
   (*slot)->mode2 = fmode;
@@ -6274,8 +6274,7 @@ init_tree_optimization_optabs (tree optnode)
   if (tmp_optabs)
     memset (tmp_optabs, 0, sizeof (struct target_optabs));
   else
-    tmp_optabs = (struct target_optabs *)
-      ggc_alloc_atomic (sizeof (struct target_optabs));
+    tmp_optabs = ggc_alloc<target_optabs> ();
 
   /* Generate a new set of optabs into tmp_optabs.  */
   init_all_optabs (tmp_optabs);
index 223b693d2cfbbb65d37a1de845a942a6eb95283f..43662513e9a5cf2f9f4e4da7f126b96f60d9d843 100644 (file)
@@ -1532,7 +1532,7 @@ do_per_function_toporder (void (*callback) (function *, void *data), void *data)
   else
     {
       gcc_assert (!order);
-      order = ggc_alloc_vec_cgraph_node_ptr (cgraph_n_nodes);
+      order = ggc_vec_alloc<cgraph_node_ptr> (cgraph_n_nodes);
       nnodes = ipa_reverse_postorder (order);
       for (i = nnodes - 1; i >= 0; i--)
         order[i]->process = 1;
index 8bead6c763049fe6f1ba6e204766747f652aeafb..d9460a097665037d1a562c0e845504d22e4a52f8 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -267,7 +267,7 @@ struct GTY((variable_size)) hwivec_def {
 /* RTL expression ("rtx").  */
 
 struct GTY((chain_next ("RTX_NEXT (&%h)"),
-           chain_prev ("RTX_PREV (&%h)"), variable_size)) rtx_def {
+           chain_prev ("RTX_PREV (&%h)"))) rtx_def {
   /* The kind of expression this is.  */
   ENUM_BITFIELD(rtx_code) code: 16;
 
@@ -422,7 +422,7 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"),
    for a variable number of things.  The principle use is inside
    PARALLEL expressions.  */
 
-struct GTY((variable_size)) rtvec_def {
+struct GTY(()) rtvec_def {
   int num_elem;                /* number of elements */
   rtx GTY ((length ("%h.num_elem"))) elem[1];
 };
index 342c5e864d904be410fb7669925632a245a4e26d..a0b08995513ada04cabf364ea4d072f05a479dee 100644 (file)
@@ -698,7 +698,7 @@ if_region_set_false_region (ifsese if_region, sese region)
 
   if (slot)
     {
-      struct loop_exit *loop_exit = ggc_alloc_cleared_loop_exit ();
+      struct loop_exit *loop_exit = ggc_cleared_alloc<struct loop_exit> ();
 
       memcpy (loop_exit, *((struct loop_exit **) slot), sizeof (struct loop_exit));
       htab_clear_slot (current_loops->exits, slot);
index e3175250ede1eeb4098f2c399457d00b93a80ed3..c880cb1e6785b132f58392c6a75d0bc10097c6b1 100644 (file)
@@ -258,10 +258,10 @@ static GTY(()) struct string_pool_data * spd;
 void
 gt_pch_save_stringpool (void)
 {
-  spd = ggc_alloc_string_pool_data ();
+  spd = ggc_alloc<string_pool_data> ();
   spd->nslots = ident_hash->nslots;
   spd->nelements = ident_hash->nelements;
-  spd->entries = ggc_alloc_vec_ht_identifier_ptr (spd->nslots);
+  spd->entries = ggc_vec_alloc<ht_identifier_ptr> (spd->nslots);
   memcpy (spd->entries, ident_hash->entries,
          spd->nslots * sizeof (spd->entries[0]));
 }
index 7cf95aeeddfe98037ba8631e2d0b3142980b7755..5f1a208f5f26c09b2465eddd1ace9ef68730102c 100644 (file)
@@ -83,13 +83,13 @@ save_target_globals (void)
   g = (struct target_globals *) p;
   g->flag_state = &p->flag_state;
   g->regs = ggc_internal_cleared_alloc (sizeof (struct target_regs));
-  g->rtl = ggc_alloc_cleared_target_rtl ();
+  g->rtl = ggc_cleared_alloc<target_rtl> ();
   g->hard_regs
     = ggc_internal_cleared_alloc (sizeof (struct target_hard_regs));
   g->reload = ggc_internal_cleared_alloc (sizeof (struct target_reload));
   g->expmed =  ggc_internal_cleared_alloc (sizeof (struct target_expmed));
   g->optabs = &p->optabs;
-  g->libfuncs = ggc_alloc_cleared_target_libfuncs ();
+  g->libfuncs = ggc_cleared_alloc<target_libfuncs> ();
   g->cfgloop = &p->cfgloop;
   g->ira = ggc_internal_cleared_alloc (sizeof (struct target_ira));
   g->ira_int = ggc_internal_cleared_alloc (sizeof (struct target_ira_int));
index 384e73ef645708afc551a54e494c81836c45bd92..a02bec0859b969c129f15d9ad4d1bd265933bced 100644 (file)
@@ -1156,7 +1156,7 @@ general_init (const char *argv0)
      table.  */
   init_ggc ();
   init_stringpool ();
-  line_table = ggc_alloc_line_maps ();
+  line_table = ggc_alloc<line_maps> ();
   linemap_init (line_table);
   line_table->reallocator = realloc_for_line_map;
   line_table->round_alloc_size = ggc_round_alloc_size;
index c0e44c78ebe73c4b3f673027e23cb3f5dbec21ac..f73f454cab594fb2a923a0667b542595c6168e00 100644 (file)
@@ -479,7 +479,7 @@ record_tm_replacement (tree from, tree to)
   if (tm_wrap_map == NULL)
     tm_wrap_map = htab_create_ggc (32, tree_map_hash, tree_map_eq, 0);
 
-  h = ggc_alloc_tree_map ();
+  h = ggc_alloc<tree_map> ();
   h->hash = htab_hash_pointer (from);
   h->base.from = from;
   h->to = to;
@@ -3070,7 +3070,7 @@ split_bb_make_tm_edge (gimple stmt, basic_block dest_bb,
   struct tm_restart_node *n = (struct tm_restart_node *) *slot;
   if (n == NULL)
     {
-      n = ggc_alloc_tm_restart_node ();
+      n = ggc_alloc<tm_restart_node> ();
       *n = dummy;
     }
   else
index 25e65e0ea3860cba544a36bbb4d660f79daa5a16..126a1a9e9c77452300ec86dea00df856ada4c20e 100644 (file)
@@ -6902,7 +6902,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
     }
 
   /* Initialize an empty loop tree.  */
-  struct loops *loops = ggc_alloc_cleared_loops ();
+  struct loops *loops = ggc_cleared_alloc<struct loops> ();
   init_loops_structure (dest_cfun, loops, 1);
   loops->state = LOOPS_MAY_HAVE_MULTIPLE_LATCHES;
   set_loops_for_fn (dest_cfun, loops);
index 8810a3ec559a93ae842f4dca0f923fad7e9be0bb..f4075fc5bd703e585c7a8e795c75fd736c5d31c8 100644 (file)
@@ -565,7 +565,7 @@ lambda_vector_gcd (lambda_vector vector, int size)
 static inline lambda_vector
 lambda_vector_new (int size)
 {
-  return (lambda_vector) ggc_internal_cleared_alloc (sizeof (int) * size);
+  return ggc_cleared_vec_alloc<int> (size);
 }
 
 /* Clear out vector VEC1 of length SIZE.  */
index 624f2775f7c59afe76687b316a9015f6c7635641..db02cbdb1b577d1809df7a3313013bf8102a7223 100644 (file)
@@ -82,7 +82,7 @@ add_stmt_to_eh_lp_fn (struct function *ifun, gimple t, int num)
 
   gcc_assert (num != 0);
 
-  n = ggc_alloc_throw_stmt_node ();
+  n = ggc_alloc<throw_stmt_node> ();
   n->stmt = t;
   n->lp_nr = num;
 
index 37ee7522ba17c5d08a4f02512a55fe6a12af55d8..c4412bad4d5127897edd24cb457a7d2609b2f4cf 100644 (file)
@@ -131,7 +131,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
     }
   else
     {
-      head = ggc_alloc_tree_statement_list_node ();
+      head = ggc_alloc<tree_statement_list_node> ();
       head->prev = NULL;
       head->next = NULL;
       head->stmt = t;
@@ -207,7 +207,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
     }
   else
     {
-      head = ggc_alloc_tree_statement_list_node ();
+      head = ggc_alloc<tree_statement_list_node> ();
       head->prev = NULL;
       head->next = NULL;
       head->stmt = t;
index af7230829629e4625cd1e55e0f6b760cf39e87fc..44758556f9bd1ebd083b758d689848ef663b1152 100644 (file)
@@ -332,7 +332,7 @@ new_scev_info_str (basic_block instantiated_below, tree var)
 {
   struct scev_info_str *res;
 
-  res = ggc_alloc_scev_info_str ();
+  res = ggc_alloc<scev_info_str> ();
   res->name_version = SSA_NAME_VERSION (var);
   res->chrec = chrec_not_analyzed_yet;
   res->instantiated_below = instantiated_below->index;
index a48ad10424e95f746ae3ad4a15fa2636025fd464..73376bc8e75b33ff515edc6b17efb9563ddf784a 100644 (file)
@@ -2674,7 +2674,7 @@ record_estimate (struct loop *loop, tree bound, const widest_int &i_bound,
          || loop->nb_iterations == NULL_TREE
          || TREE_CODE (loop->nb_iterations) != INTEGER_CST))
     {
-      struct nb_iter_bound *elt = ggc_alloc_nb_iter_bound ();
+      struct nb_iter_bound *elt = ggc_alloc<nb_iter_bound> ();
 
       elt->bound = i_bound;
       elt->stmt = at_stmt;
index 03d3e4d271ad1098e1a7bf03aac43afab3ae4ff2..492eee76835d6a85695a6fd614cb641abe12c61b 100644 (file)
@@ -276,8 +276,8 @@ ssa_operand_alloc (struct function *fn, unsigned size)
        }
 
 
-      ptr = ggc_alloc_ssa_operand_memory_d (sizeof (void *)
-                        + gimple_ssa_operands (fn)->ssa_operand_mem_size);
+      ptr = (ssa_operand_memory_d *) ggc_internal_alloc
+       (sizeof (void *) + gimple_ssa_operands (fn)->ssa_operand_mem_size);
 
       ptr->next = gimple_ssa_operands (fn)->operand_memory;
       gimple_ssa_operands (fn)->operand_memory = ptr;
index 5f9edd4e3e8f9c8ae6704ecaf1b78e4a3c6003fa..42fe5a721e542be0a1092a044c888a3774d7175f 100644 (file)
@@ -45,7 +45,7 @@ typedef struct use_optype_d *use_optype_p;
    operand memory manager.  Operands are suballocated out of this block.  The
    MEM array varies in size.  */
 
-struct GTY((chain_next("%h.next"), variable_size)) ssa_operand_memory_d {
+struct GTY((chain_next("%h.next"))) ssa_operand_memory_d {
   struct ssa_operand_memory_d *next;
   char mem[1];
 };
index 42a2783e31b01cc46f609554e853291cf0cbc344..f6f1effcf9cece0c0b5917d94ebd6a6527a20f78 100644 (file)
@@ -1120,7 +1120,7 @@ uid_ssaname_map_hash (const void *item)
 void
 init_tree_ssa (struct function *fn)
 {
-  fn->gimple_df = ggc_alloc_cleared_gimple_df ();
+  fn->gimple_df = ggc_cleared_alloc<gimple_df> ();
   fn->gimple_df->default_defs = htab_create_ggc (20, uid_ssaname_map_hash,
                                                 uid_ssaname_map_eq, NULL);
   pt_solution_reset (&fn->gimple_df->escaped);
index 20a2c3f2e1f4003ec13a54592f24604e44dffa5c..7f6a6af9ca5937fbe71e35b6a060230049083961 100644 (file)
@@ -199,7 +199,7 @@ set_range_info (tree name, enum value_range_type range_type,
     {
       size_t size = (sizeof (range_info_def)
                     + trailing_wide_ints <3>::extra_size (precision));
-      ri = ggc_alloc_range_info_def (size);
+      ri = static_cast<range_info_def *> (ggc_internal_alloc (size));
       ri->ints.set_precision (precision);
       SSA_NAME_RANGE_INFO (name) = ri;
       ri->set_nonzero_bits (wi::shwi (-1, precision));
@@ -428,7 +428,7 @@ get_ptr_info (tree t)
   pi = SSA_NAME_PTR_INFO (t);
   if (pi == NULL)
     {
-      pi = ggc_alloc_cleared_ptr_info_def ();
+      pi = ggc_cleared_alloc<ptr_info_def> ();
       pt_solution_reset (&pi->pt);
       mark_ptr_info_alignment_unknown (pi);
       SSA_NAME_PTR_INFO (t) = pi;
@@ -472,7 +472,7 @@ duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
   if (!ptr_info)
     return;
 
-  new_ptr_info = ggc_alloc_ptr_info_def ();
+  new_ptr_info = ggc_alloc<ptr_info_def> ();
   *new_ptr_info = *ptr_info;
 
   SSA_NAME_PTR_INFO (name) = new_ptr_info;
@@ -496,7 +496,7 @@ duplicate_ssa_name_range_info (tree name, enum value_range_type range_type,
   unsigned int precision = TYPE_PRECISION (TREE_TYPE (name));
   size_t size = (sizeof (range_info_def)
                 + trailing_wide_ints <3>::extra_size (precision));
-  new_range_info = ggc_alloc_range_info_def (size);
+  new_range_info = static_cast<range_info_def *> (ggc_internal_alloc (size));
   memcpy (new_range_info, range_info, size);
 
   gcc_assert (range_type == VR_RANGE || range_type == VR_ANTI_RANGE);
index fc5ecfc9855d64486e91ded5f32d82a27008f0d9..bead1198018dc198b52994845985fdf5e3bb08e4 100644 (file)
@@ -177,7 +177,7 @@ unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
   for (i = 0; i < SIGSZ; i++)
     r.sig[i] = (unsigned long) bp_unpack_value (bp, HOST_BITS_PER_LONG);
 
-  rp = ggc_alloc_real_value ();
+  rp = ggc_alloc<real_value> ();
   memcpy (rp, &r, sizeof (REAL_VALUE_TYPE));
   TREE_REAL_CST_PTR (expr) = rp;
 }
@@ -189,7 +189,7 @@ unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
 static void
 unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
 {
-  FIXED_VALUE_TYPE *fp = ggc_alloc_fixed_value ();
+  FIXED_VALUE_TYPE *fp = ggc_alloc<fixed_value> ();
   fp->mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
   fp->data.low = bp_unpack_var_len_int (bp);
   fp->data.high = bp_unpack_var_len_int (bp);
index 1b89b91dd0409509463da0cda4ff0b842f3324ab..4dd8e73c6cfaeda2bf90bce0f609668a6b85a7d8 100644 (file)
@@ -1670,7 +1670,7 @@ build_fixed (tree type, FIXED_VALUE_TYPE f)
   FIXED_VALUE_TYPE *fp;
 
   v = make_node (FIXED_CST);
-  fp = ggc_alloc_fixed_value ();
+  fp = ggc_alloc<fixed_value> ();
   memcpy (fp, &f, sizeof (FIXED_VALUE_TYPE));
 
   TREE_TYPE (v) = type;
@@ -1691,7 +1691,7 @@ build_real (tree type, REAL_VALUE_TYPE d)
      Consider doing it via real_convert now.  */
 
   v = make_node (REAL_CST);
-  dp = ggc_alloc_real_value ();
+  dp = ggc_alloc<real_value> ();
   memcpy (dp, &d, sizeof (REAL_VALUE_TYPE));
 
   TREE_TYPE (v) = type;
@@ -1748,7 +1748,7 @@ build_string (int len, const char *str)
 
   record_node_allocation_statistics (STRING_CST, length);
 
-  s = ggc_alloc_tree_node (length);
+  s = (tree) ggc_internal_alloc (length);
 
   memset (s, 0, sizeof (struct tree_typed));
   TREE_SET_CODE (s, STRING_CST);
@@ -6407,7 +6407,7 @@ decl_priority_info (tree decl)
   h = (struct tree_priority_map *) *loc;
   if (!h)
     {
-      h = ggc_alloc_cleared_tree_priority_map ();
+      h = ggc_cleared_alloc<tree_priority_map> ();
       *loc = h;
       h->base.from = decl;
       h->init = DEFAULT_INIT_PRIORITY;
@@ -6490,7 +6490,7 @@ decl_debug_expr_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 (debug_expr_for_decl, h, DECL_UID (from),
@@ -6521,7 +6521,7 @@ decl_value_expr_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 (value_expr_for_decl, h, DECL_UID (from),
@@ -6562,7 +6562,7 @@ decl_debug_args_insert (tree from)
   if (debug_args_for_decl == NULL)
     debug_args_for_decl = htab_create_ggc (64, tree_vec_map_hash,
                                           tree_vec_map_eq, 0);
-  h = ggc_alloc_tree_vec_map ();
+  h = ggc_alloc<tree_vec_map> ();
   h->base.from = from;
   h->to = NULL;
   loc = htab_find_slot_with_hash (debug_args_for_decl, h, DECL_UID (from),
@@ -6747,7 +6747,7 @@ type_hash_add (hashval_t hashcode, tree type)
   struct type_hash *h;
   void **loc;
 
-  h = ggc_alloc_type_hash ();
+  h = ggc_alloc<type_hash> ();
   h->hash = hashcode;
   h->type = type;
   loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT);
@@ -10314,7 +10314,7 @@ build_omp_clause (location_t loc, enum omp_clause_code code)
 
   record_node_allocation_statistics (OMP_CLAUSE, size);
 
-  t = ggc_alloc_tree_node (size);
+  t = (tree) ggc_internal_alloc (size);
   memset (t, 0, size);
   TREE_SET_CODE (t, OMP_CLAUSE);
   OMP_CLAUSE_SET_CODE (t, code);
index d9d740c7cd37b6bc2b8b4de69eafff75d01eb3e5..11461d00abd314efd5c927f1ccf917e89deeb8c0 100644 (file)
@@ -99,7 +99,7 @@ decl_for_type_insert (tree type, tree decl)
   struct tree_type_map *h;
   void **slot;
 
-  h = ggc_alloc_tree_type_map ();
+  h = ggc_alloc<tree_type_map> ();
   h->type.from = type;
   h->decl = decl;
   slot = htab_find_slot_with_hash (decl_tree_for_type, h, TYPE_UID (type),
index f8930b989b8a707ba2d2c397e938029e87915292..988665260cc4f40f94fa04ce8e32b5e8f7e38fd2 100644 (file)
@@ -242,7 +242,7 @@ get_unnamed_section (unsigned int flags, void (*callback) (const void *),
 {
   section *sect;
 
-  sect = ggc_alloc_section ();
+  sect = ggc_alloc<section> ();
   sect->unnamed.common.flags = flags | SECTION_UNNAMED;
   sect->unnamed.callback = callback;
   sect->unnamed.data = data;
@@ -259,7 +259,7 @@ get_noswitch_section (unsigned int flags, noswitch_section_callback callback)
 {
   section *sect;
 
-  sect = ggc_alloc_section ();
+  sect = ggc_alloc<section> ();
   sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
   sect->noswitch.callback = callback;
 
@@ -280,7 +280,7 @@ get_section (const char *name, unsigned int flags, tree decl)
   flags |= SECTION_NAMED;
   if (*slot == NULL)
     {
-      sect = ggc_alloc_section ();
+      sect = ggc_alloc<section> ();
       sect->named.common.flags = flags;
       sect->named.name = ggc_strdup (name);
       sect->named.decl = decl;
@@ -361,7 +361,7 @@ get_block_for_section (section *sect)
   block = (struct object_block *) *slot;
   if (block == NULL)
     {
-      block = ggc_alloc_cleared_object_block ();
+      block = ggc_cleared_alloc<object_block> ();
       block->sect = sect;
       *slot = block;
     }
@@ -381,7 +381,7 @@ create_block_symbol (const char *label, struct object_block *block,
 
   /* Create the extended SYMBOL_REF.  */
   size = RTX_HDR_SIZE + sizeof (struct block_symbol);
-  symbol = ggc_alloc_rtx_def (size);
+  symbol = (rtx) ggc_internal_alloc (size);
 
   /* Initialize the normal SYMBOL_REF fields.  */
   memset (symbol, 0, size);
@@ -3203,7 +3203,7 @@ build_constant_desc (tree exp)
   int labelno;
   tree decl;
 
-  desc = ggc_alloc_constant_descriptor_tree ();
+  desc = ggc_alloc<constant_descriptor_tree> ();
   desc->value = copy_constant (exp);
 
   /* Create a string containing the label name, in LABEL.  */
@@ -3616,7 +3616,7 @@ create_constant_pool (void)
 {
   struct rtx_constant_pool *pool;
 
-  pool = ggc_alloc_rtx_constant_pool ();
+  pool = ggc_alloc<rtx_constant_pool> ();
   pool->const_rtx_htab = htab_create_ggc (31, const_desc_rtx_hash,
                                          const_desc_rtx_eq, NULL);
   pool->first = NULL;
@@ -3682,7 +3682,7 @@ force_const_mem (enum machine_mode mode, rtx x)
     return copy_rtx (desc->mem);
 
   /* Otherwise, create a new descriptor.  */
-  desc = ggc_alloc_constant_descriptor_rtx ();
+  desc = ggc_alloc<constant_descriptor_rtx> ();
   *slot = desc;
 
   /* Align the location counter as required by EXP's data type.  */
@@ -5712,7 +5712,7 @@ record_tm_clone_pair (tree o, tree n)
   if (tm_clone_hash == NULL)
     tm_clone_hash = htab_create_ggc (32, tree_map_hash, tree_map_eq, 0);
 
-  h = ggc_alloc_tree_map ();
+  h = ggc_alloc<tree_map> ();
   h->hash = htab_hash_pointer (o);
   h->base.from = o;
   h->to = n;
index c4fd11c2946ed21d350f7b9bc73a33b5508dafe9..4525579f6916cf382002b9ac42df5ec96eee6257 100644 (file)
@@ -135,7 +135,7 @@ varpool_call_variable_insertion_hooks (varpool_node *node)
 varpool_node *
 varpool_create_empty_node (void)
 {   
-  varpool_node *node = ggc_alloc_cleared_varpool_node ();
+  varpool_node *node = ggc_cleared_alloc<varpool_node> ();
   node->type = SYMTAB_VARIABLE;
   return node;
 }