+2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * genextract.c (struct accum_extract): Add constructor and make
+ members auto_vec.
+ (gen_insn): Adjust.
+
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* tree.c (struct free_lang_data_d): Add constructor and change
struct accum_extract
{
- vec<locstr> oplocs;
- vec<locstr> duplocs;
- vec<int> dupnums;
- vec<char> pathstr;
+ accum_extract () : oplocs (10), duplocs (10), dupnums (10), pathstr (20) {}
+
+ auto_vec<locstr> oplocs;
+ auto_vec<locstr> duplocs;
+ auto_vec<int> dupnums;
+ auto_vec<char> pathstr;
};
/* Forward declarations. */
struct code_ptr *link;
struct accum_extract acc;
- acc.oplocs.create (10);
- acc.duplocs.create (10);
- acc.dupnums.create (10);
- acc.pathstr.create (20);
-
/* Walk the insn's pattern, remembering at all times the path
down to the walking point. */
/* This extraction is the same as ours. Just link us in. */
link->next = p->insns;
p->insns = link;
- goto done;
+ return;
}
/* Otherwise, make a new extraction method. We stash the arrays
memcpy (p->oplocs, acc.oplocs.address (), op_count * sizeof (locstr));
memcpy (p->duplocs, acc.duplocs.address (), dup_count * sizeof (locstr));
memcpy (p->dupnums, acc.dupnums.address (), dup_count * sizeof (int));
-
- done:
- acc.oplocs.release ();
- acc.duplocs.release ();
- acc.dupnums.release ();
- acc.pathstr.release ();
}
\f
/* Helper subroutine of walk_rtx: given a vec<locstr>, an index, and a