[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 17:23:58 PST 2016


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() {}
+
   /// 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() {}
 
   /// Check if this is a function summary.
   static bool classof(const GlobalValueSummary *GVS) {




More information about the llvm-commits mailing list