Reapply fix in r217988 (reverted in r217989) and remove the alternative fix committed...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 17 Sep 2014 22:27:36 +0000 (22:27 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 17 Sep 2014 22:27:36 +0000 (22:27 +0000)
This type isn't owned polymorphically (as demonstrated by making the
dtor protected and everything still compiling) so just address the
warning by protecting the base dtor and making the derived class final.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217990 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/InstCombine/InstructionCombining.cpp

index c7f5bb026c65c314c7d6b75320f1ac0236120d9c..0780c74429ea7c36721479922239a780fc98533d 100644 (file)
@@ -36,14 +36,13 @@ private:
   const TargetLibraryInfo *TLI;
   bool UnsafeFPShrink;
 
+protected:
+  ~LibCallSimplifier() {}
+
 public:
   LibCallSimplifier(const DataLayout *TD, const TargetLibraryInfo *TLI,
                     bool UnsafeFPShrink);
 
-  /// ~LibCallSimplifier - Adding the virtual destructor back in to satisfy
-  /// -Wnon-virtual-dtor. This class is used polymorphically by InstCombine.
-  virtual ~LibCallSimplifier() {}
-
   /// optimizeCall - Take the given call instruction and return a more
   /// optimal value to replace the instruction with or 0 if a more
   /// optimal form can't be found.  Note that the returned value may
index 26f243cb1506b97d4601f4f5ff0286c7f32ac24a..ac0c01e3c7b4be5d9eb89a90fb501a5be537cab3 100644 (file)
@@ -2908,7 +2908,7 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
 }
 
 namespace {
-class InstCombinerLibCallSimplifier : public LibCallSimplifier {
+class InstCombinerLibCallSimplifier final : public LibCallSimplifier {
   InstCombiner *IC;
 public:
   InstCombinerLibCallSimplifier(const DataLayout *DL,