<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 12:44 PM, Daniel Sanders <span dir="ltr"><<a href="mailto:Daniel.Sanders@imgtec.com" target="_blank">Daniel.Sanders@imgtec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> > > Are these objects actually destroyed polymorphically? If not, we should make the dtor non-virtual and protected and the derived classes should be final.<br>
> ><br>
> > Sorry for the delay in replying to this. I had to revert r238197 and r238190 and I'm under time pressure to fix and re-commit.<br>
><br>
> Yes, they're destroyed via a TargetLoweringObjectFile pointer.<br>
><br>
> Were we not doing that before? Or did we not have derived classes before? Curious/confused.<br>
<br>
</span>MCObjectFileInfo didn't have a virtual destructor but didn't have virtual functions either. It's immediate subclass (TargetLoweringObjectFile) had a virtual destructor and virtual functions. My patch added a virtual function to MCObjectFileInfo which introduced the warning about having virtual functions without a virtual destructor.</blockquote><div><br>But if it didn't change ownership (were things owned by TargetLoweringObjectFile* and are now owned/destroyed by MCObjectFileInfo*?) then it shouldn't've needed a virtual dtor. Perhaps this base class's dtor should be protected, then TargetLoweringObjectFile's dtor should be virtual (as it already must've been, if that's the point of ownership?)?<br><br>If there's only one subclass, why does it need to be virtual in this base class? </div></div><br></div></div>