[llvm] r263317 - Fix a memory leak due to missing virtual destructors

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 21:44:29 PST 2016


You're right, I only need the base destructor virtual, I got a little
over-eager in removing the leak. Fixed both suggestions in r263335.
Thanks,
Teresa

On Fri, Mar 11, 2016 at 8:26 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:

> Hi Teresa,
>
> > On Mar 11, 2016, at 5:23 PM, Teresa Johnson via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> >
> > Author: tejohnson
> > Date: Fri Mar 11 19:23:57 2016
> > New Revision: 263317
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=263317&view=rev
> > Log:
> > Fix a memory leak due to missing virtual destructors
> >
> > Caused a couple of sanitizer bot failures in ThinLTO tests due to
> > r263275.
> >
> > Modified:
> >    llvm/trunk/include/llvm/IR/FunctionInfo.h
> >
> > Modified: llvm/trunk/include/llvm/IR/FunctionInfo.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/FunctionInfo.h?rev=263317&r1=263316&r2=263317&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/IR/FunctionInfo.h (original)
> > +++ llvm/trunk/include/llvm/IR/FunctionInfo.h Fri Mar 11 19:23:57 2016
> > @@ -88,6 +88,8 @@ protected:
> >       : Kind(K), Linkage(Linkage) {}
> >
> > public:
> > +  virtual ~GlobalValueSummary() {}
>
> = default?


> > +
> >   /// Which kind of summary subclass this is.
> >   SummaryKind getSummaryKind() const { return Kind; }
> >
> > @@ -136,6 +138,7 @@ public:
> >   /// Summary constructors.
> >   FunctionSummary(GlobalValue::LinkageTypes Linkage, unsigned NumInsts)
> >       : GlobalValueSummary(FunctionKind, Linkage), InstCount(NumInsts) {}
> > +  virtual ~FunctionSummary() {}
>
> This is not needed (or I don't see why?).
>
> --
> Mehdi
>
>
> >
> >   /// Check if this is a function summary.
> >   static bool classof(const GlobalValueSummary *GVS) {
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160311/e5d64c99/attachment.html>


More information about the llvm-commits mailing list