Fix a memory leak due to missing virtual destructors
authorTeresa Johnson <tejohnson@google.com>
Sat, 12 Mar 2016 01:23:57 +0000 (01:23 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sat, 12 Mar 2016 01:23:57 +0000 (01:23 +0000)
Caused a couple of sanitizer bot failures in ThinLTO tests due to
r263275.

llvm-svn: 263317

llvm/include/llvm/IR/FunctionInfo.h

index 4cc01cc..81364b5 100644 (file)
@@ -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) {