This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/4] Remove make_cleanup_clear_parser_state
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 6 Sep 2017 20:28:14 +0100
- Subject: Re: [RFA 1/4] Remove make_cleanup_clear_parser_state
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 67B6C20272
- References: <20170906051306.6092-1-tom@tromey.com> <20170906051306.6092-2-tom@tromey.com>
On 09/06/2017 06:13 AM, Tom Tromey wrote:
> f_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;
>
> result = yyparse ();
> - do_cleanups (c);
> return result;
You could remove "result" here too.
Otherwise looks fine to me, thanks!
Pedro Alves