diff mbox

VEC re-write [patch 22/25]

Message ID 20121115215424.7C43AC0916@torture.tor.corp.google.com
State New
Headers show

Commit Message

Diego Novillo Nov. 15, 2012, 9:54 p.m. UTC
2012-11-15  Diego Novillo  <dnovillo@google.com>

	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* config/spu/spu-c.c: Use new vec API in vec.h.

Comments

David Edelsohn Nov. 17, 2012, 3:25 p.m. UTC | #1
On Thu, Nov 15, 2012 at 4:54 PM, Diego Novillo <dnovillo@google.com> wrote:
> 2012-11-15  Diego Novillo  <dnovillo@google.com>
>
>         Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
>
>         * config/spu/spu-c.c: Use new vec API in vec.h.

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index 905030d..6fa8d17 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -93,8 +93,8 @@  spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args)
 #define SCALAR_TYPE_P(t) (INTEGRAL_TYPE_P (t) \
 			  || SCALAR_FLOAT_TYPE_P (t) \
 			  || POINTER_TYPE_P (t))
-  VEC(tree,gc) *fnargs = (VEC(tree,gc) *) passed_args;
-  unsigned int nargs = VEC_length (tree, fnargs);
+  vec<tree, va_gc> *fnargs = static_cast <vec<tree, va_gc> *> (passed_args);
+  unsigned int nargs = vec_safe_length (fnargs);
   int new_fcode, fcode = DECL_FUNCTION_CODE (fndecl);
   struct spu_builtin_description *desc;
   tree match = NULL_TREE;
@@ -137,7 +137,7 @@  spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args)
 	      return error_mark_node;
 	    }
 
-	  var = VEC_index (tree, fnargs, p);
+	  var = (*fnargs)[p];
 
 	  if (TREE_CODE (var) == NON_LVALUE_EXPR)
 	    var = TREE_OPERAND (var, 0);