Commit 3cc578b9 by Trevor Saunders Committed by Trevor Saunders

genextract.c: add [cd]tors to accum_extract

gcc/ChangeLog:

2016-07-12  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* genextract.c (struct accum_extract): Add constructor and make
	members auto_vec.
	(gen_insn): Adjust.

From-SVN: r238280
parent bf4fa671
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 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 * tree.c (struct free_lang_data_d): Add constructor and change
types of members to ones that automatically manage resources. types of members to ones that automatically manage resources.
(fld_worklist_push): Adjust. (fld_worklist_push): Adjust.
......
...@@ -69,10 +69,12 @@ static struct code_ptr *peepholes; ...@@ -69,10 +69,12 @@ static struct code_ptr *peepholes;
struct accum_extract struct accum_extract
{ {
vec<locstr> oplocs; accum_extract () : oplocs (10), duplocs (10), dupnums (10), pathstr (20) {}
vec<locstr> duplocs;
vec<int> dupnums; auto_vec<locstr> oplocs;
vec<char> pathstr; auto_vec<locstr> duplocs;
auto_vec<int> dupnums;
auto_vec<char> pathstr;
}; };
/* Forward declarations. */ /* Forward declarations. */
...@@ -87,11 +89,6 @@ gen_insn (md_rtx_info *info) ...@@ -87,11 +89,6 @@ gen_insn (md_rtx_info *info)
struct code_ptr *link; struct code_ptr *link;
struct accum_extract acc; 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 /* Walk the insn's pattern, remembering at all times the path
down to the walking point. */ down to the walking point. */
...@@ -142,7 +139,7 @@ gen_insn (md_rtx_info *info) ...@@ -142,7 +139,7 @@ gen_insn (md_rtx_info *info)
/* This extraction is the same as ours. Just link us in. */ /* This extraction is the same as ours. Just link us in. */
link->next = p->insns; link->next = p->insns;
p->insns = link; p->insns = link;
goto done; return;
} }
/* Otherwise, make a new extraction method. We stash the arrays /* Otherwise, make a new extraction method. We stash the arrays
...@@ -166,12 +163,6 @@ gen_insn (md_rtx_info *info) ...@@ -166,12 +163,6 @@ gen_insn (md_rtx_info *info)
memcpy (p->oplocs, acc.oplocs.address (), op_count * sizeof (locstr)); memcpy (p->oplocs, acc.oplocs.address (), op_count * sizeof (locstr));
memcpy (p->duplocs, acc.duplocs.address (), dup_count * sizeof (locstr)); memcpy (p->duplocs, acc.duplocs.address (), dup_count * sizeof (locstr));
memcpy (p->dupnums, acc.dupnums.address (), dup_count * sizeof (int)); memcpy (p->dupnums, acc.dupnums.address (), dup_count * sizeof (int));
done:
acc.oplocs.release ();
acc.duplocs.release ();
acc.dupnums.release ();
acc.pathstr.release ();
} }
/* Helper subroutine of walk_rtx: given a vec<locstr>, an index, and a /* Helper subroutine of walk_rtx: given a vec<locstr>, an index, and a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment