Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org,  Tom Tromey <tom@tromey.com>,
		Simon Marchi <simark@simark.ca>,
		jimw@sifive.com, 	jhb@FreeBSD.org, 	palmer@sifive.com
Subject: Re: [PATCHv2 2/4] gdb: Resolve 49 reduce/reduce conflicts in c-exp.y
Date: Fri, 21 Dec 2018 16:37:00 -0000	[thread overview]
Message-ID: <87muoysun9.fsf@tromey.com> (raw)
In-Reply-To: <6ea141fbd952fef1a7228c08fb4eeb98f1fa5370.1545172667.git.andrew.burgess@embecosm.com>	(Andrew Burgess's message of "Tue, 18 Dec 2018 22:40:11 +0000")

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> This commit splits the ptr_operator rule in c-exp.y in two, resolving
Andrew> 49 reduce/reduce conflicts in the process.  There should be no
Andrew> user visible change after this commit.

Andrew> There are still 42 shift/reduce and 4 reduce/reduce conflicts
Andrew> remaining in c-exp.y (using GNU bison 3.0.4).

Andrew> gdb/ChangeLog:

Andrew> 	* c-exp.y (base_ptr_operator): New rule, with non-recursive
Andrew> 	content taken from...
Andrew> 	(ptr_operator): ...here, leaving just the recursion here.

Andrew> -ptr_operator:
Andrew> -		ptr_operator '*'
Andrew> +base_ptr_operator
Andrew> +	:	'*'
Andrew>  			{ insert_type (tp_pointer); }
Andrew> -		const_or_volatile_or_space_identifier
Andrew> -	|	'*'
Andrew> -			{ insert_type (tp_pointer); }
Andrew> -		const_or_volatile_or_space_identifier
Andrew> +			const_or_volatile_or_space_identifier
Andrew>  	|	'&'
Andrew>  			{ insert_type (tp_reference); }
Andrew> -	|	'&' ptr_operator
Andrew> -			{ insert_type (tp_reference); }
Andrew>  	|       ANDAND
Andrew>  			{ insert_type (tp_rvalue_reference); }
Andrew> -	|       ANDAND ptr_operator
Andrew> -			{ insert_type (tp_rvalue_reference); }

I don't really understand the previous code here -- in particular why
the '*' case puts ptr_operator first, while the '&' and '&&' cases put
it second.

Does this patch change the order of calls to insert_type?  I find it
hard to reason about what is going on here, so some assurance that it is
all ok would be good.

According to my --coverage build, the "'&' ptr_operator" and "ANDAND ptr_operator"
rules are not exercised by the test suite.  So, if there is a change, it
wouldn't necessarily be noticed :(

Tom


  reply	other threads:[~2018-12-21 16:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15 23:25 [PATCH] gdb: Allow struct fields named double Andrew Burgess
2018-12-16 16:23 ` Simon Marchi
2018-12-16 16:42   ` Tom Tromey
2018-12-18 22:40     ` [PATCHv2 4/4] " Andrew Burgess
2018-12-21 17:19       ` Tom Tromey
2018-12-18 22:40     ` [PATCHv2 2/4] gdb: Resolve 49 reduce/reduce conflicts in c-exp.y Andrew Burgess
2018-12-21 16:37       ` Tom Tromey [this message]
2018-12-18 22:40     ` [PATCHv2 0/4] gdb: Allow struct fields named double Andrew Burgess
2018-12-24 17:30       ` Andrew Burgess
2018-12-18 22:40     ` [PATCHv2 3/4] gdb: Add new parser rule for structure field names Andrew Burgess
2018-12-21 16:38       ` Tom Tromey
2018-12-18 22:40     ` [PATCHv2 1/4] gdb: Extend the comments in c-exp.y Andrew Burgess
2018-12-21 15:44       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87muoysun9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=jimw@sifive.com \
    --cc=palmer@sifive.com \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox