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
+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
+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.
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) \
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)
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)
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;
}
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);
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;
}
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);
/* 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);
/* 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 ();
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;
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
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)
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,
{
/* 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,
/* 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)
{
bitmap map;
- map = ggc_alloc_bitmap_head ();
+ map = ggc_alloc<bitmap_head> ();
bitmap_initialize_stat (map, NULL PASS_MEM_STAT);
if (GATHER_STATISTICS)
+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
/* 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];
};
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;
{
enum cpp_ttype token;
tree x = 0;
- opt_stack *p;
token = pragma_lex (&x);
if (token != CPP_EOF)
return;
}
- p = ggc_alloc_opt_stack ();
+ opt_stack *p = ggc_alloc<opt_stack> ();
p->prev = options_stack;
options_stack = p;
+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
binding_freelist = b->prev;
}
else
- b = ggc_alloc_c_binding ();
+ b = ggc_alloc<c_binding> ();
b->shadowed = 0;
b->decl = decl;
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;
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)
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 ();
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);
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;
/* 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;
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 ();
/* 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);
#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. */
tree objc_info;
};
-struct GTY((variable_size)) lang_decl {
+struct GTY(()) lang_decl {
char dummy;
};
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
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];
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);
alloc_block (void)
{
basic_block bb;
- bb = ggc_alloc_cleared_basic_block_def ();
+ bb = ggc_cleared_alloc<basic_block_def> ();
return bb;
}
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;
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;
if (!loops)
{
- loops = ggc_alloc_cleared_loops ();
+ loops = ggc_cleared_alloc<struct loops> ();
init_loops_structure (cfun, loops, 1);
}
aloop != cloop;
aloop = loop_outer (aloop))
{
- exit = ggc_alloc_loop_exit ();
+ exit = ggc_alloc<loop_exit> ();
exit->e = e;
exit->next = aloop->exits->next;
{
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
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)
}
else
{
- node = ggc_alloc_cleared_cgraph_node ();
+ node = ggc_cleared_alloc<cgraph_node> ();
node->uid = cgraph_max_uid++;
}
}
else
{
- edge = ggc_alloc_cgraph_edge ();
+ edge = ggc_alloc<struct cgraph_edge> ();
edge->uid = cgraph_edge_max_uid++;
}
{
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;
}
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;
}
}
{
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;
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;
aarch64_init_machine_status (void)
{
struct machine_function *machine;
- machine = ggc_alloc_cleared_machine_function ();
+ machine = ggc_cleared_alloc<machine_function> ();
return machine;
}
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. */
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));
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;
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;
static struct machine_function *
avr_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
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. */
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. */
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.
}
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;
}
}
- *loc = desc = ggc_alloc_cleared_cfstring_descriptor ();
+ *loc = desc = ggc_cleared_alloc<cfstring_descriptor> ();
desc->literal = str;
/* isa *. */
if (!*loc)
{
- *loc = ggc_alloc_cleared_cfstring_descriptor ();
+ *loc = ggc_cleared_alloc<cfstring_descriptor> ();
((struct cfstring_descriptor *)*loc)->literal = str;
}
}
/* 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;
}
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. */
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),
{
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;
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);
{
struct extern_list *p;
- p = ggc_alloc_extern_list ();
+ p = ggc_alloc<extern_list> ();
p->next = extern_head;
p->decl = decl;
p->name = name;
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;
p = p->next;
}
- p = ggc_alloc_stub_list ();
+ p = ggc_alloc<stub_list> ();
p->next = stub_head;
p->name = name;
stub_head = p;
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);
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. */
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
if (!*slot)
{
- *slot = ggc_alloc_pragma_entry ();
+ *slot = ggc_alloc<pragma_entry> ();
(*slot)->varname = ggc_strdup (varname);
}
(*slot)->address = address;
static struct machine_function *
mep_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
static rtx
if (!*slot)
{
- *slot = ggc_alloc_pragma_entry ();
+ *slot = ggc_alloc<pragma_entry> ();
(*slot)->flag = 0;
(*slot)->used = 0;
(*slot)->funcname = ggc_strdup (funcname);
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;
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;
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
static struct machine_function *
mmix_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
/* DATA_ABI_ALIGNMENT.
static struct machine_function *
moxie_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
{
struct machine_function *m;
- m = ggc_alloc_cleared_machine_function ();
+ m = ggc_cleared_alloc<machine_function> ();
return m;
}
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;
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. */
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
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,
{
struct machine_function *m;
- m = ggc_alloc_cleared_machine_function ();
+ m = ggc_cleared_alloc<machine_function> ();
m->virt_insns_ok = 1;
return m;
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;
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)
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;
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. */
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));
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
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. */
static struct machine_function *
tilegx_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
static struct machine_function *
tilepro_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
static struct machine_function *
xtensa_init_machine_status (void)
{
- return ggc_alloc_cleared_machine_function ();
+ return ggc_cleared_alloc<machine_function> ();
}
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;
+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
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;
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 ();
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),
tree record;
};
-struct GTY((variable_size)) lang_type {
+struct GTY(()) lang_type {
union lang_type_u
{
struct lang_type_header GTY((skip (""))) h;
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;
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; \
} \
/* 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);
&& 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;
/* 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;
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;
/* 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)
else
gcc_unreachable ();
- ld = ggc_alloc_cleared_lang_decl (size);
+ ld = (struct lang_decl *) ggc_internal_cleared_alloc (size);
ld->u.base.selector = sel;
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;
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;
|| 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;
free_binding_entry = entry->chain;
}
else
- entry = ggc_alloc_binding_entry_s ();
+ entry = ggc_alloc<binding_entry_s> ();
entry->name = name;
entry->type = type;
{
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. */
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;
free_bindings = binding->previous;
}
else
- binding = ggc_alloc_cxx_binding ();
+ binding = ggc_alloc<cxx_binding> ();
cxx_binding_init (binding, value, type);
= 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
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;
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;
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;
{
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;
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;
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;
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);
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 =
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;
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;
}
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;
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)
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;
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;
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;
{
/* 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
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;
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. */
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
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;
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;
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);
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;
{
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);
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;
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);
}
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;
}
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;
}
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;
{
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;
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;
}
|| (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);
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
}
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);
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)
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)
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;
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;
#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;
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;
#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;
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;
{
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);
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;
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);
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);
{
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;
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))
{
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;
{
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;
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,
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;
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;
{
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;
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. */
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;
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));
}
}
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));
}
free_sequence_stack = tem->next;
}
else
- tem = ggc_alloc_sequence_stack ();
+ tem = ggc_alloc<sequence_stack> ();
tem->next = seq_stack;
tem->first = get_insns ();
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,
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)
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);
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)
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;
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;
{
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;
+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
void
pushlevel (void)
{
- struct binding_level *newlevel = ggc_alloc_binding_level ();
+ struct binding_level *newlevel = ggc_alloc<binding_level> ();
*newlevel = clear_binding_level;
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
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,
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;
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;
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.
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;
}
};
/* 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];
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.
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;
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);
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;
{
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
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;
}
{
tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE;
- cfun = ggc_alloc_cleared_function ();
+ cfun = ggc_cleared_alloc<function> ();
init_eh_for_function ();
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;
}
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;
"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
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",
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
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. */
#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 *
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
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);
{
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++)
{
+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.
/* Language-dependent contents of a decl. */
-struct GTY((variable_size)) lang_decl
+struct GTY(()) lang_decl
{
char dummy;
};
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 ");
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;
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;
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;
{
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;
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);
+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.
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. */
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;
}
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)
if (cpool == NULL)
{
- cpool = ggc_alloc_cleared_CPool ();
+ cpool = ggc_cleared_alloc<CPool> ();
TYPE_CPOOL (klass) = cpool;
}
return cpool;
make_binding_level (void)
{
/* NOSTRICT */
- return ggc_alloc_cleared_binding_level ();
+ return ggc_cleared_alloc<binding_level> ();
}
void
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;
}
if (*as_pp)
return;
- *as_pp = ggc_alloc_type_assertion ();
+ *as_pp = ggc_alloc<type_assertion> ();
**(type_assertion **)as_pp = as;
}
#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; \
}
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
{
#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)
} 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;
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);
}
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);
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';
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));
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
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);
}
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;
};
/* 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;
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);
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. */
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);
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);
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);
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);
+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>
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. */
};
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]);
}
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 ();;
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++)
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. */
+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>
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);
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;
#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) \
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;
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;
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;
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)
{
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;
+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
#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)
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;
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;
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);
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;
/* 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;
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];
};
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);
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]));
}
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));
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;
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;
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
}
/* 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);
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. */
gcc_assert (num != 0);
- n = ggc_alloc_throw_stmt_node ();
+ n = ggc_alloc<throw_stmt_node> ();
n->stmt = t;
n->lp_nr = num;
}
else
{
- head = ggc_alloc_tree_statement_list_node ();
+ head = ggc_alloc<tree_statement_list_node> ();
head->prev = NULL;
head->next = NULL;
head->stmt = t;
}
else
{
- head = ggc_alloc_tree_statement_list_node ();
+ head = ggc_alloc<tree_statement_list_node> ();
head->prev = NULL;
head->next = NULL;
head->stmt = t;
{
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;
|| 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;
}
- 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;
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];
};
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);
{
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));
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;
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;
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);
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;
}
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);
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;
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;
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);
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;
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),
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),
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),
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);
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);
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),
{
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;
{
section *sect;
- sect = ggc_alloc_section ();
+ sect = ggc_alloc<section> ();
sect->noswitch.common.flags = flags | SECTION_NOSWITCH;
sect->noswitch.callback = callback;
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;
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;
}
/* 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);
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. */
{
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;
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. */
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;
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;
}