diff options
Diffstat (limited to 'gcc/dwarf2out.cc')
-rw-r--r-- | gcc/dwarf2out.cc | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index ad2be7c..0ea73bf 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -397,11 +397,9 @@ dump_struct_debug (tree type, enum debug_info_usage usage, of the number. */ static unsigned int -get_full_len (const wide_int &op) +get_full_len (const dw_wide_int &op) { - int prec = wi::get_precision (op); - return ((prec + HOST_BITS_PER_WIDE_INT - 1) - / HOST_BITS_PER_WIDE_INT); + return CEIL (op.get_precision (), HOST_BITS_PER_WIDE_INT); } static bool @@ -3900,7 +3898,7 @@ static void add_data_member_location_attribute (dw_die_ref, tree, struct vlr_context *); static bool add_const_value_attribute (dw_die_ref, machine_mode, rtx); static void insert_int (HOST_WIDE_INT, unsigned, unsigned char *); -static void insert_wide_int (const wide_int &, unsigned char *, int); +static void insert_wide_int (const wide_int_ref &, unsigned char *, int); static unsigned insert_float (const_rtx, unsigned char *); static rtx rtl_for_decl_location (tree); static bool add_location_or_const_value_attribute (dw_die_ref, tree, bool); @@ -4594,19 +4592,31 @@ AT_unsigned (dw_attr_node *a) return a->dw_attr_val.v.val_unsigned; } +dw_wide_int * +alloc_dw_wide_int (const wide_int_ref &w) +{ + dw_wide_int *p + = (dw_wide_int *) ggc_internal_alloc (sizeof (dw_wide_int) + + ((w.get_len () - 1) + * sizeof (HOST_WIDE_INT))); + p->precision = w.get_precision (); + p->len = w.get_len (); + memcpy (p->val, w.get_val (), p->len * sizeof (HOST_WIDE_INT)); + return p; +} + /* Add an unsigned wide integer attribute value to a DIE. */ static inline void add_AT_wide (dw_die_ref die, enum dwarf_attribute attr_kind, - const wide_int& w) + const wide_int_ref &w) { dw_attr_node attr; attr.dw_attr = attr_kind; attr.dw_attr_val.val_class = dw_val_class_wide_int; attr.dw_attr_val.val_entry = NULL; - attr.dw_attr_val.v.val_wide = ggc_alloc<wide_int> (); - *attr.dw_attr_val.v.val_wide = w; + attr.dw_attr_val.v.val_wide = alloc_dw_wide_int (w); add_dwarf_attr (die, &attr); } @@ -16714,8 +16724,8 @@ mem_loc_descriptor (rtx rtl, 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<wide_int> (); - *mem_loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, mode); + mem_loc_result->dw_loc_oprnd2.v.val_wide + = alloc_dw_wide_int (rtx_mode_t (rtl, mode)); } break; @@ -17288,8 +17298,8 @@ loc_descriptor (rtx rtl, machine_mode mode, loc_result = new_loc_descr (DW_OP_implicit_value, GET_MODE_SIZE (int_mode), 0); loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int; - loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> (); - *loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, int_mode); + loc_result->dw_loc_oprnd2.v.val_wide + = alloc_dw_wide_int (rtx_mode_t (rtl, int_mode)); } break; @@ -20189,7 +20199,7 @@ extract_int (const unsigned char *src, unsigned int size) /* Writes wide_int values to dw_vec_const array. */ static void -insert_wide_int (const wide_int &val, unsigned char *dest, int elt_size) +insert_wide_int (const wide_int_ref &val, unsigned char *dest, int elt_size) { int i; @@ -20274,8 +20284,7 @@ add_const_value_attribute (dw_die_ref die, machine_mode mode, rtx rtl) && (GET_MODE_PRECISION (int_mode) & (HOST_BITS_PER_WIDE_INT - 1)) == 0) { - wide_int w = rtx_mode_t (rtl, int_mode); - add_AT_wide (die, DW_AT_const_value, w); + add_AT_wide (die, DW_AT_const_value, rtx_mode_t (rtl, int_mode)); return true; } return false; |