Patchwork VEC re-write [patch 24/25]

login
register
mail settings
Submitter Diego Novillo
Date Nov. 15, 2012, 9:54 p.m.
Message ID <20121115215430.9F31AC0916@torture.tor.corp.google.com>
Download mbox | patch
Permalink /patch/199446/
State New
Headers show

Comments

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

	* gcc/config/vxworks.c (vxworks_emutls_var_fields):
	(vxworks_emutls_var_init):
Nathan Sidwell - Nov. 16, 2012, 7:18 a.m.
On 11/15/12 21:54, Diego Novillo wrote:
> 2012-11-15  Diego Novillo  <dnovillo@google.com>
>
> 	* gcc/config/vxworks.c (vxworks_emutls_var_fields):
> 	(vxworks_emutls_var_init):

looks right to me.

and in general ... Hurrah!  Go Templates!

Patch

diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index 9eeefc0..e305904 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -96,23 +96,24 @@  vxworks_emutls_var_fields (tree type, tree *name)
 static tree
 vxworks_emutls_var_init (tree var, tree decl, tree tmpl_addr)
 {
-  VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 3);
+  vec<constructor_elt, va_gc> *v;
+  vec_alloc (v, 3);
   
   tree type = TREE_TYPE (var);
   tree field = TYPE_FIELDS (type);
   
   constructor_elt elt = {field, fold_convert (TREE_TYPE (field), tmpl_addr)};
-  VEC_quick_push (constructor_elt, v, elt);
+  v->quick_push (elt);
   
   field = DECL_CHAIN (field);
   elt.index = field;
   elt.value = build_int_cst (TREE_TYPE (field), 0);
-  VEC_quick_push (constructor_elt, v, elt);
+  v->quick_push (elt);
   
   field = DECL_CHAIN (field);
   elt.index = field;
   elt.value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
-  VEC_quick_push (constructor_elt, v, elt);
+  v->quick_push (elt);
   
   return build_constructor (type, v);
 }