[llvm] r238197 - Fix warning introduced in r238190 about lack of virtual destructor in MCObjectFileInfo.

Daniel Sanders Daniel.Sanders at imgtec.com
Thu May 28 06:32:35 PDT 2015


> Are these objects actually destroyed polymorphically? If not, we should make the dtor non-virtual and protected and the derived classes should be final.

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.

Yes, they're destroyed via a TargetLoweringObjectFile pointer.

From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: 26 May 2015 22:35
To: Daniel Sanders
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm] r238197 - Fix warning introduced in r238190 about lack of virtual destructor in MCObjectFileInfo.



On Tue, May 26, 2015 at 5:25 AM, Daniel Sanders <daniel.sanders at imgtec.com<mailto:daniel.sanders at imgtec.com>> wrote:
Author: dsanders
Date: Tue May 26 07:25:36 2015
New Revision: 238197

URL: http://llvm.org/viewvc/llvm-project?rev=238197&view=rev
Log:
Fix warning introduced in r238190 about lack of virtual destructor in MCObjectFileInfo.


Modified:
    llvm/trunk/include/llvm/MC/MCObjectFileInfo.h

Modified: llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFileInfo.h?rev=238197&r1=238196&r2=238197&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectFileInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectFileInfo.h Tue May 26 07:25:36 2015
@@ -188,6 +188,8 @@ protected:
   MCSection *XDataSection;

 public:
+  virtual ~MCObjectFileInfo() { };

Are these objects actually destroyed polymorphically? If not, we should make the dtor non-virtual and protected and the derived classes should be final.

+
   void InitMCObjectFileInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM,
                             MCContext &ctx);



_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150528/06ecb2d2/attachment.html>


More information about the llvm-commits mailing list