[PATCH] D96810: [SampleFDO] Provide a virtual desructor for SampleProfileLoaderBaseImpl
Kazu Hirata via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 12:48:00 PST 2021
kazu created this revision.
kazu added reviewers: xur, wmi.
Herald added a subscriber: wenlei.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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]
That said, I am not sure who is responsible for freeing:
FunctionSamples *Samples = nullptr;
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96810
Files:
llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
Index: llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
===================================================================
--- llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
+++ llvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
@@ -69,6 +69,7 @@
class SampleProfileLoaderBaseImpl {
public:
SampleProfileLoaderBaseImpl(std::string Name) : Filename(Name) {}
+ virtual ~SampleProfileLoaderBaseImpl() = default;
void dump() { Reader->dump(); }
protected:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96810.324081.patch
Type: text/x-patch
Size: 498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210216/358a48e4/attachment.bin>
More information about the llvm-commits
mailing list