summaryrefslogtreecommitdiff
path: root/gcc/genopinit.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-27 12:04:21 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-27 12:04:21 +0000
commit58287c3f4b74a0bb479c7036117d5804eb6765c4 (patch)
treec299b554740820453d3def4a8e59007a86edd7c7 /gcc/genopinit.c
parentdb827453ce1b7f76552f8ba9a8d18e65d7bf8de8 (diff)
downloadgcc-58287c3f4b74a0bb479c7036117d5804eb6765c4.tar.gz
2012-11-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 193836 using svnmerge.py **broken, gcc/melt/xtramelt-ana-base.melt dont compile** git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@193843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genopinit.c')
-rw-r--r--gcc/genopinit.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index e0ffc8f286c..077a721b2ea 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -144,10 +144,8 @@ typedef struct pattern_d
unsigned int sort_num;
} pattern;
-DEF_VEC_O(pattern);
-DEF_VEC_ALLOC_O(pattern, heap);
-static VEC(pattern, heap) *patterns;
+static vec<pattern> patterns;
static bool
match_pattern (pattern *p, const char *name, const char *pat)
@@ -265,7 +263,7 @@ gen_insn (rtx insn)
{
p.op = optabs[pindex].op;
p.sort_num = (p.op << 16) | (p.m2 << 8) | p.m1;
- VEC_safe_push (pattern, heap, patterns, p);
+ patterns.safe_push (p);
return;
}
}
@@ -359,7 +357,7 @@ main (int argc, char **argv)
}
/* Sort the collected patterns. */
- qsort (VEC_address (pattern, patterns), VEC_length (pattern, patterns),
+ qsort (patterns.address (), patterns.length (),
sizeof (pattern), pattern_cmp);
/* Now that we've handled the "extra" patterns, eliminate them from
@@ -399,7 +397,7 @@ main (int argc, char **argv)
fprintf (h_file, "#define NUM_NORMLIB_OPTABS %u\n",
last_kind[3] - last_kind[2]);
fprintf (h_file, "#define NUM_OPTAB_PATTERNS %u\n",
- (unsigned) VEC_length (pattern, patterns));
+ (unsigned) patterns.length ());
fprintf (s_file,
"#include \"config.h\"\n"
@@ -420,13 +418,13 @@ main (int argc, char **argv)
fprintf (s_file,
"static const struct optab_pat pats[NUM_OPTAB_PATTERNS] = {\n");
- for (i = 0; VEC_iterate (pattern, patterns, i, p); ++i)
+ for (i = 0; patterns.iterate (i, &p); ++i)
fprintf (s_file, " { %#08x, CODE_FOR_%s },\n", p->sort_num, p->name);
fprintf (s_file, "};\n\n");
fprintf (s_file, "void\ninit_all_optabs (void)\n{\n");
fprintf (s_file, " bool *ena = this_target_optabs->pat_enable;\n");
- for (i = 0; VEC_iterate (pattern, patterns, i, p); ++i)
+ for (i = 0; patterns.iterate (i, &p); ++i)
fprintf (s_file, " ena[%u] = HAVE_%s;\n", i, p->name);
fprintf (s_file, "}\n\n");