[RFA,3/4] Remove last cleanups from go-exp.y

Message ID 20170906051306.6092-4-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Sept. 6, 2017, 5:13 a.m. UTC
  This removes the last remaining cleanups from go-exp.y.

ChangeLog
2017-09-05  Tom Tromey  <tom@tromey.com>

	* go-exp.y (go_parse): Don't create a cleanup.
---
 gdb/ChangeLog |  4 ++++
 gdb/go-exp.y  | 11 +----------
 2 files changed, 5 insertions(+), 10 deletions(-)
  

Comments

Pedro Alves Sept. 6, 2017, 7:32 p.m. UTC | #1
On 09/06/2017 06:13 AM, Tom Tromey wrote:
> This removes the last remaining cleanups from go-exp.y.
> 
> ChangeLog
> 2017-09-05  Tom Tromey  <tom@tromey.com>
> 
> 	* go-exp.y (go_parse): Don't create a cleanup.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d158b6e..cd7664b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@ 
 2017-09-05  Tom Tromey  <tom@tromey.com>
 
+	* go-exp.y (go_parse): Don't create a cleanup.
+
+2017-09-05  Tom Tromey  <tom@tromey.com>
+
 	* d-exp.y (PrimaryExpression): Use std::string.
 	(d_parse): Don't create a cleanup.
 
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index 098e734..629093a 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -1560,18 +1560,11 @@  yylex (void)
 int
 go_parse (struct parser_state *par_state)
 {
-  int result;
-  struct cleanup *back_to;
-
   /* Setting up the parser state.  */
   scoped_restore pstate_restore = make_scoped_restore (&pstate);
   gdb_assert (par_state != NULL);
   pstate = par_state;
 
-  /* Note that parsing (within yyparse) freely installs cleanups
-     assuming they'll be run here (below).  */
-  back_to = make_cleanup (null_cleanup, NULL);
-
   scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
 							parser_debug);
 
@@ -1583,9 +1576,7 @@  go_parse (struct parser_state *par_state)
   popping = 0;
   name_obstack.clear ();
 
-  result = yyparse ();
-  do_cleanups (back_to);
-  return result;
+  return yyparse ();
 }
 
 void