aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-06-28 09:07:40 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-06-28 07:07:40 +0000
commit3de37a5d22c6f7add3457929d3572d2de678d6c2 (patch)
tree4b5ffaf029ffb10382491dd44284f867ab19ba8b /gcc/jit
parentfb18c0c9fe26a77541dd63ca351832194969bef9 (diff)
downloadgcc-3de37a5d22c6f7add3457929d3572d2de678d6c2.zip
gcc-3de37a5d22c6f7add3457929d3572d2de678d6c2.tar.gz
gcc-3de37a5d22c6f7add3457929d3572d2de678d6c2.tar.bz2
Introduce auto_string_vec class.
2018-06-28 Martin Liska <mliska@suse.cz> * vec.h (class auto_string_vec): New (moved from auto_argvec). (auto_string_vec::~auto_string_vec): Likewise. 2018-06-28 Martin Liska <mliska@suse.cz> * jit-playback.c (class auto_argvec): Moved to vec.h. (auto_argvec::~auto_argvec): Likewise. (compile): Use the renamed name. (invoke_driver): Likewise. From-SVN: r262208
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/ChangeLog7
-rw-r--r--gcc/jit/jit-playback.c24
2 files changed, 9 insertions, 22 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 6e279f7..059cbb8 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,10 @@
+2018-06-28 Martin Liska <mliska@suse.cz>
+
+ * jit-playback.c (class auto_argvec): Moved to vec.h.
+ (auto_argvec::~auto_argvec): Likewise.
+ (compile): Use the renamed name.
+ (invoke_driver): Likewise.
+
2018-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR jit/84288
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index 258ebe8..01c4567 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -1749,26 +1749,6 @@ block (function *func,
m_label_expr = NULL;
}
-/* A subclass of auto_vec <char *> that frees all of its elements on
- deletion. */
-
-class auto_argvec : public auto_vec <char *>
-{
- public:
- ~auto_argvec ();
-};
-
-/* auto_argvec's dtor, freeing all contained strings, automatically
- chaining up to ~auto_vec <char *>, which frees the internal buffer. */
-
-auto_argvec::~auto_argvec ()
-{
- int i;
- char *str;
- FOR_EACH_VEC_ELT (*this, i, str)
- free (str);
-}
-
/* Compile a playback::context:
- Use the context's options to cconstruct command-line options, and
@@ -1822,7 +1802,7 @@ compile ()
/* Acquire the JIT mutex and set "this" as the active playback ctxt. */
acquire_mutex ();
- auto_argvec fake_args;
+ auto_string_vec fake_args;
make_fake_args (&fake_args, ctxt_progname, &requested_dumps);
if (errors_occurred ())
{
@@ -2440,7 +2420,7 @@ invoke_driver (const char *ctxt_progname,
/* Currently this lumps together both assembling and linking into
TV_ASSEMBLE. */
auto_timevar assemble_timevar (get_timer (), tv_id);
- auto_argvec argvec;
+ auto_string_vec argvec;
#define ADD_ARG(arg) argvec.safe_push (xstrdup (arg))
ADD_ARG (gcc_driver_name);