]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ree.c
Remove unnecessary VEC function overloads.
authorDiego Novillo <dnovillo@google.com>
Tue, 11 Sep 2012 00:04:13 +0000 (20:04 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Tue, 11 Sep 2012 00:04:13 +0000 (20:04 -0400)
commitf32682ca2516e009432be7f0dc0e4e4bfab9a944
tree3030f0ec079f1a93f960208e432eb6f275d10a28
parentda4c5b2465322894e6d53cd14128ba21d0ff911b
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
71 files changed:
gcc/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c
gcc/alias.c
gcc/c-family/c-common.c
gcc/c-family/c-pragma.c
gcc/c/c-decl.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/config/mips/mips.c
gcc/config/pa/pa.c
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/dwarf2cfi.c
gcc/dwarf2out.c
gcc/emit-rtl.c
gcc/except.c
gcc/fortran/trans-openmp.c
gcc/fwprop.c
gcc/gcc.c
gcc/gcse.c
gcc/genautomata.c
gcc/genextract.c
gcc/genopinit.c
gcc/gimple-low.c
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/gogo-tree.cc
gcc/graphite-sese-to-poly.c
gcc/ipa-inline-analysis.c
gcc/ipa-prop.c
gcc/ipa-split.c
gcc/java/class.c
gcc/java/expr.c
gcc/lto-cgraph.c
gcc/objc/objc-next-runtime-abi-02.c
gcc/opts-common.c
gcc/read-rtl.c
gcc/ree.c
gcc/reload1.c
gcc/sel-sched-ir.c
gcc/tree-call-cdce.c
gcc/tree-data-ref.c
gcc/tree-dfa.c
gcc/tree-diagnostic.c
gcc/tree-emutls.c
gcc/tree-sra.c
gcc/tree-ssa-dom.c
gcc/tree-ssa-pre.c
gcc/tree-ssa-reassoc.c
gcc/tree-ssa-sccvn.c
gcc/tree-ssa-structalias.c
gcc/tree-ssa.c
gcc/tree-switch-conversion.c
gcc/tree-vect-generic.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h
gcc/tree-vrp.c
gcc/tree.c
gcc/tree.h
gcc/var-tracking.c
gcc/varasm.c
gcc/vec.h