aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-05-17 23:07:23 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-05-17 23:07:23 +0000
commit766090c20f5b5507e78a02ce6e981046d26ded35 (patch)
treef657fc12a6ceba7ff463ba7da28b13db3a98589a /gcc/dwarf2out.c
parent231120e5d40bc975c1acae42f2c2ea289b0425ae (diff)
downloadgcc-766090c20f5b5507e78a02ce6e981046d26ded35.zip
gcc-766090c20f5b5507e78a02ce6e981046d26ded35.tar.gz
gcc-766090c20f5b5507e78a02ce6e981046d26ded35.tar.bz2
use templates instead of gengtype for typed allocation functions
gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 21833ed..4ea05a5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -992,7 +992,7 @@ dwarf2out_alloc_current_fde (void)
{
dw_fde_ref fde;
- fde = ggc_alloc_cleared_dw_fde_node ();
+ fde = ggc_cleared_alloc<dw_fde_node> ();
fde->decl = current_function_decl;
fde->funcdef_number = current_function_funcdef_no;
fde->fde_index = vec_safe_length (fde_vec);
@@ -1315,7 +1315,7 @@ static inline dw_loc_descr_ref
new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INT oprnd1,
unsigned HOST_WIDE_INT oprnd2)
{
- dw_loc_descr_ref descr = ggc_alloc_cleared_dw_loc_descr_node ();
+ dw_loc_descr_ref descr = ggc_cleared_alloc<dw_loc_descr_node> ();
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@@ -3814,7 +3814,7 @@ add_AT_wide (dw_die_ref die, enum dwarf_attribute attr_kind,
attr.dw_attr = attr_kind;
attr.dw_attr_val.val_class = dw_val_class_wide_int;
- attr.dw_attr_val.v.val_wide = ggc_alloc_cleared_wide_int ();
+ attr.dw_attr_val.v.val_wide = ggc_cleared_alloc<wide_int> ();
*attr.dw_attr_val.v.val_wide = w;
add_dwarf_attr (die, &attr);
}
@@ -3933,7 +3933,7 @@ find_AT_string_in_table (const char *str, htab_t table)
htab_hash_string (str), INSERT);
if (*slot == NULL)
{
- node = ggc_alloc_cleared_indirect_string_node ();
+ node = ggc_cleared_alloc<indirect_string_node> ();
node->str = ggc_strdup (str);
*slot = node;
}
@@ -4264,7 +4264,7 @@ add_addr_table_entry (void *addr, enum ate_kind kind)
if (*slot == HTAB_EMPTY_ENTRY)
{
- node = ggc_alloc_cleared_addr_table_entry ();
+ node = ggc_cleared_alloc<addr_table_entry> ();
init_addr_table_entry (node, kind, addr);
*slot = node;
}
@@ -4840,7 +4840,7 @@ splice_child_die (dw_die_ref parent, dw_die_ref child)
static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
- dw_die_ref die = ggc_alloc_cleared_die_node ();
+ dw_die_ref die = ggc_cleared_alloc<die_node> ();
die->die_tag = tag_value;
@@ -4850,7 +4850,7 @@ new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
limbo_die_node *limbo_node;
- limbo_node = ggc_alloc_cleared_limbo_die_node ();
+ limbo_node = ggc_cleared_alloc<limbo_die_node> ();
limbo_node->die = die;
limbo_node->created_for = t;
limbo_node->next = limbo_die_list;
@@ -5167,7 +5167,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
slot = htab_find_slot_with_hash (decl_loc_table, decl, decl_id, INSERT);
if (*slot == NULL)
{
- temp = ggc_alloc_cleared_var_loc_list ();
+ temp = ggc_cleared_alloc<var_loc_list> ();
temp->decl_id = decl_id;
*slot = temp;
}
@@ -5192,7 +5192,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
|| (NOTE_VAR_LOCATION_STATUS (temp->first->loc)
!= NOTE_VAR_LOCATION_STATUS (loc_note))))
{
- loc = ggc_alloc_cleared_var_loc_node ();
+ loc = ggc_cleared_alloc<var_loc_node> ();
temp->first->next = loc;
temp->last = loc;
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
@@ -5282,7 +5282,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
memset (loc, '\0', sizeof (*loc));
}
else
- loc = ggc_alloc_cleared_var_loc_node ();
+ loc = ggc_cleared_alloc<var_loc_node> ();
if (bitsize == -1 || piece_loc == NULL)
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
else
@@ -5299,7 +5299,7 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
}
else
{
- loc = ggc_alloc_cleared_var_loc_node ();
+ loc = ggc_cleared_alloc<var_loc_node> ();
temp->first = loc;
temp->last = loc;
loc->loc = construct_piece_list (loc_note, bitpos, bitsize);
@@ -6955,7 +6955,7 @@ clone_die (dw_die_ref die)
dw_attr_ref a;
unsigned ix;
- clone = ggc_alloc_cleared_die_node ();
+ clone = ggc_cleared_alloc<die_node> ();
clone->die_tag = die->die_tag;
FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
@@ -7001,7 +7001,7 @@ clone_as_declaration (dw_die_ref die)
return clone;
}
- clone = ggc_alloc_cleared_die_node ();
+ clone = ggc_cleared_alloc<die_node> ();
clone->die_tag = die->die_tag;
FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)
@@ -7361,7 +7361,7 @@ break_out_comdat_types (dw_die_ref die)
unit = new_die (DW_TAG_type_unit, NULL, NULL);
add_AT_unsigned (unit, DW_AT_language,
get_AT_unsigned (comp_unit_die (), DW_AT_language));
- type_node = ggc_alloc_cleared_comdat_type_node ();
+ type_node = ggc_cleared_alloc<comdat_type_node> ();
type_node->root_die = unit;
type_node->next = comdat_type_list;
comdat_type_list = type_node;
@@ -8455,7 +8455,7 @@ static inline dw_loc_list_ref
new_loc_list (dw_loc_descr_ref expr, const char *begin, const char *end,
const char *section)
{
- dw_loc_list_ref retlist = ggc_alloc_cleared_dw_loc_list_node ();
+ dw_loc_list_ref retlist = ggc_cleared_alloc<dw_loc_list_node> ();
retlist->begin = begin;
retlist->begin_entry = NULL;
@@ -12964,8 +12964,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
#endif
{
unsigned int length = GET_MODE_SIZE (mode);
- unsigned char *array
- = (unsigned char*) ggc_alloc_atomic (length);
+ unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
mem_loc_result->dw_loc_oprnd2.val_class = dw_val_class_vec;
@@ -12991,7 +12990,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
mem_loc_result->dw_loc_oprnd1.v.val_die_ref.external = 0;
mem_loc_result->dw_loc_oprnd2.val_class
= dw_val_class_wide_int;
- mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc_cleared_wide_int ();
+ mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
*mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
}
break;
@@ -13474,8 +13473,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
#endif
{
unsigned int length = GET_MODE_SIZE (mode);
- unsigned char *array
- = (unsigned char*) ggc_alloc_atomic (length);
+ unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
loc_result->dw_loc_oprnd2.val_class = dw_val_class_vec;
@@ -13495,7 +13493,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
loc_result = new_loc_descr (DW_OP_implicit_value,
GET_MODE_SIZE (mode), 0);
loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int;
- loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc_cleared_wide_int ();
+ loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
*loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
}
break;
@@ -13508,8 +13506,8 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
{
unsigned int elt_size = GET_MODE_UNIT_SIZE (GET_MODE (rtl));
unsigned int length = CONST_VECTOR_NUNITS (rtl);
- unsigned char *array = (unsigned char *)
- ggc_alloc_atomic (length * elt_size);
+ unsigned char *array
+ = ggc_vec_alloc<unsigned char> (length * elt_size);
unsigned int i;
unsigned char *p;
enum machine_mode imode = GET_MODE_INNER (mode);
@@ -14058,12 +14056,12 @@ add_loc_descr_to_each (dw_loc_list_ref list, dw_loc_descr_ref ref)
list = list->dw_loc_next;
while (list)
{
- copy = ggc_alloc_dw_loc_descr_node ();
+ copy = ggc_alloc<dw_loc_descr_node> ();
memcpy (copy, ref, sizeof (dw_loc_descr_node));
add_loc_descr (&list->expr, copy);
while (copy->dw_loc_next)
{
- dw_loc_descr_ref new_copy = ggc_alloc_dw_loc_descr_node ();
+ dw_loc_descr_ref new_copy = ggc_alloc<dw_loc_descr_node> ();
memcpy (new_copy, copy->dw_loc_next, sizeof (dw_loc_descr_node));
copy->dw_loc_next = new_copy;
copy = new_copy;
@@ -15247,7 +15245,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
else
{
unsigned int length = GET_MODE_SIZE (mode);
- unsigned char *array = (unsigned char *) ggc_alloc_atomic (length);
+ unsigned char *array = ggc_vec_alloc<unsigned char> (length);
insert_float (rtl, array);
add_AT_vec (die, DW_AT_const_value, length / 4, 4, array);
@@ -15260,8 +15258,8 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
enum machine_mode mode = GET_MODE (rtl);
unsigned int elt_size = GET_MODE_UNIT_SIZE (mode);
unsigned int length = CONST_VECTOR_NUNITS (rtl);
- unsigned char *array = (unsigned char *) ggc_alloc_atomic
- (length * elt_size);
+ unsigned char *array
+ = ggc_vec_alloc<unsigned char> (length * elt_size);
unsigned int i;
unsigned char *p;
enum machine_mode imode = GET_MODE_INNER (mode);
@@ -15851,7 +15849,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p,
{
slot = htab_find_slot_with_hash (cached_dw_loc_list_table, decl,
DECL_UID (decl), INSERT);
- cache = ggc_alloc_cleared_cached_dw_loc_list ();
+ cache = ggc_cleared_alloc<cached_dw_loc_list> ();
cache->decl_id = DECL_UID (decl);
cache->loc_list = list;
*slot = cache;
@@ -16047,8 +16045,7 @@ tree_add_const_value_attribute (dw_die_ref die, tree t)
HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (init));
if (size > 0 && (int) size == size)
{
- unsigned char *array = (unsigned char *)
- ggc_internal_cleared_alloc (size);
+ unsigned char *array = ggc_cleared_vec_alloc<unsigned char> (size);
if (native_encode_initializer (init, array, size))
{
@@ -16316,7 +16313,7 @@ comp_dir_string (void)
int wdlen;
wdlen = strlen (wd);
- wd1 = (char *) ggc_alloc_atomic (wdlen + 2);
+ wd1 = ggc_vec_alloc<char> (wdlen + 2);
strcpy (wd1, wd);
wd1 [wdlen] = DIR_SEPARATOR;
wd1 [wdlen + 1] = 0;
@@ -16811,7 +16808,7 @@ add_linkage_name (dw_die_ref die, tree decl)
{
limbo_die_node *asm_name;
- asm_name = ggc_alloc_cleared_limbo_die_node ();
+ asm_name = ggc_cleared_alloc<limbo_die_node> ();
asm_name->die = die;
asm_name->created_for = decl;
asm_name->next = deferred_asm_name;
@@ -16864,7 +16861,7 @@ dwarf2out_vms_debug_main_pointer (void)
dw_die_ref die;
/* Allocate the VMS debug main subprogram die. */
- die = ggc_alloc_cleared_die_node ();
+ die = ggc_cleared_alloc<die_node> ();
die->die_tag = DW_TAG_subprogram;
add_name_attribute (die, VMS_DEBUG_MAIN_POINTER);
ASM_GENERATE_INTERNAL_LABEL (label, PROLOGUE_END_LABEL,
@@ -21139,7 +21136,7 @@ lookup_filename (const char *file_name)
if (*slot)
return (struct dwarf_file_data *) *slot;
- created = ggc_alloc_dwarf_file_data ();
+ created = ggc_alloc<dwarf_file_data> ();
created->filename = file_name;
created->emitted_number = 0;
*slot = created;
@@ -21449,7 +21446,7 @@ dwarf2out_var_location (rtx loc_note)
if (!var_loc_p)
{
struct call_arg_loc_node *ca_loc
- = ggc_alloc_cleared_call_arg_loc_node ();
+ = ggc_cleared_alloc<call_arg_loc_node> ();
rtx prev = prev_real_insn (loc_note), x;
ca_loc->call_arg_loc_note = loc_note;
ca_loc->next = NULL;
@@ -21524,7 +21521,7 @@ new_line_info_table (void)
{
dw_line_info_table *table;
- table = ggc_alloc_cleared_dw_line_info_table_struct ();
+ table = ggc_cleared_alloc<dw_line_info_table_struct> ();
table->file_num = 1;
table->line_num = 1;
table->is_stmt = DWARF_LINE_DEFAULT_IS_STMT_START;
@@ -22293,7 +22290,7 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
vec_alloc (decl_scope_table, 256);
/* Allocate the initial hunk of the abbrev_die_table. */
- abbrev_die_table = ggc_alloc_cleared_vec_dw_die_ref
+ abbrev_die_table = ggc_cleared_vec_alloc<dw_die_ref>
(ABBREV_DIE_TABLE_INCREMENT);
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused. */
@@ -23198,7 +23195,7 @@ string_cst_pool_decl (tree t)
len = TREE_STRING_LENGTH (t);
vec_safe_push (used_rtx_array, rtl);
ref = new_die (DW_TAG_dwarf_procedure, comp_unit_die (), decl);
- array = (unsigned char *) ggc_alloc_atomic (len);
+ array = ggc_vec_alloc<unsigned char> (len);
memcpy (array, TREE_STRING_POINTER (t), len);
l = new_loc_descr (DW_OP_implicit_value, len, 0);
l->dw_loc_oprnd2.val_class = dw_val_class_vec;