[llvm] r217756 - Fix a non-virtual destructor warning introduced in r217747.

Frédéric Riss friss at apple.com
Mon Sep 15 12:33:32 PDT 2014


> On 15 Sep 2014, at 20:19, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Mon, Sep 15, 2014 at 3:38 AM, Frederic Riss <friss at apple.com <mailto:friss at apple.com>> wrote:
> Author: friss
> Date: Mon Sep 15 05:38:13 2014
> New Revision: 217756
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=217756&view=rev <http://llvm.org/viewvc/llvm-project?rev=217756&view=rev>
> Log:
> Fix a non-virtual destructor warning introduced in r217747.
> 
> Modified:
>     llvm/trunk/lib/DebugInfo/DWARFUnit.h
> 
> Modified: llvm/trunk/lib/DebugInfo/DWARFUnit.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.h?rev=217756&r1=217755&r2=217756&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.h?rev=217756&r1=217755&r2=217756&view=diff>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFUnit.h (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFUnit.h Mon Sep 15 05:38:13 2014
> @@ -35,6 +35,8 @@ public:
>    /// Returns the Unit that contains the given section offset in the
>    /// same section this Unit originated from.
>    virtual DWARFUnit *getUnitForOffset(uint32_t Offset) const = 0;
> +
> +  virtual ~DWARFUnitSectionBase() {}
> 
> Since these objects are never polymorphically owned, a better fix for this would be to make the base dtor protected, and the derived classes final. That will satisfy the warning without adding an unneeded vtable entry/virtual call overhead.

I’ll do that in a followup commit tomorrow.

Thanks,
Fred

> - David
>  
>  };
> 
>  /// Concrete instance of DWARFUnitSection, specialized for one Unit type.
> 
> 
> _______________________________________________
> 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 <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/20140915/c74ebe4e/attachment.html>


More information about the llvm-commits mailing list