This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove a cleanup from symtab.c


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99ef965c6e812cc73691873c965cff0d2d5b89a0

commit 99ef965c6e812cc73691873c965cff0d2d5b89a0
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Sep 27 21:17:40 2017 -0600

    Remove a cleanup from symtab.c
    
    This removes an unused outer cleanup from symtab.c, and an unused
    cleanup declaration as well.
    
    gdb/ChangeLog
    2017-09-29  Tom Tromey  <tom@tromey.com>
    
    	* symtab.c (search_symbols): Remove unused outer cleanup.
    	(make_source_files_completion_list): Remove unused declaration.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/symtab.c  | 9 +--------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2bbe205..6227a8e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2017-09-29  Tom Tromey  <tom@tromey.com>
 
+	* symtab.c (search_symbols): Remove unused outer cleanup.
+	(make_source_files_completion_list): Remove unused declaration.
+
+2017-09-29  Tom Tromey  <tom@tromey.com>
+
 	* mt-tdep.c (mt_push_dummy_call): Use gdb::byte_vector.
 
 2017-09-29  Tom Tromey  <tom@tromey.com>
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 2da37e8..47385df 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4241,11 +4241,6 @@ search_symbols (const char *regexp, enum search_domain kind,
   int nfound;
   gdb::optional<compiled_regex> preg;
 
-  /* OLD_CHAIN .. RETVAL_CHAIN is always freed, RETVAL_CHAIN .. current
-     CLEANUP_CHAIN is freed only in the case of an error.  */
-  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
-  struct cleanup *retval_chain;
-
   gdb_assert (kind <= TYPES_DOMAIN);
 
   ourtype = types[kind];
@@ -4365,7 +4360,7 @@ search_symbols (const char *regexp, enum search_domain kind,
   found = NULL;
   tail = NULL;
   nfound = 0;
-  retval_chain = make_cleanup_free_search_symbols (&found);
+  struct cleanup *retval_chain = make_cleanup_free_search_symbols (&found);
 
   ALL_COMPUNITS (objfile, cust)
   {
@@ -4478,7 +4473,6 @@ search_symbols (const char *regexp, enum search_domain kind,
     }
 
   discard_cleanups (retval_chain);
-  do_cleanups (old_chain);
   *matches = found;
 }
 
@@ -5439,7 +5433,6 @@ make_source_files_completion_list (const char *text, const char *word)
   completion_list list;
   const char *base_name;
   struct add_partial_filename_data datum;
-  struct cleanup *back_to;
 
   if (!have_full_symbols () && !have_partial_symbols ())
     return list;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]