Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Make dwarf_expr_context::stack an std::vector
Date: Thu, 14 Sep 2017 20:39:00 -0000	[thread overview]
Message-ID: <550039b4f1f0118a37e84ab8be1b67ef@polymtl.ca> (raw)
In-Reply-To: <28eeef72-abba-68e1-8eb3-effd6b0ab627@redhat.com>

On 2017-09-14 18:43, Pedro Alves wrote:
> On 09/14/2017 05:31 PM, Simon Marchi wrote:
> 
>>> A couple nits and this is fine with me.
>>> 
>>>>    /* True if the piece is in memory and is known to be on the
>>>> program's stack.
>>>> @@ -114,7 +118,7 @@ struct dwarf_stack_value
>>>>  struct dwarf_expr_context
>>>>  {
>>>>    dwarf_expr_context ();
>>>> -  virtual ~dwarf_expr_context ();
>>>> +  virtual ~dwarf_expr_context () = default;
>>> 
>>> Couldn't we just remove the dtor?
>> 
>> I thought that this was necessary because there are subclasses that
>> might have destructors.  But now that I think about it more, I suppose
>> it would only be relevant if we destroyed instances of subclasses
>> through pointers to dwarf_expr_context?  All the instances of these
>> classes are static.
> 
> I actually didn't realize _this_ was the base class.  :-P
> But yeah, if we never want to delete via base pointer, the dtor
> could be non-virtual, and in which case it should be made
> protected, to ensure that really no code outside subclasses tries
> to call it directly.  (And in that case, you'd still use =default;)
> Really not a big deal, I'm fine with what you had.

Ok, well I've pushed and left the virtual dtor there just in case it's 
ever needed.  I don't think it changes anything at runtime.

Thanks,

Simon


      reply	other threads:[~2017-09-14 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 15:59 Simon Marchi
2017-09-14 16:13 ` Pedro Alves
2017-09-14 16:31   ` Simon Marchi
2017-09-14 16:43     ` Pedro Alves
2017-09-14 20:39       ` Simon Marchi [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=550039b4f1f0118a37e84ab8be1b67ef@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@ericsson.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