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: Wed, 14 Oct 2009 18:54:00 -0000 [thread overview]
Message-ID: <m3zl7tajs8.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20091013212426.GA26169@caradoc.them.org> (Daniel Jacobowitz's message of "Tue, 13 Oct 2009 17:24:26 -0400")
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Keith> +static struct type *
Keith> +make_params (int num_types, struct type **param_types)
Keith> +{
[...]
Keith> + make_cleanup (free_param_types, type);
Keith> + return type;
Keith> +}
Daniel> And this is even more confusing... how does this cleanup eventually
Daniel> get run? We shouldn't leak it back to the top level. And I suspect
Daniel> that since nothing ever copies types, if this type makes it into the
Daniel> value history we're going to have a problem.
I think this can be addressed by changing the TYPE_INSTANCE case to deal
with the cleanups.
Daniel> I also wonder why TYPE_INSTANCE is necesary. All it seems to do is
Daniel> construct the temporary type. Can't we do that in the parser,
Daniel> instead, and use UNOP_CAST?
My reading is that it has to do with the lifetime of a type.
This implementation defers creation of the temporary function type to
the point where it is used. IIUC, which I hope I do :-), this temporary
type can't really leak out of the TYPE_INSTANCE code. That is, it is
constructed and used to look up an actual function or method (which has
its own type).
If we used UNOP_CAST then we would have to make a long-lived temporary
type, not only because the type would have to live at least from parsing
through the end of the life of the parsed expression, but also because
the result of the cast would have that temporary type, and thus it would
be capturable.
This would not be as big a deal if the type GC work were finished, but
that is still pending.
Tom
next prev parent reply other threads:[~2009-10-14 18:54 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 ` Tom Tromey
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
2009-10-13 21:24 ` Daniel Jacobowitz
2009-10-14 18:54 ` Tom Tromey [this message]
2009-10-14 19:17 ` Daniel Jacobowitz
2009-10-14 19:29 ` 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=m3zl7tajs8.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