[llvm] ca867ef - Revert GCC -Wnon-virtual-dtor workarounds "[SCEV] Fix GCC -Wnon-virtual-dtor" & "[SampleFDO] Fix -Wnon-virtual-dtor"

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 00:00:41 PDT 2021


Author: Fangrui Song
Date: 2021-09-08T00:00:33-07:00
New Revision: ca867ef47b8aebc2d8167049544954e78eeeb9e8

URL: https://github.com/llvm/llvm-project/commit/ca867ef47b8aebc2d8167049544954e78eeeb9e8
DIFF: https://github.com/llvm/llvm-project/commit/ca867ef47b8aebc2d8167049544954e78eeeb9e8.diff

LOG: Revert GCC -Wnon-virtual-dtor workarounds "[SCEV] Fix GCC -Wnon-virtual-dtor" & "[SampleFDO] Fix -Wnon-virtual-dtor"

This reverts commits 4852c770fe8703145dd2a35395985646ce57a454 and 6df09d6ccbc0cb72d3278cafb592e9bc0e6b84a1.

After D109404, -Wnon-virtual-dtor will not be added when the host compiler is GCC.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/ScalarEvolution.h
    llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index fa406fb095ce1..6ae865e011cf0 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -209,8 +209,7 @@ class SCEVPredicate : public FoldingSetNode {
 
 protected:
   SCEVPredicateKind Kind;
-  // Use virtual to suppress -Wnon-virtual-dtor in the presence of friend.
-  virtual ~SCEVPredicate() = default;
+  ~SCEVPredicate() = default;
   SCEVPredicate(const SCEVPredicate &) = default;
   SCEVPredicate &operator=(const SCEVPredicate &) = default;
 

diff  --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
index 1cef5e73cdd2a..2a510e69cf45f 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
@@ -114,7 +114,7 @@ template <typename BT> class SampleProfileLoaderBaseImpl {
       DenseMap<const BasicBlockT *, SmallVector<const BasicBlockT *, 8>>;
 
 protected:
-  virtual ~SampleProfileLoaderBaseImpl() = default;
+  ~SampleProfileLoaderBaseImpl() = default;
   friend class SampleCoverageTracker;
 
   Function &getFunction(FunctionT &F) {


        


More information about the llvm-commits mailing list