From: Jason Merrill <jason@redhat.com>
To: Javier Martinez <javier.martinez.bugzilla@gmail.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v4] c++: extend cold, hot attributes to classes
Date: Tue, 22 Aug 2023 13:50:11 -0400 [thread overview]
Message-ID: <89920577-18ee-d9cd-4e25-e405dd40e2d0@redhat.com> (raw)
In-Reply-To: <CAL=LcuXNSpt28jn-ZG-kMHBNJSHKoY2wBkgF1Y-FarcrKeBePA@mail.gmail.com>
On 8/15/23 09:41, Javier Martinez wrote:
> On Mon, Aug 14, 2023 at 8:32 PM Jason Merrill <jason@redhat.com
> <mailto:jason@redhat.com>> wrote:
> > I think you also want to check for ATTR_FLAG_TYPE_IN_PLACE.
> > [...]
> > > + propagate_class_warmth_attribute (t);
> > Maybe call this in check_bases_and_members instead?
>
> Yes, that is sensible. Done.
You still need an update to doc/extend.texi for this additional use of
the attribute. Sorry I didn't think of that before.
> + warning (OPT_Wattributes, "ignoring attribute %qE because it "
> + "conflicts with attribute %qs", name, "cold");
...
> + warning (OPT_Wattributes, "ignoring attribute %qE because it "
> + "conflicts with attribute %qs", name, "hot");
Function arguments continuing on the next line should line up with the '('.
> + tree class_has_cold_attr = lookup_attribute ("cold",
> + TYPE_ATTRIBUTES (t));
> + tree class_has_hot_attr = lookup_attribute ("hot",
> + TYPE_ATTRIBUTES (t));
...so I'd suggest reformatting these lines as:
tree class_has_cold_attr
= lookup_attribute ("cold", TYPE_ATTRIBUTES (t));
tree class_has_hot_attr
= lookup_attribute ("hot", TYPE_ATTRIBUTES (t));
> + decl_attributes (&fn,
> + tree_cons (get_identifier ("cold"), NULL, NULL), 0);
...and maybe use a local variable for the result of tree_cons.
> + if (has_cold_attr || has_hot_attr)
> + {
> +
> + /* Transparently ignore the new warmth attribute if it
Unnecessary blank line.
Jason
prev parent reply other threads:[~2023-08-22 17:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 13:41 Javier Martinez
2023-08-22 17:50 ` Jason Merrill [this message]
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=89920577-18ee-d9cd-4e25-e405dd40e2d0@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=javier.martinez.bugzilla@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).