]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove regcache_xfree
authorTom Tromey <tom@tromey.com>
Sat, 23 Sep 2017 20:41:07 +0000 (14:41 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 26 Sep 2017 01:54:06 +0000 (19:54 -0600)
This removes regcache_xfree in favor of plain "delete".

gdb/ChangeLog
2017-09-25  Tom Tromey  <tom@tromey.com>

* spu-tdep.c (spu2ppu_dealloc_cache): Use delete.
* regcache.h (regcache_xfree): Don't declare.
* regcache.c (regcache_xfree): Remove.
(do_regcache_xfree): Use delete.
* ppc-linux-tdep.c (ppu2spu_dealloc_cache): Use delete.
* linux-fork.c (free_fork): Use delete.
(fork_save_infrun_state): Likewise.
* jit.c (jit_dealloc_cache): Use delete.
* infrun.c (discard_infcall_suspend_state): Use delete.

gdb/ChangeLog
gdb/infrun.c
gdb/jit.c
gdb/linux-fork.c
gdb/ppc-linux-tdep.c
gdb/regcache.c
gdb/regcache.h
gdb/spu-tdep.c

index b42a38f89c1862f0cc67de9c204a9aceb1bd9bb6..df70815ef9114eb2546f71f223a27d373a7bdd42 100644 (file)
@@ -1,3 +1,15 @@
+2017-09-25  Tom Tromey  <tom@tromey.com>
+
+       * spu-tdep.c (spu2ppu_dealloc_cache): Use delete.
+       * regcache.h (regcache_xfree): Don't declare.
+       * regcache.c (regcache_xfree): Remove.
+       (do_regcache_xfree): Use delete.
+       * ppc-linux-tdep.c (ppu2spu_dealloc_cache): Use delete.
+       * linux-fork.c (free_fork): Use delete.
+       (fork_save_infrun_state): Likewise.
+       * jit.c (jit_dealloc_cache): Use delete.
+       * infrun.c (discard_infcall_suspend_state): Use delete.
+
 2017-09-25  Tom Tromey  <tom@tromey.com>
 
        * regcache.h (regcache_xmalloc): Don't declare.
index 26853b1a8d17663a6b86bddf03231e1d7ca61c50..f44ca91e77cb1cd64172c9d5d2689cfd13b2ae26 100644 (file)
@@ -8921,7 +8921,7 @@ make_cleanup_restore_infcall_suspend_state
 void
 discard_infcall_suspend_state (struct infcall_suspend_state *inf_state)
 {
-  regcache_xfree (inf_state->registers);
+  delete inf_state->registers;
   xfree (inf_state->siginfo_data);
   xfree (inf_state);
 }
index 6eea38fc34b8b6b0812eee4b4bb7c5c526ac6c8d..a8e63b349e63fe357d31546665c9785fd136dfd4 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1167,7 +1167,7 @@ jit_dealloc_cache (struct frame_info *this_frame, void *cache)
   struct jit_unwind_private *priv_data = (struct jit_unwind_private *) cache;
 
   gdb_assert (priv_data->regcache != NULL);
-  regcache_xfree (priv_data->regcache);
+  delete priv_data->regcache;
   xfree (priv_data);
 }
 
index 22a11c6529bfa16313c403fa4e76f517c538d1ab..6b9c6a876016d2e3c7fa17e8c8da0017ef590f13 100644 (file)
@@ -126,7 +126,7 @@ free_fork (struct fork_info *fp)
   if (fp)
     {
       if (fp->savedregs)
-       regcache_xfree (fp->savedregs);
+       delete fp->savedregs;
       if (fp->filepos)
        xfree (fp->filepos);
       xfree (fp);
@@ -292,7 +292,7 @@ fork_save_infrun_state (struct fork_info *fp, int clobber_regs)
   DIR *d;
 
   if (fp->savedregs)
-    regcache_xfree (fp->savedregs);
+    delete fp->savedregs;
 
   fp->savedregs = regcache_dup (get_current_regcache ());
   fp->clobber_regs = clobber_regs;
index 4c851eb4d9ba01dcc7bfe7e18e609261680d9c93..2faee42fb6ebd90e1514bff71ae66a819b472720 100644 (file)
@@ -1382,7 +1382,7 @@ static void
 ppu2spu_dealloc_cache (struct frame_info *self, void *this_cache)
 {
   struct ppu2spu_cache *cache = (struct ppu2spu_cache *) this_cache;
-  regcache_xfree (cache->regcache);
+  delete cache->regcache;
 }
 
 static const struct frame_unwind ppu2spu_unwind = {
index 2a92cf02419687e36a861b20624d9b973e994995..54aed6cb536eb2375e34697e57fad08c0237badc 100644 (file)
@@ -241,19 +241,10 @@ regcache_get_ptid (const struct regcache *regcache)
   return regcache->ptid ();
 }
 
-void
-regcache_xfree (struct regcache *regcache)
-{
-  if (regcache == NULL)
-    return;
-
-  delete regcache;
-}
-
 static void
 do_regcache_xfree (void *data)
 {
-  regcache_xfree ((struct regcache *) data);
+  delete (struct regcache *) data;
 }
 
 struct cleanup *
index 877ed59b9b5aaac616f75995324c06ffb3f358c9..4a430ae5b636c4fc618107eb825e42f14a5f29a2 100644 (file)
@@ -35,7 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
                                                         struct gdbarch *,
                                                         struct address_space *);
 
-void regcache_xfree (struct regcache *regcache);
 struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache);
 
 /* Return REGCACHE's ptid.  */
index 4338d5c4be0c1dca396a652065c9f951143ba025..f77e37f370567d1a6907c75364782d3958b2f8ea 100644 (file)
@@ -1288,7 +1288,7 @@ static void
 spu2ppu_dealloc_cache (struct frame_info *self, void *this_cache)
 {
   struct spu2ppu_cache *cache = (struct spu2ppu_cache *) this_cache;
-  regcache_xfree (cache->regcache);
+  delete cache->regcache;
 }
 
 static const struct frame_unwind spu2ppu_unwind = {