Remove make_cleanup_clear_parser_state

This removes make_cleanup_clear_parser_state in favor of
scoped_restore.

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

	* utils.c (do_clear_parser_state): Remove.
	(make_cleanup_clear_parser_state): Remove.
	* p-exp.y (pascal_parse): Use scoped_restore.
	* m2-exp.y (m2_parse): Use scoped_restore.
	* f-exp.y (f_parse): Use scoped_restore.
	* d-exp.y (d_parse): Use scoped_restore.
	* c-exp.y (c_parse): Use scoped_restore.
	* ada-exp.y (ada_parse): Use scoped_restore.
	* utils.h (make_cleanup_clear_parser_state): Remove.
This commit is contained in:
Tom Tromey
2017-08-13 10:37:13 -06:00
parent 73b9be8b53
commit eae49211e1
10 changed files with 23 additions and 50 deletions

View File

@ -257,24 +257,6 @@ make_cleanup_value_free (struct value *value)
return make_cleanup (do_value_free, value);
}
/* Helper function for make_cleanup_clear_parser_state. */
static void
do_clear_parser_state (void *ptr)
{
struct parser_state **p = (struct parser_state **) ptr;
*p = NULL;
}
/* Clean (i.e., set to NULL) the parser state variable P. */
struct cleanup *
make_cleanup_clear_parser_state (struct parser_state **p)
{
return make_cleanup (do_clear_parser_state, (void *) p);
}
/* This function is useful for cleanups.
Do