]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-ssa-address.c
This patch rewrites the old VEC macro-based interface into a new one
[thirdparty/gcc.git] / gcc / tree-ssa-address.c
index c5b8ff1056bfd572b8a699c4673d8eb9a178a884..3b1e068515a5b9a144ca73fb44878b85d3ae3934 100644 (file)
@@ -79,14 +79,12 @@ typedef struct GTY (()) mem_addr_template {
                                   be filled in.  */
 } mem_addr_template;
 
-DEF_VEC_O (mem_addr_template);
-DEF_VEC_ALLOC_O (mem_addr_template, gc);
 
 /* The templates.  Each of the low five bits of the index corresponds to one
    component of TARGET_MEM_REF being present, while the high bits identify
    the address space.  See TEMPL_IDX.  */
 
-static GTY(()) VEC (mem_addr_template, gc) *mem_addr_template_list;
+static GTY(()) vec<mem_addr_template, va_gc> *mem_addr_template_list;
 
 #define TEMPL_IDX(AS, SYMBOL, BASE, INDEX, STEP, OFFSET) \
   (((int) (AS) << 5) \
@@ -209,14 +207,11 @@ addr_for_mem_ref (struct mem_address *addr, addr_space_t as,
       unsigned int templ_index
        = TEMPL_IDX (as, addr->symbol, addr->base, addr->index, st, off);
 
-      if (templ_index
-         >= VEC_length (mem_addr_template, mem_addr_template_list))
-       VEC_safe_grow_cleared (mem_addr_template, gc, mem_addr_template_list,
-                              templ_index + 1);
+      if (templ_index >= vec_safe_length (mem_addr_template_list))
+       vec_safe_grow_cleared (mem_addr_template_list, templ_index + 1);
 
       /* Reuse the templates for addresses, so that we do not waste memory.  */
-      templ = &VEC_index (mem_addr_template, mem_addr_template_list,
-                         templ_index);
+      templ = &(*mem_addr_template_list)[templ_index];
       if (!templ->ref)
        {
          sym = (addr->symbol ?