public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Jeff Law <law@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [committed][PATCH] Convert sprintf warning code to a dominator walk
Date: Fri, 27 Oct 2017 18:10:00 -0000	[thread overview]
Message-ID: <1509127439.15469.16.camel@redhat.com> (raw)
In-Reply-To: <eac694f8-83b8-cc22-bf93-0c54a3f76e77@redhat.com>

On Fri, 2017-10-27 at 10:55 -0600, Jeff Law wrote:
> Prereq for eventually embedding range analysis into the sprintf
> warning
> pass.  The only thing that changed since the original from a few days
> ago was the addition of FINAL OVERRIDE to the before_dom_children
> override function.
> 
> Re-bootstrapped and regression tested on x86.
> 
> Installing on the trunk.  Final patch attached for archival purposes.
> 
> 
> Jeff

Sorry to be re-treading the FINAL/OVERRIDE stuff, but...

[...snip...]

> +class sprintf_dom_walker : public dom_walker
> +{
> + public:
> +  sprintf_dom_walker () : dom_walker (CDI_DOMINATORS) {}
> +  ~sprintf_dom_walker () {}
> +
> +  virtual edge before_dom_children (basic_block) FINAL OVERRIDE;

Is it just me, or is it a code smell to have both "virtual" and
"final"/"override" on a decl?

In particular, AIUI:
"virtual" says: "some subclass might override this method"
"final" says: "no subclass will override this method"

so having both seems contradictory.

If sprintf_dom_walker is providing a implementation of a vfunc of
dom_walker, then presumably this should just lose the "virtual" on the
subclass, it's presumably already got the "virtual" it needs in the
base class.


Dave

  reply	other threads:[~2017-10-27 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-27 17:16 Jeff Law
2017-10-27 18:10 ` David Malcolm [this message]
2017-10-27 21:10   ` Jeff Law
2017-10-30  2:03   ` Trevor Saunders

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=1509127439.15469.16.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).