[llvm] r263317 - Fix a memory leak due to missing virtual destructors
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 11 20:26:43 PST 2016
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
More information about the llvm-commits
mailing list