[polly] 1b04866 - [IRBuilder] Try to fix warnings
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 16 06:32:21 PST 2020
Author: Nikita Popov
Date: 2020-02-16T15:32:11+01:00
New Revision: 1b04866a3db9f816a559860f941da067fe1eccf1
URL: https://github.com/llvm/llvm-project/commit/1b04866a3db9f816a559860f941da067fe1eccf1
DIFF: https://github.com/llvm/llvm-project/commit/1b04866a3db9f816a559860f941da067fe1eccf1.diff
LOG: [IRBuilder] Try to fix warnings
Try to fix -Wnon-virtual-dtor warnings that cause build failure
on clang-pcc64le-rhel.
Added:
Modified:
clang/lib/CodeGen/CGBuilder.h
llvm/include/llvm/IR/IRBuilder.h
llvm/include/llvm/IR/IRBuilderFolder.h
llvm/lib/IR/IRBuilder.cpp
llvm/lib/Transforms/Scalar/SROA.cpp
polly/include/polly/CodeGen/IRBuilder.h
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGBuilder.h b/clang/lib/CodeGen/CGBuilder.h
index 19233f395b84..38e96c0f4ee6 100644
--- a/clang/lib/CodeGen/CGBuilder.h
+++ b/clang/lib/CodeGen/CGBuilder.h
@@ -22,7 +22,7 @@ class CodeGenFunction;
/// This is an IRBuilder insertion helper that forwards to
/// CodeGenFunction::InsertHelper, which adds necessary metadata to
/// instructions.
-class CGBuilderInserter : public llvm::IRBuilderDefaultInserter {
+class CGBuilderInserter final : public llvm::IRBuilderDefaultInserter {
public:
CGBuilderInserter() = default;
explicit CGBuilderInserter(CodeGenFunction *CGF) : CGF(CGF) {}
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 47e6e6c3b059..bca153b68ae9 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -59,9 +59,9 @@ class Use;
///
/// By default, this inserts the instruction at the insertion point.
class IRBuilderDefaultInserter {
- virtual void anchor();
-
public:
+ virtual ~IRBuilderDefaultInserter();
+
virtual void InsertHelper(Instruction *I, const Twine &Name,
BasicBlock *BB,
BasicBlock::iterator InsertPt) const {
@@ -74,9 +74,10 @@ class IRBuilderDefaultInserter {
/// performing the default insertion.
class IRBuilderCallbackInserter : public IRBuilderDefaultInserter {
std::function<void(Instruction *)> Callback;
- virtual void anchor();
public:
+ virtual ~IRBuilderCallbackInserter();
+
IRBuilderCallbackInserter(std::function<void(Instruction *)> Callback)
: Callback(std::move(Callback)) {}
diff --git a/llvm/include/llvm/IR/IRBuilderFolder.h b/llvm/include/llvm/IR/IRBuilderFolder.h
index 64290d75339e..a77a5213dcea 100644
--- a/llvm/include/llvm/IR/IRBuilderFolder.h
+++ b/llvm/include/llvm/IR/IRBuilderFolder.h
@@ -23,6 +23,8 @@ namespace llvm {
/// IRBuilderFolder - Interface for constant folding in IRBuilder.
class IRBuilderFolder {
public:
+ virtual ~IRBuilderFolder();
+
//===--------------------------------------------------------------------===//
// Binary Operators
//===--------------------------------------------------------------------===//
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index f6c8cd73c23c..457255b157cc 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -786,7 +786,8 @@ CallInst *IRBuilderBase::CreateIntrinsic(Intrinsic::ID ID,
return createCallHelper(Fn, Args, this, Name, FMFSource);
}
-void IRBuilderDefaultInserter::anchor() {}
-void IRBuilderCallbackInserter::anchor() {}
+IRBuilderDefaultInserter::~IRBuilderDefaultInserter() {}
+IRBuilderCallbackInserter::~IRBuilderCallbackInserter() {}
+IRBuilderFolder::~IRBuilderFolder() {}
void ConstantFolder::anchor() {}
void NoFolder::anchor() {}
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 866c5f00d4c3..9bbc06eb95b8 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -129,7 +129,7 @@ namespace {
/// A custom IRBuilder inserter which prefixes all names, but only in
/// Assert builds.
-class IRBuilderPrefixedInserter : public IRBuilderDefaultInserter {
+class IRBuilderPrefixedInserter final : public IRBuilderDefaultInserter {
std::string Prefix;
const Twine getNameWithPrefix(const Twine &Name) const {
diff --git a/polly/include/polly/CodeGen/IRBuilder.h b/polly/include/polly/CodeGen/IRBuilder.h
index 0d432039aba1..664da464868b 100644
--- a/polly/include/polly/CodeGen/IRBuilder.h
+++ b/polly/include/polly/CodeGen/IRBuilder.h
@@ -131,7 +131,7 @@ class ScopAnnotator {
///
/// This is used to add additional items such as e.g. the llvm.loop.parallel
/// metadata.
-class IRInserter : public llvm::IRBuilderDefaultInserter {
+class IRInserter final : public llvm::IRBuilderDefaultInserter {
public:
IRInserter() = default;
IRInserter(class ScopAnnotator &A) : Annotator(&A) {}
More information about the llvm-commits
mailing list