aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c116
1 files changed, 58 insertions, 58 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 0b655b44d51..7c217c8498f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -575,7 +575,7 @@ dwarf_cfi_name (unsigned int cfi_opc)
static inline dw_cfi_ref
new_cfi (void)
{
- dw_cfi_ref cfi = ggc_alloc (sizeof (dw_cfi_node));
+ dw_cfi_ref cfi = (dw_cfi_ref) ggc_alloc (sizeof (dw_cfi_node));
cfi->dw_cfi_next = NULL;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
@@ -1217,7 +1217,7 @@ queue_reg_save (const char *label, rtx reg, rtx sreg, HOST_WIDE_INT offset)
if (q == NULL)
{
- q = ggc_alloc (sizeof (*q));
+ q = (struct queued_reg_save *) ggc_alloc (sizeof (*q));
q->next = queued_reg_saves;
queued_reg_saves = q;
}
@@ -2559,7 +2559,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
if (fde_table_in_use == fde_table_allocated)
{
fde_table_allocated += FDE_TABLE_INCREMENT;
- fde_table = ggc_realloc (fde_table,
+ fde_table = (dw_fde_node *) ggc_realloc (fde_table,
fde_table_allocated * sizeof (dw_fde_node));
memset (fde_table + fde_table_in_use, 0,
FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
@@ -2619,7 +2619,7 @@ void
dwarf2out_frame_init (void)
{
/* Allocate the initial hunk of the fde_table. */
- fde_table = ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
+ fde_table = (dw_fde_node *) ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
@@ -3105,7 +3105,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 (sizeof (dw_loc_descr_node));
+ dw_loc_descr_ref descr = (dw_loc_descr_ref) ggc_alloc_cleared (sizeof (dw_loc_descr_node));
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@@ -3460,12 +3460,12 @@ build_cfa_loc (dw_cfa_location *cfa, HOST_WIDE_INT offset)
if (cfa->base_offset)
{
if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_breg0 + cfa->reg, cfa->base_offset, 0);
+ head = new_loc_descr ((enum dwarf_location_atom) (DW_OP_breg0 + cfa->reg), cfa->base_offset, 0);
else
head = new_loc_descr (DW_OP_bregx, cfa->reg, cfa->base_offset);
}
else if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
+ head = new_loc_descr ((enum dwarf_location_atom) (DW_OP_reg0 + cfa->reg), 0, 0);
else
head = new_loc_descr (DW_OP_regx, cfa->reg, 0);
@@ -3482,11 +3482,11 @@ build_cfa_loc (dw_cfa_location *cfa, HOST_WIDE_INT offset)
{
if (offset == 0)
if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
+ head = new_loc_descr ((enum dwarf_location_atom) (DW_OP_reg0 + cfa->reg), 0, 0);
else
head = new_loc_descr (DW_OP_regx, cfa->reg, 0);
else if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_breg0 + cfa->reg, offset, 0);
+ head = new_loc_descr ((enum dwarf_location_atom) (DW_OP_breg0 + cfa->reg), offset, 0);
else
head = new_loc_descr (DW_OP_bregx, cfa->reg, offset);
}
@@ -5579,7 +5579,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 (sizeof (die_node));
+ dw_die_ref die = (dw_die_ref) ggc_alloc_cleared (sizeof (die_node));
die->die_tag = tag_value;
@@ -5589,7 +5589,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 (sizeof (limbo_die_node));
+ limbo_node = (limbo_die_node *) ggc_alloc_cleared (sizeof (limbo_die_node));
limbo_node->die = die;
limbo_node->created_for = t;
limbo_node->next = limbo_die_list;
@@ -5636,7 +5636,7 @@ decl_die_table_eq (const void *x, const void *y)
static inline dw_die_ref
lookup_decl_die (tree decl)
{
- return htab_find_with_hash (decl_die_table, decl, DECL_UID (decl));
+ return (dw_die_ref) htab_find_with_hash (decl_die_table, decl, DECL_UID (decl));
}
/* Returns a hash value for X (which really is a var_loc_list). */
@@ -5661,7 +5661,7 @@ decl_loc_table_eq (const void *x, const void *y)
static inline var_loc_list *
lookup_decl_loc (tree decl)
{
- return htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl));
+ return (var_loc_list *) htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl));
}
/* Equate a DIE to a particular declaration. */
@@ -5689,12 +5689,12 @@ add_var_loc_to_decl (tree decl, struct var_loc_node *loc)
slot = htab_find_slot_with_hash (decl_loc_table, decl, decl_id, INSERT);
if (*slot == NULL)
{
- temp = ggc_alloc_cleared (sizeof (var_loc_list));
+ temp = (var_loc_list *) ggc_alloc_cleared (sizeof (var_loc_list));
temp->decl_id = decl_id;
*slot = temp;
}
else
- temp = *slot;
+ temp = (var_loc_list *) *slot;
if (temp->last)
{
@@ -6179,7 +6179,7 @@ compute_section_prefix (dw_die_ref unit_die)
{
const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous";
- char *name = alloca (strlen (base) + 64);
+ char *name = (char *) alloca (strlen (base) + 64);
char *p;
int i, mark;
unsigned char checksum[16];
@@ -6300,7 +6300,7 @@ assign_symbol_names (dw_die_ref die)
{
if (comdat_symbol_id)
{
- char *p = alloca (strlen (comdat_symbol_id) + 64);
+ char *p = (char *) alloca (strlen (comdat_symbol_id) + 64);
sprintf (p, "%s.%s.%x", DIE_LABEL_PREFIX,
comdat_symbol_id, comdat_symbol_number++);
@@ -6324,7 +6324,7 @@ struct cu_hash_table_entry
static hashval_t
htab_cu_hash (const void *of)
{
- const struct cu_hash_table_entry *entry = of;
+ const struct cu_hash_table_entry *entry = (const struct cu_hash_table_entry *) of;
return htab_hash_string (entry->cu->die_symbol);
}
@@ -6332,8 +6332,8 @@ htab_cu_hash (const void *of)
static int
htab_cu_eq (const void *of1, const void *of2)
{
- const struct cu_hash_table_entry *entry1 = of1;
- const struct die_struct *entry2 = of2;
+ const struct cu_hash_table_entry *entry1 = (const struct cu_hash_table_entry *) of1;
+ const struct die_struct *entry2 = (struct die_struct *) of2;
return !strcmp (entry1->cu->die_symbol, entry2->die_symbol);
}
@@ -6341,7 +6341,7 @@ htab_cu_eq (const void *of1, const void *of2)
static void
htab_cu_del (void *what)
{
- struct cu_hash_table_entry *next, *entry = what;
+ struct cu_hash_table_entry *next, *entry = (struct cu_hash_table_entry *) what;
while (entry)
{
@@ -6561,7 +6561,7 @@ build_abbrev_table (dw_die_ref die)
if (abbrev_die_table_in_use >= abbrev_die_table_allocated)
{
n_alloc = abbrev_die_table_allocated + ABBREV_DIE_TABLE_INCREMENT;
- abbrev_die_table = ggc_realloc (abbrev_die_table,
+ abbrev_die_table = (dw_die_ref *) ggc_realloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
memset (&abbrev_die_table[abbrev_die_table_allocated], 0,
@@ -6853,7 +6853,7 @@ value_format (dw_attr_ref a)
case dw_val_class_macptr:
return DW_FORM_data;
case dw_val_class_str:
- return AT_string_form (a);
+ return (enum dwarf_form) AT_string_form (a);
case dw_val_class_file:
switch (constant_size (maybe_emit_file (a->dw_attr_val.v.val_file)))
{
@@ -6948,7 +6948,7 @@ static inline dw_loc_list_ref
new_loc_list (dw_loc_descr_ref expr, const char *begin, const char *end,
const char *section, unsigned int gensym)
{
- dw_loc_list_ref retlist = ggc_alloc_cleared (sizeof (dw_loc_list_node));
+ dw_loc_list_ref retlist = (dw_loc_list_ref) ggc_alloc_cleared (sizeof (dw_loc_list_node));
retlist->begin = begin;
retlist->end = end;
@@ -7294,7 +7294,7 @@ output_comp_unit (dw_die_ref die, int output_if_empty)
oldsym = die->die_symbol;
if (oldsym)
{
- tmp = alloca (strlen (oldsym) + 24);
+ tmp = (char *) alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
@@ -7339,7 +7339,7 @@ add_pubname (tree decl, dw_die_ref die)
{
pubname_table_allocated += PUBNAME_TABLE_INCREMENT;
pubname_table
- = ggc_realloc (pubname_table,
+ = (pubname_entry *) ggc_realloc (pubname_table,
(pubname_table_allocated * sizeof (pubname_entry)));
memset (pubname_table + pubname_table_in_use, 0,
PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry));
@@ -7399,7 +7399,7 @@ add_arange (tree decl, dw_die_ref die)
if (arange_table_in_use == arange_table_allocated)
{
arange_table_allocated += ARANGE_TABLE_INCREMENT;
- arange_table = ggc_realloc (arange_table,
+ arange_table = (dw_die_ref *) ggc_realloc (arange_table,
(arange_table_allocated
* sizeof (dw_die_ref)));
memset (arange_table + arange_table_in_use, 0,
@@ -7505,7 +7505,7 @@ add_ranges (tree block)
{
ranges_table_allocated += RANGES_TABLE_INCREMENT;
ranges_table
- = ggc_realloc (ranges_table, (ranges_table_allocated
+ = (struct dw_ranges_struct *) ggc_realloc (ranges_table, (ranges_table_allocated
* sizeof (struct dw_ranges_struct)));
memset (ranges_table + ranges_table_in_use, 0,
RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct));
@@ -7597,8 +7597,8 @@ struct dir_info
static int
file_info_cmp (const void *p1, const void *p2)
{
- const struct file_info *s1 = p1;
- const struct file_info *s2 = p2;
+ const struct file_info *s1 = (const struct file_info *) p1;
+ const struct file_info *s2 = (const struct file_info *) p2;
unsigned char *cp1;
unsigned char *cp2;
@@ -7641,8 +7641,8 @@ struct file_name_acquire_data
static int
file_name_acquire (void ** slot, void *data)
{
- struct file_name_acquire_data *fnad = data;
- struct dwarf_file_data *d = *slot;
+ struct file_name_acquire_data *fnad = (struct file_name_acquire_data *) data;
+ struct dwarf_file_data *d = (struct dwarf_file_data *)*slot;
struct file_info *fi;
const char *f;
@@ -7700,8 +7700,8 @@ output_file_names (void)
numfiles = last_emitted_file->emitted_number;
/* Allocate the various arrays we need. */
- files = alloca (numfiles * sizeof (struct file_info));
- dirs = alloca (numfiles * sizeof (struct dir_info));
+ files = (struct file_info *) alloca (numfiles * sizeof (struct file_info));
+ dirs = (struct dir_info *) alloca (numfiles * sizeof (struct dir_info));
fnad.files = files;
fnad.used_files = 0;
@@ -7759,8 +7759,8 @@ output_file_names (void)
where we would have to check out every combination of every single
possible prefix. Instead we use a heuristic which provides nearly optimal
results in most cases and never is much off. */
- saved = alloca (ndirs * sizeof (int));
- savehere = alloca (ndirs * sizeof (int));
+ saved = (int *) alloca (ndirs * sizeof (int));
+ savehere = (int *) alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
@@ -7826,7 +7826,7 @@ output_file_names (void)
/* We have to emit them in the order of emitted_number since that's
used in the debug info generation. To do this efficiently we
generate a back-mapping of the indices first. */
- backmap = alloca (numfiles * sizeof (int));
+ backmap = (int *) alloca (numfiles * sizeof (int));
for (i = 0; i < numfiles; i++)
backmap[files[i].file_idx->emitted_number - 1] = i;
@@ -8211,7 +8211,7 @@ base_type_die (tree type)
if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
encoding = DW_ATE_complex_float;
else
- encoding = DW_ATE_lo_user;
+ encoding = (enum dwarf_type) DW_ATE_lo_user;
break;
case BOOLEAN_TYPE:
@@ -8623,7 +8623,7 @@ static dw_loc_descr_ref
one_reg_loc_descriptor (unsigned int regno)
{
if (regno <= 31)
- return new_loc_descr (DW_OP_reg0 + regno, 0, 0);
+ return new_loc_descr ((enum dwarf_location_atom) (DW_OP_reg0 + regno), 0, 0);
else
return new_loc_descr (DW_OP_regx, regno, 0);
}
@@ -8700,7 +8700,7 @@ int_loc_descriptor (HOST_WIDE_INT i)
if (i >= 0)
{
if (i <= 31)
- op = DW_OP_lit0 + i;
+ op = (enum dwarf_location_atom) (DW_OP_lit0 + i);
else if (i <= 0xff)
op = DW_OP_const1u;
else if (i <= 0xffff)
@@ -8759,7 +8759,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset)
regno = dbx_reg_number (reg);
if (regno <= 31)
- return new_loc_descr (DW_OP_breg0 + regno, offset, 0);
+ return new_loc_descr ((enum dwarf_location_atom) (DW_OP_breg0 + regno), offset, 0);
else
return new_loc_descr (DW_OP_bregx, regno, offset);
}
@@ -9148,7 +9148,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
if (! CONSTANT_P (rtl))
return 0;
- ret = new_loc_descr (INTERNAL_DW_OP_tls_addr, 0, 0);
+ ret = new_loc_descr ((enum dwarf_location_atom) INTERNAL_DW_OP_tls_addr, 0, 0);
ret->dw_loc_oprnd1.val_class = dw_val_class_addr;
ret->dw_loc_oprnd1.v.val_addr = rtl;
@@ -9874,7 +9874,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
if (SCALAR_FLOAT_MODE_P (mode))
{
unsigned int length = GET_MODE_SIZE (mode);
- unsigned char *array = ggc_alloc (length);
+ unsigned char *array = (unsigned char *) ggc_alloc (length);
insert_float (rtl, array);
add_AT_vec (die, DW_AT_const_value, length / 4, 4, array);
@@ -9895,7 +9895,7 @@ 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 = ggc_alloc (length * elt_size);
+ unsigned char *array = (unsigned char *) ggc_alloc (length * elt_size);
unsigned int i;
unsigned char *p;
@@ -11105,7 +11105,7 @@ add_calling_convention_attribute (dw_die_ref subr_die, tree type)
{
enum dwarf_calling_convention value = DW_CC_normal;
- value = targetm.dwarf_calling_convention (type);
+ value = (enum dwarf_calling_convention) targetm.dwarf_calling_convention (type);
/* Only add the attribute if the backend requests it, and
is not DW_CC_normal. */
@@ -11599,7 +11599,7 @@ premark_used_types_helper (void **slot, void *data ATTRIBUTE_UNUSED)
tree type;
dw_die_ref die;
- type = *slot;
+ type = (tree) *slot;
die = lookup_type_die (type);
if (die != NULL)
die->die_perennial_p = 1;
@@ -13503,15 +13503,15 @@ dwarf2out_ignore_block (tree block)
static int
file_table_eq (const void *p1_p, const void *p2_p)
{
- const struct dwarf_file_data * p1 = p1_p;
- const char * p2 = p2_p;
+ const struct dwarf_file_data * p1 = (const struct dwarf_file_data *) p1_p;
+ const char * p2 = (const char *) p2_p;
return strcmp (p1->filename, p2) == 0;
}
static hashval_t
file_table_hash (const void *p_p)
{
- const struct dwarf_file_data * p = p_p;
+ const struct dwarf_file_data * p =(const struct dwarf_file_data *) p_p;
return htab_hash_string (p->filename);
}
@@ -13543,9 +13543,9 @@ lookup_filename (const char *file_name)
slot = htab_find_slot_with_hash (file_table, file_name,
htab_hash_string (file_name), INSERT);
if (*slot)
- return *slot;
+ return (struct dwarf_file_data *) *slot;
- created = ggc_alloc (sizeof (struct dwarf_file_data));
+ created = (struct dwarf_file_data *) ggc_alloc (sizeof (struct dwarf_file_data));
created->filename = file_name;
created->emitted_number = 0;
*slot = created;
@@ -13598,7 +13598,7 @@ dwarf2out_var_location (rtx loc_note)
return;
prev_insn = PREV_INSN (loc_note);
- newloc = ggc_alloc_cleared (sizeof (struct var_loc_node));
+ newloc = (struct var_loc_node *) ggc_alloc_cleared (sizeof (struct var_loc_node));
/* If the insn we processed last time is the previous insn
and it is also a var location note, use the label we emitted
last time. */
@@ -13684,7 +13684,7 @@ dwarf2out_source_line (unsigned int line, const char *filename)
{
separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
separate_line_info_table
- = ggc_realloc (separate_line_info_table,
+ = (dw_separate_line_info_entry *) ggc_realloc (separate_line_info_table,
separate_line_info_table_allocated
* sizeof (dw_separate_line_info_entry));
memset (separate_line_info_table
@@ -13713,7 +13713,7 @@ dwarf2out_source_line (unsigned int line, const char *filename)
{
line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
line_info_table
- = ggc_realloc (line_info_table,
+ = (dw_line_info_entry *) ggc_realloc (line_info_table,
(line_info_table_allocated
* sizeof (dw_line_info_entry)));
memset (line_info_table + line_info_table_in_use, 0,
@@ -13826,14 +13826,14 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
decl_scope_table = VEC_alloc (tree, gc, 256);
/* Allocate the initial hunk of the abbrev_die_table. */
- abbrev_die_table = ggc_alloc_cleared (ABBREV_DIE_TABLE_INCREMENT
+ abbrev_die_table = (dw_die_ref *) ggc_alloc_cleared (ABBREV_DIE_TABLE_INCREMENT
* sizeof (dw_die_ref));
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused. */
abbrev_die_table_in_use = 1;
/* Allocate the initial hunk of the line_info_table. */
- line_info_table = ggc_alloc_cleared (LINE_INFO_TABLE_INCREMENT
+ line_info_table = (dw_line_info_entry *) ggc_alloc_cleared (LINE_INFO_TABLE_INCREMENT
* sizeof (dw_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
@@ -14186,8 +14186,8 @@ prune_unused_types (void)
static int
file_table_relative_p (void ** slot, void *param)
{
- bool *p = param;
- struct dwarf_file_data *d = *slot;
+ bool *p = (bool *) param;
+ struct dwarf_file_data *d = (struct dwarf_file_data *) *slot;
if (d->emitted_number && d->filename[0] != DIR_SEPARATOR)
{
*p = true;