From: Trevor Saunders Date: Wed, 13 Jul 2016 02:43:23 +0000 (+0000) Subject: genextract.c: add [cd]tors to accum_extract X-Git-Tag: upstream/12.2.0~45919 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cc578b969fb0000072519ed61312ee6ad0f0197;p=platform%2Fupstream%2Fgcc.git genextract.c: add [cd]tors to accum_extract gcc/ChangeLog: 2016-07-12 Trevor Saunders * genextract.c (struct accum_extract): Add constructor and make members auto_vec. (gen_insn): Adjust. From-SVN: r238280 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ab7475..16198c1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-07-12 Trevor Saunders + * genextract.c (struct accum_extract): Add constructor and make + members auto_vec. + (gen_insn): Adjust. + +2016-07-12 Trevor Saunders + * tree.c (struct free_lang_data_d): Add constructor and change types of members to ones that automatically manage resources. (fld_worklist_push): Adjust. diff --git a/gcc/genextract.c b/gcc/genextract.c index d591781..e6d5337 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -69,10 +69,12 @@ static struct code_ptr *peepholes; struct accum_extract { - vec oplocs; - vec duplocs; - vec dupnums; - vec pathstr; + accum_extract () : oplocs (10), duplocs (10), dupnums (10), pathstr (20) {} + + auto_vec oplocs; + auto_vec duplocs; + auto_vec dupnums; + auto_vec pathstr; }; /* Forward declarations. */ @@ -87,11 +89,6 @@ gen_insn (md_rtx_info *info) 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. */ @@ -142,7 +139,7 @@ gen_insn (md_rtx_info *info) /* 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 @@ -166,12 +163,6 @@ gen_insn (md_rtx_info *info) 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 (); } /* Helper subroutine of walk_rtx: given a vec, an index, and a