Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Add method overload resolution to expression parser
Date: Tue, 13 Oct 2009 21:24:00 -0000	[thread overview]
Message-ID: <m3eip7htrx.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4A9D628B.1070300@redhat.com> (Keith Seitz's message of "Tue, 01 	Sep 2009 11:06:03 -0700")

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> The attached patch is the first of several patches which will attempt
Keith> mitigate the requirement of single-quoting every single C++ expression
Keith> passed to the parser.

I have a couple of questions about this.

First, since this is an extension to C++, I wonder whether it will
introduce any parsing ambiguities once the parser is complete.  I
suspect not, but I thought you might have a better view.

Keith> +exp     :       exp '(' nonempty_typelist ')' const_or_volatile

This is an interesting production.

I would have expected it to explicitly look for maybe-qualified
identifiers -- not an arbitrary expression.  Does this let us do
something we could not otherwise do?  Or, what does this do:

  print (return_a_function ()) (int)

Does it work to call an explicitly-specified overload?

  print overloaded(int)(5)

(I assume from reading the patch that this works as expected.)

Keith>  func_mod:	'(' ')'
Keith>  			{ $$ = 0; }
Keith>  	|	'(' nonempty_typelist ')'
Keith> -			{ free ($2); $$ = 0; }
Keith> +			{ do_cleanups (typelist_cleanup); $$ = 0; }

I'm a bit surprised that the cleanup stuff works in the parser.
Interesting.

Keith> +static void
Keith> +free_param_types (void *arg)

Needs a short intro comment.

Keith> +static struct type *
Keith> +make_params (int num_types, struct type **param_types)
[...]
Keith> +  make_cleanup (free_param_types, type);

It is a little unusual to make a cleanup that isn't returned.  Is it
really safe in this case?  To know that, I think you'd have to examine
all callers of evaluate_subexp_standard.  It seems somewhat safer to do
explicit cleanups in the TYPE_INSTANCE case, what do you think?

At the very least I think the comment for make_params should mention
this cleanup side effect.

Tom


  parent reply	other threads:[~2009-10-13 21:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 18:06 Keith Seitz
2009-09-24 19:30 ` Keith Seitz
2009-10-13 21:24 ` Daniel Jacobowitz
2009-10-14 18:54   ` Tom Tromey
2009-10-14 19:17     ` Daniel Jacobowitz
2009-10-14 19:29       ` Tom Tromey
2009-10-13 21:24 ` Tom Tromey [this message]
2009-11-09 21:55   ` Keith Seitz
2009-11-09 22:22     ` Tom Tromey
2009-11-09 23:35       ` Keith Seitz
2009-11-10 19:14         ` Daniel Jacobowitz
2009-11-10 22:19           ` Keith Seitz

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=m3eip7htrx.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /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