[SampleFDO] Provide a virtual desructor for SampleProfileLoaderBaseImpl
authorKazu Hirata <kazu@google.com>
Tue, 16 Feb 2021 21:17:33 +0000 (13:17 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 16 Feb 2021 21:17:33 +0000 (13:17 -0800)
This patch fixes a warning:

  llvm-project/llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h:69:7:
  error: 'llvm::SampleProfileLoaderBaseImpl' has virtual functions but
  non-virtual destructor [-Werror,-Wnon-virtual-dtor]

Differential Revision: https://reviews.llvm.org/D96810

llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h

index f02bacb..0345496 100644 (file)
@@ -69,6 +69,7 @@ extern cl::opt<bool> NoWarnSampleUnused;
 class SampleProfileLoaderBaseImpl {
 public:
   SampleProfileLoaderBaseImpl(std::string Name) : Filename(Name) {}
+  virtual ~SampleProfileLoaderBaseImpl() = default;
   void dump() { Reader->dump(); }
 
 protected: