summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-09-17 22:27:36 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-09-17 22:27:36 +0000
commitdba94ec3c742aafbb05ea3ba4fbf37243fd82dd9 (patch)
tree4ac67c5c363d285c7b936d358e4c933120b8091c
parentd8978ec085f2603bb0c5b783d4a88fac7dec8d94 (diff)
downloadbcm5719-llvm-dba94ec3c742aafbb05ea3ba4fbf37243fd82dd9.tar.gz
bcm5719-llvm-dba94ec3c742aafbb05ea3ba4fbf37243fd82dd9.zip
Reapply fix in r217988 (reverted in r217989) and remove the alternative fix committed in r217987.
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. llvm-svn: 217990
-rw-r--r--llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h7
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp2
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
index c7f5bb026c6..0780c74429e 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
@@ -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
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 26f243cb150..ac0c01e3c7b 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -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,
OpenPOWER on IntegriCloud