From: Janus Weil <janus@gcc.gnu.org>
To: Tobias Burnus <burnus@net-b.de>
Cc: gcc patches <gcc-patches@gcc.gnu.org>, gfortran <fortran@gcc.gnu.org>
Subject: Re: [Patch, Fortran] No-op Patch - a.k.a. FINAL wrapper update
Date: Fri, 30 Nov 2012 10:30:00 -0000 [thread overview]
Message-ID: <CAKwh3qjS1_nkFe8XrrwUhHj2h0fk_h4CJTGx6ugyk2Sgodnrhw@mail.gmail.com> (raw)
In-Reply-To: <50B7FEA5.7060508@net-b.de>
Hi,
>> one thing that I do not like about your patch is the modification of
>> "gfc_find_derived_vtab": You create two versions of it, one of which creates
>> the vtab if it does not exist, while the other version does not do this.
>> [...] can you explain to me why this would be necessary?
>
>
> Well, strictly speaking it is not necessary. However, I use it in the
> to-be-submitted calling part of the patch:
>
> else if (al->expr->ts.type == BT_DERIVED)
> {
> gfc_symbol *vtab = gfc_find_derived_vtab
> (al->expr->ts.u.derived);
> if (vtab)
>
> Here, I do not want to force the generation of a vtab which wouldn't
> otherwise exist. Otherwise, one had to at least guard it by checks for
> nonextensible derived types (sequence, bind(C)).
I don't think it is a good idea to base the decision whether to call a
finalizer on the presence of a vtab. In my version of the patch I
introduced a routine 'gfc_is_finalizable' to perform this decision.
>> [Moreover, the problem is that your new "gfc_find_derived_vtab" behaves
>> different from the old one but has the same name, while your new
>> "gfc_get_derived_vtab" behaves like the old "gfc_find_derived_vtab".
>
>
> That's because of the bad choice of the current name. The other "find"
> functions do not generate the symbol if it does not exist, the "get"
> functions do. But otherwise I concur that changing the name is confusing.
>
>
>> Therefore, the places where you change the behavior by keeping the call to
>> "gfc_find_derived_vtab" are not visible in the patch.
>
>
> That should not happen. When I created the patch, I first renamed all
> existing versions, though it seems as if I there are currently three new
> ones which the current patch misses.
>
> However, if you insist on the current meaning, can you provide a good name?
> Otherwise, I could use gfc_really_find_derived_vtab ;-)
I do not oppose to renaming gfc_find_derived_vtab to
gfc_get_derived_vtab. My main point is that we do not need a variant
which only searches for the vtab but does not generate it.
Cheers,
Janus
next prev parent reply other threads:[~2012-11-30 10:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 18:29 Tobias Burnus
2012-11-29 22:59 ` Janus Weil
2012-11-30 1:53 ` Tobias Burnus
2012-11-30 10:30 ` Janus Weil [this message]
2012-11-30 10:39 ` Janus Weil
2012-11-30 12:29 ` Tobias Burnus
2012-12-02 22:54 ` Janus Weil
2018-10-15 9:02 ` [PATCH,FORTRAN] Fix memory leak in finalization wrappers Bernhard Reutner-Fischer
2021-10-27 21:39 ` Bernhard Reutner-Fischer
2021-10-28 23:58 ` Bernhard Reutner-Fischer
2021-11-05 18:46 ` Mikael Morin
2021-11-05 22:08 ` Bernhard Reutner-Fischer
2021-11-06 12:04 ` Mikael Morin
2021-11-06 23:56 ` Bernhard Reutner-Fischer
2021-11-07 12:32 ` Mikael Morin
2021-11-14 19:53 ` Bernhard Reutner-Fischer
2021-11-06 10:30 ` Mikael Morin
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=CAKwh3qjS1_nkFe8XrrwUhHj2h0fk_h4CJTGx6ugyk2Sgodnrhw@mail.gmail.com \
--to=janus@gcc.gnu.org \
--cc=burnus@net-b.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).