aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2012-09-10 20:04:13 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2012-09-10 20:04:13 -0400
commitf32682ca2516e009432be7f0dc0e4e4bfab9a944 (patch)
tree3030f0ec079f1a93f960208e432eb6f275d10a28 /gcc/dwarf2out.c
parentda4c5b2465322894e6d53cd14128ba21d0ff911b (diff)
downloadgcc-f32682ca2516e009432be7f0dc0e4e4bfab9a944.zip
gcc-f32682ca2516e009432be7f0dc0e4e4bfab9a944.tar.gz
gcc-f32682ca2516e009432be7f0dc0e4e4bfab9a944.tar.bz2
Remove unnecessary VEC function overloads.
Several VEC member functions that accept an element 'T' used to have two overloads: one taking 'T', the second taking 'T *'. This used to be needed because of the interface dichotomy between vectors of objects and vectors of pointers. In the past, vectors of pointers would use pass-by-value semantics, but vectors of objects would use pass-by-reference semantics. This is no longer necessary, but the distinction had remained. The main side-effect of this change is some code reduction in code that manipulates vectors of objects. For instance, - struct iterator_use *iuse; - - iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL); - iuse->iterator = iterator; - iuse->ptr = ptr; + struct iterator_use iuse = {iterator, ptr}; + VEC_safe_push (iterator_use, heap, iterator_uses, iuse); Compile time performance was not affected. Tested on x86_64 and ppc64. Also built all-gcc on all targets using VEC routines: arm, bfin, c6x, epiphany, ia64, mips, sh, spu, and vms. 2012-09-10 Diego Novillo <dnovillo@google.com> * vec.h (vec_t::quick_push): Remove overload that accepts 'T *'. Update all users. (vec_t::safe_push): Likewise. (vec_t::quick_insert): Likewise. (vec_t::lower_bound): Likewise. (vec_t::safe_insert): Likewise. (vec_t::replace): Change second argument to 'T &'. From-SVN: r191165
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9adb071..61ea948 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -3484,7 +3484,7 @@ add_dwarf_attr (dw_die_ref die, dw_attr_ref attr)
if (die->die_attr == NULL)
die->die_attr = VEC_alloc (dw_attr_node, gc, 1);
- VEC_safe_push (dw_attr_node, gc, die->die_attr, attr);
+ VEC_safe_push (dw_attr_node, gc, die->die_attr, *attr);
}
static inline enum dw_val_class
@@ -8218,7 +8218,7 @@ add_pubname_string (const char *str, dw_die_ref die)
e.die = die;
e.name = xstrdup (str);
- VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+ VEC_safe_push (pubname_entry, gc, pubname_table, e);
}
static void
@@ -8252,7 +8252,7 @@ add_enumerator_pubname (const char *scope_name, dw_die_ref die)
gcc_assert (scope_name);
e.name = concat (scope_name, get_AT_string (die, DW_AT_name), NULL);
e.die = die;
- VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+ VEC_safe_push (pubname_entry, gc, pubname_table, e);
}
/* Add a new entry to .debug_pubtypes if appropriate. */
@@ -8295,7 +8295,7 @@ add_pubtype (tree decl, dw_die_ref die)
{
e.die = die;
e.name = concat (scope_name, name, NULL);
- VEC_safe_push (pubname_entry, gc, pubtype_table, &e);
+ VEC_safe_push (pubname_entry, gc, pubtype_table, e);
}
/* Although it might be more consistent to add the pubinfo for the
@@ -14671,7 +14671,7 @@ defer_location (tree variable, dw_die_ref die)
deferred_locations entry;
entry.variable = variable;
entry.die = die;
- VEC_safe_push (deferred_locations, gc, deferred_locations_list, &entry);
+ VEC_safe_push (deferred_locations, gc, deferred_locations_list, entry);
}
/* Helper function for tree_add_const_value_attribute. Natively encode
@@ -19870,7 +19870,7 @@ append_entry_to_tmpl_value_parm_die_table (dw_die_ref die, tree arg)
entry.arg = arg;
VEC_safe_push (die_arg_entry, gc,
tmpl_value_parm_die_table,
- &entry);
+ entry);
}
/* Return TRUE if T is an instance of generic type, FALSE
@@ -20256,7 +20256,7 @@ push_dw_line_info_entry (dw_line_info_table *table,
dw_line_info_entry e;
e.opcode = opcode;
e.val = val;
- VEC_safe_push (dw_line_info_entry, gc, table->entries, &e);
+ VEC_safe_push (dw_line_info_entry, gc, table->entries, e);
}
/* Output a label to mark the beginning of a source code line entry
@@ -20376,7 +20376,7 @@ dwarf2out_start_source_file (unsigned int lineno, const char *filename)
e.code = DW_MACINFO_start_file;
e.lineno = lineno;
e.info = ggc_strdup (filename);
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
}
@@ -20395,7 +20395,7 @@ dwarf2out_end_source_file (unsigned int lineno ATTRIBUTE_UNUSED)
e.code = DW_MACINFO_end_file;
e.lineno = lineno;
e.info = NULL;
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
}
@@ -20417,12 +20417,12 @@ dwarf2out_define (unsigned int lineno ATTRIBUTE_UNUSED,
e.code = 0;
e.lineno = 0;
e.info = NULL;
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
e.code = DW_MACINFO_define;
e.lineno = lineno;
e.info = ggc_strdup (buffer);
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
}
@@ -20444,12 +20444,12 @@ dwarf2out_undef (unsigned int lineno ATTRIBUTE_UNUSED,
e.code = 0;
e.lineno = 0;
e.info = NULL;
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
e.code = DW_MACINFO_undef;
e.lineno = lineno;
e.info = ggc_strdup (buffer);
- VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+ VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
}
}
@@ -20725,7 +20725,7 @@ output_macinfo (void)
switch (ref->code)
{
case DW_MACINFO_start_file:
- VEC_safe_push (macinfo_entry, gc, files, ref);
+ VEC_safe_push (macinfo_entry, gc, files, *ref);
break;
case DW_MACINFO_end_file:
if (!VEC_empty (macinfo_entry, files))
@@ -21364,7 +21364,7 @@ move_linkage_attr (dw_die_ref die)
if (ix != VEC_length (dw_attr_node, die->die_attr) - 1)
{
VEC_pop (dw_attr_node, die->die_attr);
- VEC_quick_insert (dw_attr_node, die->die_attr, ix, &linkage);
+ VEC_quick_insert (dw_attr_node, die->die_attr, ix, linkage);
}
}