Remove make_cleanup_clear_parser_state
[deliverable/binutils-gdb.git] / gdb / ada-exp.y
index 1eea4546706a7e90535c42c6619063f7dea06b54..618c9d540e925a1b2aecc0fc84f9efca1562a8db 100644 (file)
@@ -733,10 +733,8 @@ static struct obstack temp_parse_space;
 int
 ada_parse (struct parser_state *par_state)
 {
-  int result;
-  struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
-
   /* Setting up the parser state.  */
+  scoped_restore pstate_restore = make_scoped_restore (&pstate);
   gdb_assert (par_state != NULL);
   pstate = par_state;
 
@@ -745,9 +743,7 @@ ada_parse (struct parser_state *par_state)
   obstack_free (&temp_parse_space, NULL);
   obstack_init (&temp_parse_space);
 
-  result = yyparse ();
-  do_cleanups (c);
-  return result;
+  return yyparse ();
 }
 
 void
This page took 0.025331 seconds and 4 git commands to generate.