[llvm] bd93df9 - [Polly] Mark classes as final by default. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 10:06:26 PDT 2022


Author: Michael Kruse
Date: 2022-05-17T12:05:39-05:00
New Revision: bd93df937a6441db4aff67191ca0bb486554c34b

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

LOG: [Polly] Mark classes as final by default. NFC.

This make is obivious that a class was not intended to be derived from.

NPM analysis pass can unfortunately not marked as final because they are
derived from a llvm::Checker<T> template internally by the NPM.

Also normalize the use of classes/structs
 * NPM passes are structs
 * Legacy passes are classes
 * structs that have methods and are not a visitor pattern are classes
 * structs have public inheritance by default, remove "public" keyword
 * Use typedef'ed type instead of inline forward declaration

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
    polly/include/polly/CodeGen/BlockGenerators.h
    polly/include/polly/CodeGen/CodeGeneration.h
    polly/include/polly/CodeGen/IRBuilder.h
    polly/include/polly/CodeGen/IslAst.h
    polly/include/polly/CodeGen/IslExprBuilder.h
    polly/include/polly/CodeGen/LoopGeneratorsGOMP.h
    polly/include/polly/CodeGen/LoopGeneratorsKMP.h
    polly/include/polly/CodeGen/PerfMonitor.h
    polly/include/polly/CodePreparation.h
    polly/include/polly/DeLICM.h
    polly/include/polly/DeadCodeElimination.h
    polly/include/polly/DependenceInfo.h
    polly/include/polly/ForwardOpTree.h
    polly/include/polly/JSONExporter.h
    polly/include/polly/ManualOptimizer.h
    polly/include/polly/MatmulOptimizer.h
    polly/include/polly/PolyhedralInfo.h
    polly/include/polly/PruneUnprofitable.h
    polly/include/polly/ScheduleOptimizer.h
    polly/include/polly/ScheduleTreeTransform.h
    polly/include/polly/ScopBuilder.h
    polly/include/polly/ScopDetection.h
    polly/include/polly/ScopDetectionDiagnostic.h
    polly/include/polly/ScopGraphPrinter.h
    polly/include/polly/ScopInfo.h
    polly/include/polly/ScopPass.h
    polly/include/polly/Simplify.h
    polly/include/polly/Support/DumpFunctionPass.h
    polly/include/polly/Support/DumpModulePass.h
    polly/include/polly/Support/GICHelper.h
    polly/include/polly/Support/ISLTools.h
    polly/include/polly/Support/SCEVAffinator.h
    polly/include/polly/Support/ScopHelper.h
    polly/include/polly/Support/VirtualInstruction.h
    polly/lib/Analysis/DependenceInfo.cpp
    polly/lib/Analysis/PolyhedralInfo.cpp
    polly/lib/Analysis/PruneUnprofitable.cpp
    polly/lib/Analysis/ScopDetection.cpp
    polly/lib/Analysis/ScopGraphPrinter.cpp
    polly/lib/Analysis/ScopInfo.cpp
    polly/lib/CodeGen/CodeGeneration.cpp
    polly/lib/CodeGen/CodegenCleanup.cpp
    polly/lib/CodeGen/IslAst.cpp
    polly/lib/CodeGen/IslNodeBuilder.cpp
    polly/lib/CodeGen/ManagedMemoryRewrite.cpp
    polly/lib/CodeGen/PPCGCodeGeneration.cpp
    polly/lib/Exchange/JSONExporter.cpp
    polly/lib/Support/DumpFunctionPass.cpp
    polly/lib/Support/DumpModulePass.cpp
    polly/lib/Support/RegisterPasses.cpp
    polly/lib/Support/SCEVValidator.cpp
    polly/lib/Support/ScopHelper.cpp
    polly/lib/Transform/Canonicalization.cpp
    polly/lib/Transform/CodePreparation.cpp
    polly/lib/Transform/DeLICM.cpp
    polly/lib/Transform/DeadCodeElimination.cpp
    polly/lib/Transform/FlattenSchedule.cpp
    polly/lib/Transform/ForwardOpTree.cpp
    polly/lib/Transform/ManualOptimizer.cpp
    polly/lib/Transform/MatmulOptimizer.cpp
    polly/lib/Transform/MaximalStaticExpansion.cpp
    polly/lib/Transform/ScheduleOptimizer.cpp
    polly/lib/Transform/ScheduleTreeTransform.cpp
    polly/lib/Transform/ScopInliner.cpp
    polly/lib/Transform/Simplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 24b8813e9b73d..30216c87bc21c 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -41,8 +41,8 @@ template <typename AnalysisT, bool IsSimple,
           typename AnalysisGraphTraitsT =
               DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
 struct DOTGraphTraitsViewer
-    : public PassInfoMixin<DOTGraphTraitsViewer<AnalysisT, IsSimple, GraphT,
-                                                AnalysisGraphTraitsT>> {
+    : PassInfoMixin<DOTGraphTraitsViewer<AnalysisT, IsSimple, GraphT,
+                                         AnalysisGraphTraitsT>> {
   DOTGraphTraitsViewer(StringRef GraphName) : Name(GraphName) {}
   virtual ~DOTGraphTraitsViewer() {}
 
@@ -96,8 +96,8 @@ template <typename AnalysisT, bool IsSimple,
           typename AnalysisGraphTraitsT =
               DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
 struct DOTGraphTraitsPrinter
-    : public PassInfoMixin<DOTGraphTraitsPrinter<AnalysisT, IsSimple, GraphT,
-                                                 AnalysisGraphTraitsT>> {
+    : PassInfoMixin<DOTGraphTraitsPrinter<AnalysisT, IsSimple, GraphT,
+                                          AnalysisGraphTraitsT>> {
   DOTGraphTraitsPrinter(StringRef GraphName) : Name(GraphName) {}
   virtual ~DOTGraphTraitsPrinter() {}
 

diff  --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h
index 9c9fa60fba64f..1fc5a4c39b812 100644
--- a/polly/include/polly/CodeGen/BlockGenerators.h
+++ b/polly/include/polly/CodeGen/BlockGenerators.h
@@ -625,7 +625,7 @@ class BlockGenerator {
 /// Generate a new vector basic block for a polyhedral statement.
 ///
 /// The only public function exposed is generate().
-class VectorBlockGenerator : BlockGenerator {
+class VectorBlockGenerator final : BlockGenerator {
 public:
   /// Generate a new vector basic block for a ScoPStmt.
   ///
@@ -803,7 +803,7 @@ class VectorBlockGenerator : BlockGenerator {
 };
 
 /// Generator for new versions of polyhedral region statements.
-class RegionGenerator : public BlockGenerator {
+class RegionGenerator final : BlockGenerator {
 public:
   /// Create a generator for regions.
   ///

diff  --git a/polly/include/polly/CodeGen/CodeGeneration.h b/polly/include/polly/CodeGen/CodeGeneration.h
index b32f31299c608..77668cbbda754 100644
--- a/polly/include/polly/CodeGen/CodeGeneration.h
+++ b/polly/include/polly/CodeGen/CodeGeneration.h
@@ -28,7 +28,7 @@ extern VectorizerChoice PollyVectorizerChoice;
 /// UnreachableInst.
 void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder);
 
-struct CodeGenerationPass : public PassInfoMixin<CodeGenerationPass> {
+struct CodeGenerationPass final : PassInfoMixin<CodeGenerationPass> {
   PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
                         ScopStandardAnalysisResults &AR, SPMUpdater &U);
 };

diff  --git a/polly/include/polly/CodeGen/IRBuilder.h b/polly/include/polly/CodeGen/IRBuilder.h
index 8d9473ce2be44..825bdd9b469c7 100644
--- a/polly/include/polly/CodeGen/IRBuilder.h
+++ b/polly/include/polly/CodeGen/IRBuilder.h
@@ -120,7 +120,7 @@ class ScopAnnotator {
 class IRInserter final : public llvm::IRBuilderDefaultInserter {
 public:
   IRInserter() = default;
-  IRInserter(class ScopAnnotator &A) : Annotator(&A) {}
+  IRInserter(ScopAnnotator &A) : Annotator(&A) {}
 
   void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name,
                     llvm::BasicBlock *BB,
@@ -131,7 +131,7 @@ class IRInserter final : public llvm::IRBuilderDefaultInserter {
   }
 
 private:
-  class ScopAnnotator *Annotator = nullptr;
+  ScopAnnotator *Annotator = nullptr;
 };
 
 // TODO: We should not name instructions in NDEBUG builds.

diff  --git a/polly/include/polly/CodeGen/IslAst.h b/polly/include/polly/CodeGen/IslAst.h
index 997effcbe9aa2..c99a4957d6b48 100644
--- a/polly/include/polly/CodeGen/IslAst.h
+++ b/polly/include/polly/CodeGen/IslAst.h
@@ -29,9 +29,9 @@
 namespace polly {
 using llvm::SmallPtrSet;
 
-struct Dependences;
+class Dependences;
 
-class IslAst {
+class IslAst final {
 public:
   IslAst(const IslAst &) = delete;
   IslAst &operator=(const IslAst &) = delete;
@@ -163,7 +163,7 @@ class IslAstInfo {
   ///}
 };
 
-struct IslAstAnalysis : public AnalysisInfoMixin<IslAstAnalysis> {
+struct IslAstAnalysis : AnalysisInfoMixin<IslAstAnalysis> {
   static AnalysisKey Key;
 
   using Result = IslAstInfo;
@@ -172,7 +172,7 @@ struct IslAstAnalysis : public AnalysisInfoMixin<IslAstAnalysis> {
                  ScopStandardAnalysisResults &SAR);
 };
 
-class IslAstInfoWrapperPass : public ScopPass {
+class IslAstInfoWrapperPass final : public ScopPass {
   std::unique_ptr<IslAstInfo> Ast;
 
 public:
@@ -199,7 +199,7 @@ class IslAstInfoWrapperPass : public ScopPass {
 llvm::Pass *createIslAstInfoWrapperPassPass();
 llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS);
 
-struct IslAstPrinterPass : public PassInfoMixin<IslAstPrinterPass> {
+struct IslAstPrinterPass final : PassInfoMixin<IslAstPrinterPass> {
   IslAstPrinterPass(raw_ostream &OS) : OS(OS) {}
 
   PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

diff  --git a/polly/include/polly/CodeGen/IslExprBuilder.h b/polly/include/polly/CodeGen/IslExprBuilder.h
index 057724640525c..6842aaa456ac2 100644
--- a/polly/include/polly/CodeGen/IslExprBuilder.h
+++ b/polly/include/polly/CodeGen/IslExprBuilder.h
@@ -78,7 +78,7 @@ class ScopArrayInfo;
 ///   to use this information in our IslAstGenerator. Preliminary patches are
 ///   available, but have not been committed yet.
 ///
-class IslExprBuilder {
+class IslExprBuilder final {
 public:
   /// A map from isl_ids to llvm::Values.
   typedef llvm::MapVector<isl_id *, llvm::AssertingVH<llvm::Value>> IDToValueTy;

diff  --git a/polly/include/polly/CodeGen/LoopGeneratorsGOMP.h b/polly/include/polly/CodeGen/LoopGeneratorsGOMP.h
index 1f47d38f01628..83d9b4be96ddb 100644
--- a/polly/include/polly/CodeGen/LoopGeneratorsGOMP.h
+++ b/polly/include/polly/CodeGen/LoopGeneratorsGOMP.h
@@ -22,7 +22,7 @@ namespace polly {
 
 /// This ParallelLoopGenerator subclass handles the generation of parallelized
 /// code, utilizing the GNU OpenMP library.
-class ParallelLoopGeneratorGOMP : public ParallelLoopGenerator {
+class ParallelLoopGeneratorGOMP final : public ParallelLoopGenerator {
 public:
   /// Create a parallel loop generator for the current function.
   ParallelLoopGeneratorGOMP(PollyIRBuilder &Builder, LoopInfo &LI,

diff  --git a/polly/include/polly/CodeGen/LoopGeneratorsKMP.h b/polly/include/polly/CodeGen/LoopGeneratorsKMP.h
index c4921aced7668..9a7c75613d041 100644
--- a/polly/include/polly/CodeGen/LoopGeneratorsKMP.h
+++ b/polly/include/polly/CodeGen/LoopGeneratorsKMP.h
@@ -24,7 +24,7 @@ using llvm::GlobalVariable;
 
 /// This ParallelLoopGenerator subclass handles the generation of parallelized
 /// code, utilizing the LLVM OpenMP library.
-class ParallelLoopGeneratorKMP : public ParallelLoopGenerator {
+class ParallelLoopGeneratorKMP final : public ParallelLoopGenerator {
 public:
   /// Create a parallel loop generator for the current function.
   ParallelLoopGeneratorKMP(PollyIRBuilder &Builder, LoopInfo &LI,

diff  --git a/polly/include/polly/CodeGen/PerfMonitor.h b/polly/include/polly/CodeGen/PerfMonitor.h
index 81aa4c7ee447c..15c7714521618 100644
--- a/polly/include/polly/CodeGen/PerfMonitor.h
+++ b/polly/include/polly/CodeGen/PerfMonitor.h
@@ -13,7 +13,7 @@
 
 namespace polly {
 
-class PerfMonitor {
+class PerfMonitor final {
 public:
   /// Create a new performance monitor.
   ///

diff  --git a/polly/include/polly/CodePreparation.h b/polly/include/polly/CodePreparation.h
index fb1942b550e88..c6bc526db209d 100644
--- a/polly/include/polly/CodePreparation.h
+++ b/polly/include/polly/CodePreparation.h
@@ -16,7 +16,7 @@
 #include "llvm/IR/PassManager.h"
 
 namespace polly {
-struct CodePreparationPass : public llvm::PassInfoMixin<CodePreparationPass> {
+struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
   llvm::PreservedAnalyses run(llvm::Function &F,
                               llvm::FunctionAnalysisManager &FAM);
 };

diff  --git a/polly/include/polly/DeLICM.h b/polly/include/polly/DeLICM.h
index fea5291924c25..0e03c04079480 100644
--- a/polly/include/polly/DeLICM.h
+++ b/polly/include/polly/DeLICM.h
@@ -31,14 +31,14 @@ namespace polly {
 llvm::Pass *createDeLICMWrapperPass();
 llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS);
 
-struct DeLICMPass : llvm::PassInfoMixin<DeLICMPass> {
+struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
   DeLICMPass() {}
 
   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
                               ScopStandardAnalysisResults &SAR, SPMUpdater &U);
 };
 
-struct DeLICMPrinterPass : llvm::PassInfoMixin<DeLICMPrinterPass> {
+struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
   DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
 
   PreservedAnalyses run(Scop &S, ScopAnalysisManager &,

diff  --git a/polly/include/polly/DeadCodeElimination.h b/polly/include/polly/DeadCodeElimination.h
index 044bc2ae84ee4..d416afa030c56 100644
--- a/polly/include/polly/DeadCodeElimination.h
+++ b/polly/include/polly/DeadCodeElimination.h
@@ -24,7 +24,7 @@ class raw_ostream;
 namespace polly {
 llvm::Pass *createDeadCodeElimWrapperPass();
 
-struct DeadCodeElimPass : llvm::PassInfoMixin<DeadCodeElimPass> {
+struct DeadCodeElimPass final : llvm::PassInfoMixin<DeadCodeElimPass> {
   DeadCodeElimPass() {}
 
   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

diff  --git a/polly/include/polly/DependenceInfo.h b/polly/include/polly/DependenceInfo.h
index 47da54c32229c..d1d6aa2d4d09f 100644
--- a/polly/include/polly/DependenceInfo.h
+++ b/polly/include/polly/DependenceInfo.h
@@ -33,7 +33,8 @@ namespace polly {
 /// The Dependences struct holds all dependence information we collect and
 /// compute for one SCoP. It also offers an interface that allows users to
 /// query only specific parts.
-struct Dependences {
+class Dependences final {
+public:
   // Granularities of the current dependence analysis
   enum AnalysisLevel {
     AL_Statement = 0,
@@ -191,7 +192,7 @@ struct Dependences {
   const AnalysisLevel Level;
 };
 
-struct DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> {
+struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
   static AnalysisKey Key;
   struct Result {
     Scop &S;
@@ -212,8 +213,8 @@ struct DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> {
              ScopStandardAnalysisResults &SAR);
 };
 
-struct DependenceInfoPrinterPass
-    : public PassInfoMixin<DependenceInfoPrinterPass> {
+struct DependenceInfoPrinterPass final
+    : PassInfoMixin<DependenceInfoPrinterPass> {
   DependenceInfoPrinterPass(raw_ostream &OS) : OS(OS) {}
 
   PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
@@ -222,7 +223,7 @@ struct DependenceInfoPrinterPass
   raw_ostream &OS;
 };
 
-class DependenceInfo : public ScopPass {
+class DependenceInfo final : public ScopPass {
 public:
   static char ID;
 
@@ -266,7 +267,7 @@ llvm::Pass *createDependenceInfoPass();
 llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS);
 
 /// Construct a new DependenceInfoWrapper pass.
-class DependenceInfoWrapperPass : public FunctionPass {
+class DependenceInfoWrapperPass final : public FunctionPass {
 public:
   static char ID;
 

diff  --git a/polly/include/polly/ForwardOpTree.h b/polly/include/polly/ForwardOpTree.h
index 4cf0e908ddfd3..b5da0f513ab78 100644
--- a/polly/include/polly/ForwardOpTree.h
+++ b/polly/include/polly/ForwardOpTree.h
@@ -23,14 +23,14 @@ namespace polly {
 llvm::Pass *createForwardOpTreeWrapperPass();
 llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS);
 
-struct ForwardOpTreePass : llvm::PassInfoMixin<ForwardOpTreePass> {
+struct ForwardOpTreePass final : llvm::PassInfoMixin<ForwardOpTreePass> {
   ForwardOpTreePass() {}
 
   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
                               ScopStandardAnalysisResults &SAR, SPMUpdater &U);
 };
 
-struct ForwardOpTreePrinterPass
+struct ForwardOpTreePrinterPass final
     : llvm::PassInfoMixin<ForwardOpTreePrinterPass> {
   ForwardOpTreePrinterPass(raw_ostream &OS) : OS(OS) {}
 

diff  --git a/polly/include/polly/JSONExporter.h b/polly/include/polly/JSONExporter.h
index 1e98b43bc280d..958f95ea11404 100644
--- a/polly/include/polly/JSONExporter.h
+++ b/polly/include/polly/JSONExporter.h
@@ -19,14 +19,14 @@ llvm::Pass *createJSONImporterPrinterLegacyPass(llvm::raw_ostream &OS);
 
 /// This pass exports a scop to a jscop file. The filename is generated from the
 /// concatenation of the function and scop name.
-struct JSONExportPass : public llvm::PassInfoMixin<JSONExportPass> {
+struct JSONExportPass final : llvm::PassInfoMixin<JSONExportPass> {
   llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
                               ScopStandardAnalysisResults &, SPMUpdater &);
 };
 
 /// This pass imports a scop from a jscop file. The filename is deduced from the
 /// concatenation of the function and scop name.
-struct JSONImportPass : public llvm::PassInfoMixin<JSONExportPass> {
+struct JSONImportPass final : llvm::PassInfoMixin<JSONExportPass> {
   llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
                               ScopStandardAnalysisResults &, SPMUpdater &);
 };

diff  --git a/polly/include/polly/ManualOptimizer.h b/polly/include/polly/ManualOptimizer.h
index 988926334eb1a..31c7a8f24cb85 100644
--- a/polly/include/polly/ManualOptimizer.h
+++ b/polly/include/polly/ManualOptimizer.h
@@ -21,7 +21,7 @@ class OptimizationRemarkEmitter;
 
 namespace polly {
 class Scop;
-struct Dependences;
+class Dependences;
 
 /// Apply loop-transformation metadata.
 ///

diff  --git a/polly/include/polly/MatmulOptimizer.h b/polly/include/polly/MatmulOptimizer.h
index e00003d95b225..c8998b5797806 100644
--- a/polly/include/polly/MatmulOptimizer.h
+++ b/polly/include/polly/MatmulOptimizer.h
@@ -16,7 +16,7 @@ class TargetTransformInfo;
 }
 
 namespace polly {
-struct Dependences;
+class Dependences;
 
 /// Apply the BLIS matmul optimization pattern if possible.
 ///

diff  --git a/polly/include/polly/PolyhedralInfo.h b/polly/include/polly/PolyhedralInfo.h
index 37068aa559f69..b7534cd6b8df7 100644
--- a/polly/include/polly/PolyhedralInfo.h
+++ b/polly/include/polly/PolyhedralInfo.h
@@ -31,7 +31,7 @@ class Scop;
 class ScopInfo;
 class DependenceInfoWrapperPass;
 
-class PolyhedralInfo : public llvm::FunctionPass {
+class PolyhedralInfo final : public llvm::FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 

diff  --git a/polly/include/polly/PruneUnprofitable.h b/polly/include/polly/PruneUnprofitable.h
index 6335708fae86d..2d285cce69ad4 100644
--- a/polly/include/polly/PruneUnprofitable.h
+++ b/polly/include/polly/PruneUnprofitable.h
@@ -23,7 +23,8 @@ class PassRegistry;
 namespace polly {
 llvm::Pass *createPruneUnprofitableWrapperPass();
 
-struct PruneUnprofitablePass : llvm::PassInfoMixin<PruneUnprofitablePass> {
+struct PruneUnprofitablePass final
+    : llvm::PassInfoMixin<PruneUnprofitablePass> {
   PruneUnprofitablePass() {}
 
   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

diff  --git a/polly/include/polly/ScheduleOptimizer.h b/polly/include/polly/ScheduleOptimizer.h
index 47fba25eb5495..3e17eeff49ae3 100644
--- a/polly/include/polly/ScheduleOptimizer.h
+++ b/polly/include/polly/ScheduleOptimizer.h
@@ -20,7 +20,7 @@ namespace polly {
 llvm::Pass *createIslScheduleOptimizerWrapperPass();
 llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS);
 
-struct IslScheduleOptimizerPass
+struct IslScheduleOptimizerPass final
     : llvm::PassInfoMixin<IslScheduleOptimizerPass> {
   IslScheduleOptimizerPass() {}
 
@@ -28,7 +28,7 @@ struct IslScheduleOptimizerPass
                               ScopStandardAnalysisResults &SAR, SPMUpdater &U);
 };
 
-struct IslScheduleOptimizerPrinterPass
+struct IslScheduleOptimizerPrinterPass final
     : llvm::PassInfoMixin<IslScheduleOptimizerPrinterPass> {
   IslScheduleOptimizerPrinterPass(raw_ostream &OS) : OS(OS) {}
 

diff  --git a/polly/include/polly/ScheduleTreeTransform.h b/polly/include/polly/ScheduleTreeTransform.h
index b35da47f59cb8..ee504c4e5f524 100644
--- a/polly/include/polly/ScheduleTreeTransform.h
+++ b/polly/include/polly/ScheduleTreeTransform.h
@@ -126,7 +126,7 @@ struct ScheduleTreeVisitor {
 /// Recursively visit all nodes of a schedule tree.
 template <typename Derived, typename RetTy = void, typename... Args>
 struct RecursiveScheduleTreeVisitor
-    : public ScheduleTreeVisitor<Derived, RetTy, Args...> {
+    : ScheduleTreeVisitor<Derived, RetTy, Args...> {
   using BaseTy = ScheduleTreeVisitor<Derived, RetTy, Args...>;
   BaseTy &getBase() { return *this; }
   const BaseTy &getBase() const { return *this; }

diff  --git a/polly/include/polly/ScopBuilder.h b/polly/include/polly/ScopBuilder.h
index dbfc3dcff122a..d4c6441e7e8dd 100644
--- a/polly/include/polly/ScopBuilder.h
+++ b/polly/include/polly/ScopBuilder.h
@@ -30,7 +30,7 @@ class ScopDetection;
 extern bool ModelReadOnlyScalars;
 
 /// Build the Polly IR (Scop and ScopStmt) on a Region.
-class ScopBuilder {
+class ScopBuilder final {
 
   /// The AAResults to build AliasSetTracker.
   AAResults &AA;

diff  --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h
index 276aac5bf552e..dc5036c1ff1f2 100644
--- a/polly/include/polly/ScopDetection.h
+++ b/polly/include/polly/ScopDetection.h
@@ -627,7 +627,7 @@ class ScopDetection {
   OptimizationRemarkEmitter &ORE;
 };
 
-struct ScopAnalysis : public AnalysisInfoMixin<ScopAnalysis> {
+struct ScopAnalysis : AnalysisInfoMixin<ScopAnalysis> {
   static AnalysisKey Key;
 
   using Result = ScopDetection;
@@ -637,7 +637,7 @@ struct ScopAnalysis : public AnalysisInfoMixin<ScopAnalysis> {
   Result run(Function &F, FunctionAnalysisManager &FAM);
 };
 
-struct ScopAnalysisPrinterPass : public PassInfoMixin<ScopAnalysisPrinterPass> {
+struct ScopAnalysisPrinterPass final : PassInfoMixin<ScopAnalysisPrinterPass> {
   ScopAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {}
 
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
@@ -645,19 +645,20 @@ struct ScopAnalysisPrinterPass : public PassInfoMixin<ScopAnalysisPrinterPass> {
   raw_ostream &OS;
 };
 
-struct ScopDetectionWrapperPass : public FunctionPass {
-  static char ID;
+class ScopDetectionWrapperPass final : public FunctionPass {
   std::unique_ptr<ScopDetection> Result;
 
+public:
   ScopDetectionWrapperPass();
 
   /// @name FunctionPass interface
-  //@{
+  ///@{
+  static char ID;
   void getAnalysisUsage(AnalysisUsage &AU) const override;
   void releaseMemory() override;
   bool runOnFunction(Function &F) override;
   void print(raw_ostream &OS, const Module *M = nullptr) const override;
-  //@}
+  ///@}
 
   ScopDetection &getSD() const { return *Result; }
 };

diff  --git a/polly/include/polly/ScopDetectionDiagnostic.h b/polly/include/polly/ScopDetectionDiagnostic.h
index f4c2ee466a393..2d28fc30aaec5 100644
--- a/polly/include/polly/ScopDetectionDiagnostic.h
+++ b/polly/include/polly/ScopDetectionDiagnostic.h
@@ -163,7 +163,7 @@ class RejectReason {
 using RejectReasonPtr = std::shared_ptr<RejectReason>;
 
 /// Stores all errors that occurred during the detection.
-class RejectLog {
+class RejectLog final {
   Region *R;
   SmallVector<RejectReasonPtr, 1> ErrorReports;
 
@@ -204,7 +204,7 @@ class ReportCFG : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures bad terminator within a Scop candidate.
-class ReportInvalidTerminator : public ReportCFG {
+class ReportInvalidTerminator final : public ReportCFG {
   BasicBlock *BB;
 
 public:
@@ -227,7 +227,7 @@ class ReportInvalidTerminator : public ReportCFG {
 
 //===----------------------------------------------------------------------===//
 /// Captures irreducible regions in CFG.
-class ReportIrreducibleRegion : public ReportCFG {
+class ReportIrreducibleRegion final : public ReportCFG {
   Region *R;
   DebugLoc DbgLoc;
 
@@ -252,7 +252,7 @@ class ReportIrreducibleRegion : public ReportCFG {
 
 //===----------------------------------------------------------------------===//
 /// Captures regions with an unreachable in the exit block.
-class ReportUnreachableInExit : public ReportCFG {
+class ReportUnreachableInExit final : public ReportCFG {
   BasicBlock *BB;
   DebugLoc DbgLoc;
 
@@ -278,7 +278,7 @@ class ReportUnreachableInExit : public ReportCFG {
 
 //===----------------------------------------------------------------------===//
 /// Captures regions with an IndirectBr predecessor.
-class ReportIndirectPredecessor : public ReportCFG {
+class ReportIndirectPredecessor final : public ReportCFG {
   Instruction *Inst;
   DebugLoc DbgLoc;
 
@@ -328,7 +328,7 @@ class ReportAffFunc : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures a condition that is based on an 'undef' value.
-class ReportUndefCond : public ReportAffFunc {
+class ReportUndefCond final : public ReportAffFunc {
   // The BasicBlock we found the broken condition in.
   BasicBlock *BB;
 
@@ -353,7 +353,7 @@ class ReportUndefCond : public ReportAffFunc {
 /// Captures an invalid condition
 ///
 /// Conditions have to be either constants or icmp instructions.
-class ReportInvalidCond : public ReportAffFunc {
+class ReportInvalidCond final : public ReportAffFunc {
   // The BasicBlock we found the broken condition in.
   BasicBlock *BB;
 
@@ -376,7 +376,7 @@ class ReportInvalidCond : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures an undefined operand.
-class ReportUndefOperand : public ReportAffFunc {
+class ReportUndefOperand final : public ReportAffFunc {
   // The BasicBlock we found the undefined operand in.
   BasicBlock *BB;
 
@@ -399,7 +399,7 @@ class ReportUndefOperand : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures a non-affine branch.
-class ReportNonAffBranch : public ReportAffFunc {
+class ReportNonAffBranch final : public ReportAffFunc {
   // The BasicBlock we found the non-affine branch in.
   BasicBlock *BB;
 
@@ -433,7 +433,7 @@ class ReportNonAffBranch : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures a missing base pointer.
-class ReportNoBasePtr : public ReportAffFunc {
+class ReportNoBasePtr final : public ReportAffFunc {
 public:
   ReportNoBasePtr(const Instruction *Inst)
       : ReportAffFunc(RejectReasonKind::NoBasePtr, Inst) {}
@@ -453,7 +453,7 @@ class ReportNoBasePtr : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures an undefined base pointer.
-class ReportUndefBasePtr : public ReportAffFunc {
+class ReportUndefBasePtr final : public ReportAffFunc {
 public:
   ReportUndefBasePtr(const Instruction *Inst)
       : ReportAffFunc(RejectReasonKind::UndefBasePtr, Inst) {}
@@ -473,7 +473,7 @@ class ReportUndefBasePtr : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures a base pointer that is not invariant in the region.
-class ReportVariantBasePtr : public ReportAffFunc {
+class ReportVariantBasePtr final : public ReportAffFunc {
   // The variant base pointer.
   Value *BaseValue;
 
@@ -498,7 +498,7 @@ class ReportVariantBasePtr : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures a non-affine access function.
-class ReportNonAffineAccess : public ReportAffFunc {
+class ReportNonAffineAccess final : public ReportAffFunc {
   // The non-affine access function.
   const SCEV *AccessFunction;
 
@@ -529,7 +529,7 @@ class ReportNonAffineAccess : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Report array accesses with 
diff ering element size.
-class ReportDifferentArrayElementSize : public ReportAffFunc {
+class ReportDifferentArrayElementSize final : public ReportAffFunc {
   // The base pointer of the memory access.
   const Value *BaseValue;
 
@@ -554,7 +554,7 @@ class ReportDifferentArrayElementSize : public ReportAffFunc {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with non affine loop bounds.
-class ReportLoopBound : public RejectReason {
+class ReportLoopBound final : public RejectReason {
   // The offending loop.
   Loop *L;
 
@@ -586,7 +586,7 @@ class ReportLoopBound : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors when loop has no exit.
-class ReportLoopHasNoExit : public RejectReason {
+class ReportLoopHasNoExit final : public RejectReason {
   /// The loop that has no exit.
   Loop *L;
 
@@ -614,7 +614,7 @@ class ReportLoopHasNoExit : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors when a loop has multiple exists.
-class ReportLoopHasMultipleExits : public RejectReason {
+class ReportLoopHasMultipleExits final : public RejectReason {
   /// The loop that has multiple exits.
   Loop *L;
 
@@ -642,7 +642,7 @@ class ReportLoopHasMultipleExits : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors when not all loop latches are part of the scop.
-class ReportLoopOnlySomeLatches : public RejectReason {
+class ReportLoopOnlySomeLatches final : public RejectReason {
   /// The loop for which not all loop latches are part of the scop.
   Loop *L;
 
@@ -670,7 +670,7 @@ class ReportLoopOnlySomeLatches : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with non-side-effect-known function calls.
-class ReportFuncCall : public RejectReason {
+class ReportFuncCall final : public RejectReason {
   // The offending call instruction.
   Instruction *Inst;
 
@@ -694,7 +694,7 @@ class ReportFuncCall : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with aliasing.
-class ReportAlias : public RejectReason {
+class ReportAlias final : public RejectReason {
 public:
   using PointerSnapshotTy = std::vector<const Value *>;
 
@@ -751,7 +751,7 @@ class ReportOther : public RejectReason {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with bad IntToPtr instructions.
-class ReportIntToPtr : public ReportOther {
+class ReportIntToPtr final : public ReportOther {
   // The offending base value.
   Instruction *BaseValue;
 
@@ -774,7 +774,7 @@ class ReportIntToPtr : public ReportOther {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with alloca instructions.
-class ReportAlloca : public ReportOther {
+class ReportAlloca final : public ReportOther {
   Instruction *Inst;
 
 public:
@@ -796,7 +796,7 @@ class ReportAlloca : public ReportOther {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with unknown instructions.
-class ReportUnknownInst : public ReportOther {
+class ReportUnknownInst final : public ReportOther {
   Instruction *Inst;
 
 public:
@@ -818,7 +818,7 @@ class ReportUnknownInst : public ReportOther {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with regions containing the function entry block.
-class ReportEntry : public ReportOther {
+class ReportEntry final : public ReportOther {
   BasicBlock *BB;
 
 public:
@@ -841,7 +841,7 @@ class ReportEntry : public ReportOther {
 
 //===----------------------------------------------------------------------===//
 /// Report regions that seem not profitable to be optimized.
-class ReportUnprofitable : public ReportOther {
+class ReportUnprofitable final : public ReportOther {
   Region *R;
 
 public:
@@ -864,7 +864,7 @@ class ReportUnprofitable : public ReportOther {
 
 //===----------------------------------------------------------------------===//
 /// Captures errors with non-simple memory accesses.
-class ReportNonSimpleMemoryAccess : public ReportOther {
+class ReportNonSimpleMemoryAccess final : public ReportOther {
   // The offending call instruction.
   Instruction *Inst;
 

diff  --git a/polly/include/polly/ScopGraphPrinter.h b/polly/include/polly/ScopGraphPrinter.h
index b4cf84d705db4..b57732ad3d70d 100644
--- a/polly/include/polly/ScopGraphPrinter.h
+++ b/polly/include/polly/ScopGraphPrinter.h
@@ -27,7 +27,7 @@
 namespace llvm {
 
 template <>
-struct GraphTraits<polly::ScopDetection *> : public GraphTraits<RegionInfo *> {
+struct GraphTraits<polly::ScopDetection *> : GraphTraits<RegionInfo *> {
   static NodeRef getEntryNode(polly::ScopDetection *SD) {
     return GraphTraits<RegionInfo *>::getEntryNode(SD->getRI());
   }
@@ -40,8 +40,7 @@ struct GraphTraits<polly::ScopDetection *> : public GraphTraits<RegionInfo *> {
 };
 
 template <>
-struct DOTGraphTraits<polly::ScopDetection *>
-    : public DOTGraphTraits<RegionNode *> {
+struct DOTGraphTraits<polly::ScopDetection *> : DOTGraphTraits<RegionNode *> {
   DOTGraphTraits(bool isSimple = false)
       : DOTGraphTraits<RegionNode *>(isSimple) {}
   static std::string getGraphName(polly::ScopDetection *SD) {
@@ -71,23 +70,22 @@ struct DOTGraphTraits<polly::ScopDetection *>
 
 namespace polly {
 
-struct ScopViewer : public llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
+struct ScopViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
   ScopViewer() : llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops") {}
 
   bool processFunction(Function &F, const ScopDetection &SD) override;
 };
 
-struct ScopOnlyViewer : public llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
+struct ScopOnlyViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
   ScopOnlyViewer()
       : llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops-only") {}
 };
 
-struct ScopPrinter : public llvm::DOTGraphTraitsPrinter<ScopAnalysis, false> {
+struct ScopPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false> {
   ScopPrinter() : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false>("scops") {}
 };
 
-struct ScopOnlyPrinter
-    : public llvm::DOTGraphTraitsPrinter<ScopAnalysis, true> {
+struct ScopOnlyPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, true> {
   ScopOnlyPrinter()
       : llvm::DOTGraphTraitsPrinter<ScopAnalysis, true>("scopsonly") {}
 };

diff  --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 44ff0dde5e596..404edc89fed88 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -216,7 +216,7 @@ using AccFuncVector = std::vector<std::unique_ptr<MemoryAccess>>;
 /// Objects are accessible via the ScoP, MemoryAccess or the id associated with
 /// the MemoryAccess access function.
 ///
-class ScopArrayInfo {
+class ScopArrayInfo final {
 public:
   /// Construct a ScopArrayInfo object.
   ///
@@ -428,7 +428,7 @@ class ScopArrayInfo {
 };
 
 /// Represent memory accesses in statements.
-class MemoryAccess {
+class MemoryAccess final {
   friend class Scop;
   friend class ScopStmt;
   friend class ScopBuilder;
@@ -1135,7 +1135,7 @@ using InvariantEquivClassesTy = SmallVector<InvariantEquivClassTy, 8>;
 /// It is further described by its iteration domain, its schedule and its data
 /// accesses.
 /// At the moment every statement represents a single basic block of LLVM-IR.
-class ScopStmt {
+class ScopStmt final {
   friend class ScopBuilder;
 
 public:
@@ -1626,7 +1626,7 @@ raw_ostream &operator<<(raw_ostream &OS, const ScopStmt &S);
 ///   * A context
 ///   This context contains information about the values the parameters
 ///   can take and relations between 
diff erent parameters.
-class Scop {
+class Scop final {
 public:
   /// Type to represent a pair of minimal/maximal access to an array.
   using MinMaxAccessTy = std::pair<isl::pw_multi_aff, isl::pw_multi_aff>;
@@ -2684,7 +2684,7 @@ raw_ostream &operator<<(raw_ostream &OS, const Scop &scop);
 
 /// The legacy pass manager's analysis pass to compute scop information
 ///        for a region.
-class ScopInfoRegionPass : public RegionPass {
+class ScopInfoRegionPass final : public RegionPass {
   /// The Scop pointer which is used to construct a Scop.
   std::unique_ptr<Scop> S;
 
@@ -2774,7 +2774,7 @@ class ScopInfo {
   bool empty() const { return RegionToScopMap.empty(); }
 };
 
-struct ScopInfoAnalysis : public AnalysisInfoMixin<ScopInfoAnalysis> {
+struct ScopInfoAnalysis : AnalysisInfoMixin<ScopInfoAnalysis> {
   static AnalysisKey Key;
 
   using Result = ScopInfo;
@@ -2782,7 +2782,7 @@ struct ScopInfoAnalysis : public AnalysisInfoMixin<ScopInfoAnalysis> {
   Result run(Function &, FunctionAnalysisManager &);
 };
 
-struct ScopInfoPrinterPass : public PassInfoMixin<ScopInfoPrinterPass> {
+struct ScopInfoPrinterPass final : PassInfoMixin<ScopInfoPrinterPass> {
   ScopInfoPrinterPass(raw_ostream &OS) : Stream(OS) {}
 
   PreservedAnalyses run(Function &, FunctionAnalysisManager &);
@@ -2798,7 +2798,7 @@ struct ScopInfoPrinterPass : public PassInfoMixin<ScopInfoPrinterPass> {
 /// scop object for all the feasible scops present in a function.
 /// This pass is an alternative to the ScopInfoRegionPass in order to avoid a
 /// region pass manager.
-class ScopInfoWrapperPass : public FunctionPass {
+class ScopInfoWrapperPass final : public FunctionPass {
   std::unique_ptr<ScopInfo> Result;
 
 public:

diff  --git a/polly/include/polly/ScopPass.h b/polly/include/polly/ScopPass.h
index db910572bcc7e..c9d325a7e2a6f 100644
--- a/polly/include/polly/ScopPass.h
+++ b/polly/include/polly/ScopPass.h
@@ -124,7 +124,7 @@ extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Scop,
 namespace polly {
 
 template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
-class OwningInnerAnalysisManagerProxy
+class OwningInnerAnalysisManagerProxy final
     : public InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT> {
 public:
   OwningInnerAnalysisManagerProxy()
@@ -191,7 +191,7 @@ struct ScopStandardAnalysisResults {
   TargetTransformInfo &TTI;
 };
 
-class SPMUpdater {
+class SPMUpdater final {
 public:
   SPMUpdater(SmallPriorityWorklist<Region *, 4> &Worklist,
              ScopAnalysisManager &SAM)
@@ -212,13 +212,12 @@ class SPMUpdater {
   bool InvalidateCurrentScop;
   SmallPriorityWorklist<Region *, 4> &Worklist;
   ScopAnalysisManager &SAM;
-  template <typename ScopPassT> friend class FunctionToScopPassAdaptor;
+  template <typename ScopPassT> friend struct FunctionToScopPassAdaptor;
 };
 
 template <typename ScopPassT>
-class FunctionToScopPassAdaptor
-    : public PassInfoMixin<FunctionToScopPassAdaptor<ScopPassT>> {
-public:
+struct FunctionToScopPassAdaptor final
+    : PassInfoMixin<FunctionToScopPassAdaptor<ScopPassT>> {
   explicit FunctionToScopPassAdaptor(ScopPassT Pass) : Pass(std::move(Pass)) {}
 
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) {

diff  --git a/polly/include/polly/Simplify.h b/polly/include/polly/Simplify.h
index 45c9bdf5dd8da..b2aa58d850fae 100644
--- a/polly/include/polly/Simplify.h
+++ b/polly/include/polly/Simplify.h
@@ -52,7 +52,7 @@ llvm::SmallVector<MemoryAccess *, 32> getAccessesInOrder(ScopStmt &Stmt);
 llvm::Pass *createSimplifyWrapperPass(int CallNo = 0);
 llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS);
 
-struct SimplifyPass : public PassInfoMixin<SimplifyPass> {
+struct SimplifyPass final : PassInfoMixin<SimplifyPass> {
   SimplifyPass(int CallNo = 0) : CallNo(CallNo) {}
 
   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
@@ -62,7 +62,7 @@ struct SimplifyPass : public PassInfoMixin<SimplifyPass> {
   int CallNo;
 };
 
-struct SimplifyPrinterPass : public PassInfoMixin<SimplifyPrinterPass> {
+struct SimplifyPrinterPass final : PassInfoMixin<SimplifyPrinterPass> {
   SimplifyPrinterPass(raw_ostream &OS, int CallNo = 0)
       : OS(OS), CallNo(CallNo) {}
 

diff  --git a/polly/include/polly/Support/DumpFunctionPass.h b/polly/include/polly/Support/DumpFunctionPass.h
index 2a803ef17ceec..e5c16203adb8f 100644
--- a/polly/include/polly/Support/DumpFunctionPass.h
+++ b/polly/include/polly/Support/DumpFunctionPass.h
@@ -25,7 +25,7 @@ namespace polly {
 llvm::FunctionPass *createDumpFunctionWrapperPass(std::string Suffix);
 
 /// A pass that isolates a function into a new Module and writes it into a file.
-struct DumpFunctionPass : llvm::PassInfoMixin<DumpFunctionPass> {
+struct DumpFunctionPass final : llvm::PassInfoMixin<DumpFunctionPass> {
   std::string Suffix;
 
   DumpFunctionPass(std::string Suffix) : Suffix(std::move(Suffix)) {}

diff  --git a/polly/include/polly/Support/DumpModulePass.h b/polly/include/polly/Support/DumpModulePass.h
index 851ba6401d03c..c90bbc2484310 100644
--- a/polly/include/polly/Support/DumpModulePass.h
+++ b/polly/include/polly/Support/DumpModulePass.h
@@ -34,7 +34,7 @@ llvm::ModulePass *createDumpModuleWrapperPass(std::string Filename,
                                               bool IsSuffix);
 
 /// A pass that prints the module into a file.
-struct DumpModulePass : llvm::PassInfoMixin<DumpModulePass> {
+struct DumpModulePass final : llvm::PassInfoMixin<DumpModulePass> {
   std::string Filename;
   bool IsSuffix;
 

diff  --git a/polly/include/polly/Support/GICHelper.h b/polly/include/polly/Support/GICHelper.h
index 67be60cbb3a84..a116f07bae67b 100644
--- a/polly/include/polly/Support/GICHelper.h
+++ b/polly/include/polly/Support/GICHelper.h
@@ -354,7 +354,7 @@ operator<<(llvm::DiagnosticInfoOptimizationBase &OS,
 /// This is typically used inside a nested IslMaxOperationsGuard scope. The
 /// IslMaxOperationsGuard defines the number of allowed base operations for some
 /// code, IslQuotaScope defines where it is allowed to return an error result.
-class IslQuotaScope {
+class IslQuotaScope final {
   isl_ctx *IslCtx;
   int OldOnError;
 
@@ -421,7 +421,7 @@ class IslQuotaScope {
 /// counter cannot be reset to the previous state, or one that adds the
 /// operations while being in the nested scope. Use therefore is only allowed
 /// while currently a no operations-limit is active.
-class IslMaxOperationsGuard {
+class IslMaxOperationsGuard final {
 private:
   /// The ISL context to set the operations limit.
   ///

diff  --git a/polly/include/polly/Support/ISLTools.h b/polly/include/polly/Support/ISLTools.h
index 790f7b0025334..0aa766413f63e 100644
--- a/polly/include/polly/Support/ISLTools.h
+++ b/polly/include/polly/Support/ISLTools.h
@@ -48,11 +48,11 @@ template <typename ListT>
 using list_element_type = decltype(std::declval<ListT>().get_at(0));
 
 template <typename ListT>
-struct isl_iterator
+class isl_iterator
     : public llvm::iterator_facade_base<isl_iterator<ListT>,
                                         std::forward_iterator_tag,
                                         list_element_type<ListT>> {
-
+public:
   using ElementT = list_element_type<ListT>;
 
   explicit isl_iterator(const ListT &List)

diff  --git a/polly/include/polly/Support/SCEVAffinator.h b/polly/include/polly/Support/SCEVAffinator.h
index a555f6c3426b2..35e87dfd9cd8a 100644
--- a/polly/include/polly/Support/SCEVAffinator.h
+++ b/polly/include/polly/Support/SCEVAffinator.h
@@ -27,7 +27,7 @@ class Scop;
 typedef std::pair<isl::pw_aff, isl::set> PWACtx;
 
 /// Translate a SCEV to an isl::pw_aff and the domain on which it is invalid.
-struct SCEVAffinator : public llvm::SCEVVisitor<SCEVAffinator, PWACtx> {
+class SCEVAffinator final : public llvm::SCEVVisitor<SCEVAffinator, PWACtx> {
 public:
   SCEVAffinator(Scop *S, llvm::LoopInfo &LI);
 

diff  --git a/polly/include/polly/Support/ScopHelper.h b/polly/include/polly/Support/ScopHelper.h
index 1219b7a97d44f..38f16d0a03939 100644
--- a/polly/include/polly/Support/ScopHelper.h
+++ b/polly/include/polly/Support/ScopHelper.h
@@ -133,7 +133,7 @@ using BoxedLoopsSetTy = llvm::SetVector<const llvm::Loop *>;
 /// is currently not supported in C++ such that those cannot be used directly.
 /// (llvm::isa could, but then llvm:cast etc. would not have the expected
 /// behavior)
-class MemAccInst {
+class MemAccInst final {
 private:
   llvm::Instruction *I;
 

diff  --git a/polly/include/polly/Support/VirtualInstruction.h b/polly/include/polly/Support/VirtualInstruction.h
index c9746d82d17d9..a6d0100189ab9 100644
--- a/polly/include/polly/Support/VirtualInstruction.h
+++ b/polly/include/polly/Support/VirtualInstruction.h
@@ -28,7 +28,7 @@ using llvm::User;
 /// Despite its name it is not tied to virtual instructions (although it works
 /// fine with them), but to promote consistent handling of values used in
 /// statements.
-class VirtualUse {
+class VirtualUse final {
 public:
   /// The 
diff erent types of uses. Handling usually 
diff erentiates a lot between
   /// these; one can use a switch to handle each case (and get warned by the
@@ -167,7 +167,7 @@ class VirtualUse {
 };
 
 /// An iterator for virtual operands.
-class VirtualOperandIterator {
+class VirtualOperandIterator final {
   friend class VirtualInstruction;
   friend class VirtualUse;
 
@@ -228,7 +228,7 @@ class VirtualOperandIterator {
 /// ScopStmt/Instruction-pair uniquely identifies a virtual instructions.
 /// ScopStmt::getInstruction() can contain the same instruction multiple times,
 /// but they necessarily compute the same value.
-class VirtualInstruction {
+class VirtualInstruction final {
   friend class VirtualOperandIterator;
   friend struct llvm::DenseMapInfo<VirtualInstruction>;
 

diff  --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp
index 00d1b855a316d..d30dbc8a7fce2 100644
--- a/polly/lib/Analysis/DependenceInfo.cpp
+++ b/polly/lib/Analysis/DependenceInfo.cpp
@@ -930,7 +930,7 @@ INITIALIZE_PASS_END(DependenceInfo, "polly-dependences",
 
 namespace {
 /// Print result from DependenceAnalysis.
-class DependenceInfoPrinterLegacyPass : public ScopPass {
+class DependenceInfoPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 
@@ -1037,7 +1037,7 @@ INITIALIZE_PASS_END(
 
 namespace {
 /// Print result from DependenceInfoWrapperPass.
-class DependenceInfoPrinterLegacyFunctionPass : public FunctionPass {
+class DependenceInfoPrinterLegacyFunctionPass final : public FunctionPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Analysis/PolyhedralInfo.cpp b/polly/lib/Analysis/PolyhedralInfo.cpp
index 689cfe3d52249..dff67e85b8eaa 100644
--- a/polly/lib/Analysis/PolyhedralInfo.cpp
+++ b/polly/lib/Analysis/PolyhedralInfo.cpp
@@ -170,7 +170,7 @@ INITIALIZE_PASS_END(PolyhedralInfo, "polyhedral-info",
 
 namespace {
 /// Print result from PolyhedralInfo.
-class PolyhedralInfoPrinterLegacyPass : public FunctionPass {
+class PolyhedralInfoPrinterLegacyPass final : public FunctionPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Analysis/PruneUnprofitable.cpp b/polly/lib/Analysis/PruneUnprofitable.cpp
index abcbf3d809d97..db4a3d73dc33a 100644
--- a/polly/lib/Analysis/PruneUnprofitable.cpp
+++ b/polly/lib/Analysis/PruneUnprofitable.cpp
@@ -78,7 +78,7 @@ static bool runPruneUnprofitable(Scop &S) {
   return false;
 }
 
-class PruneUnprofitableWrapperPass : public ScopPass {
+class PruneUnprofitableWrapperPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index f81d3d171f093..12e92fe4a9e99 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -281,7 +281,7 @@ static void updateLoopCountStatistic(ScopDetection::LoopStats Stats,
 
 namespace {
 
-class DiagnosticScopFound : public DiagnosticInfo {
+class DiagnosticScopFound final : public DiagnosticInfo {
 private:
   static int PluginDiagnosticKind;
 
@@ -850,7 +850,7 @@ namespace {
 /// always add and verify the assumption that for all subscript expressions
 /// 'exp' the inequality 0 <= exp < size holds. Hence, we will also verify
 /// that 0 <= size, which means smax(0, size) == size.
-class SCEVRemoveMax : public SCEVRewriteVisitor<SCEVRemoveMax> {
+class SCEVRemoveMax final : public SCEVRewriteVisitor<SCEVRemoveMax> {
 public:
   SCEVRemoveMax(ScalarEvolution &SE, std::vector<const SCEV *> *Terms)
       : SCEVRewriteVisitor(SE), Terms(Terms) {}
@@ -2048,7 +2048,7 @@ INITIALIZE_PASS_END(ScopDetectionWrapperPass, "polly-detect",
 
 namespace {
 /// Print result from ScopDetectionWrapperPass.
-class ScopDetectionPrinterLegacyPass : public FunctionPass {
+class ScopDetectionPrinterLegacyPass final : public FunctionPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp
index fbbbe74c67f49..0f37c96ddf745 100644
--- a/polly/lib/Analysis/ScopGraphPrinter.cpp
+++ b/polly/lib/Analysis/ScopGraphPrinter.cpp
@@ -141,9 +141,9 @@ struct ScopDetectionAnalysisGraphTraits {
 };
 
 struct ScopViewerWrapperPass
-    : public DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
-                                             ScopDetection *,
-                                             ScopDetectionAnalysisGraphTraits> {
+    : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
+                                      ScopDetection *,
+                                      ScopDetectionAnalysisGraphTraits> {
   static char ID;
   ScopViewerWrapperPass()
       : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
@@ -164,9 +164,9 @@ struct ScopViewerWrapperPass
 char ScopViewerWrapperPass::ID = 0;
 
 struct ScopOnlyViewerWrapperPass
-    : public DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
-                                             ScopDetection *,
-                                             ScopDetectionAnalysisGraphTraits> {
+    : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
+                                      ScopDetection *,
+                                      ScopDetectionAnalysisGraphTraits> {
   static char ID;
   ScopOnlyViewerWrapperPass()
       : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
@@ -177,9 +177,9 @@ struct ScopOnlyViewerWrapperPass
 char ScopOnlyViewerWrapperPass::ID = 0;
 
 struct ScopPrinterWrapperPass
-    : public DOTGraphTraitsPrinterWrapperPass<
-          ScopDetectionWrapperPass, false, ScopDetection *,
-          ScopDetectionAnalysisGraphTraits> {
+    : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false,
+                                       ScopDetection *,
+                                       ScopDetectionAnalysisGraphTraits> {
   static char ID;
   ScopPrinterWrapperPass()
       : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false,
@@ -190,9 +190,9 @@ struct ScopPrinterWrapperPass
 char ScopPrinterWrapperPass::ID = 0;
 
 struct ScopOnlyPrinterWrapperPass
-    : public DOTGraphTraitsPrinterWrapperPass<
-          ScopDetectionWrapperPass, true, ScopDetection *,
-          ScopDetectionAnalysisGraphTraits> {
+    : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true,
+                                       ScopDetection *,
+                                       ScopDetectionAnalysisGraphTraits> {
   static char ID;
   ScopOnlyPrinterWrapperPass()
       : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true,

diff  --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 8231b384c9cb1..e7096555d7db5 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1358,7 +1358,7 @@ void Scop::setContext(isl::set NewContext) {
 namespace {
 
 /// Remap parameter values but keep AddRecs valid wrt. invariant loads.
-struct SCEVSensitiveParameterRewriter
+class SCEVSensitiveParameterRewriter final
     : public SCEVRewriteVisitor<SCEVSensitiveParameterRewriter> {
   const ValueToValueMap &VMap;
 
@@ -1389,7 +1389,7 @@ struct SCEVSensitiveParameterRewriter
 };
 
 /// Check whether we should remap a SCEV expression.
-struct SCEVFindInsideScop : public SCEVTraversal<SCEVFindInsideScop> {
+class SCEVFindInsideScop : public SCEVTraversal<SCEVFindInsideScop> {
   const ValueToValueMap &VMap;
   bool FoundInside = false;
   const Scop *S;
@@ -2647,7 +2647,7 @@ INITIALIZE_PASS_END(ScopInfoRegionPass, "polly-scops",
 namespace {
 
 /// Print result from ScopInfoRegionPass.
-class ScopInfoPrinterLegacyRegionPass : public RegionPass {
+class ScopInfoPrinterLegacyRegionPass final : public RegionPass {
 public:
   static char ID;
 
@@ -2829,7 +2829,7 @@ INITIALIZE_PASS_END(
 
 namespace {
 /// Print result from ScopInfoWrapperPass.
-class ScopInfoPrinterLegacyFunctionPass : public FunctionPass {
+class ScopInfoPrinterLegacyFunctionPass final : public FunctionPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp
index 31143eae7526b..97d6737cc9c78 100644
--- a/polly/lib/CodeGen/CodeGeneration.cpp
+++ b/polly/lib/CodeGen/CodeGeneration.cpp
@@ -303,7 +303,7 @@ static bool generateCode(Scop &S, IslAstInfo &AI, LoopInfo &LI,
 
 namespace {
 
-class CodeGeneration : public ScopPass {
+class CodeGeneration final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/CodeGen/CodegenCleanup.cpp b/polly/lib/CodeGen/CodegenCleanup.cpp
index 5a080469754b1..6ecb1f454b8da 100644
--- a/polly/lib/CodeGen/CodegenCleanup.cpp
+++ b/polly/lib/CodeGen/CodegenCleanup.cpp
@@ -27,7 +27,7 @@ using namespace polly;
 
 namespace {
 
-class CodegenCleanup : public FunctionPass {
+class CodegenCleanup final : public FunctionPass {
 private:
   CodegenCleanup(const CodegenCleanup &) = delete;
   const CodegenCleanup &operator=(const CodegenCleanup &) = delete;

diff  --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp
index 33a4661bbbc1f..98e9638b700ae 100644
--- a/polly/lib/CodeGen/IslAst.cpp
+++ b/polly/lib/CodeGen/IslAst.cpp
@@ -828,7 +828,7 @@ INITIALIZE_PASS_END(IslAstInfoWrapperPass, "polly-ast",
 
 namespace {
 /// Print result from IslAstInfoWrapperPass.
-class IslAstInfoPrinterLegacyPass : public ScopPass {
+class IslAstInfoPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp
index 92d710f08878d..568239c0985c7 100644
--- a/polly/lib/CodeGen/IslNodeBuilder.cpp
+++ b/polly/lib/CodeGen/IslNodeBuilder.cpp
@@ -246,7 +246,7 @@ static void findReferencesInStmt(ScopStmt *Stmt, SetVector<Value *> &Values,
 
 void polly::addReferencesFromStmt(ScopStmt *Stmt, void *UserPtr,
                                   bool CreateScalarRefs) {
-  auto &References = *static_cast<struct SubtreeReferences *>(UserPtr);
+  auto &References = *static_cast<SubtreeReferences *>(UserPtr);
 
   findReferencesInStmt(Stmt, References.Values, References.GlobalMap,
                        References.SCEVs);
@@ -284,8 +284,7 @@ void polly::addReferencesFromStmt(ScopStmt *Stmt, void *UserPtr,
 /// @param Set     A set which references the ScopStmt we are interested in.
 /// @param UserPtr A void pointer that can be casted to a SubtreeReferences
 ///                structure.
-static void addReferencesFromStmtSet(isl::set Set,
-                                     struct SubtreeReferences *UserPtr) {
+static void addReferencesFromStmtSet(isl::set Set, SubtreeReferences *UserPtr) {
   isl::id Id = Set.get_tuple_id();
   auto *Stmt = static_cast<ScopStmt *>(Id.get_user());
   addReferencesFromStmt(Stmt, UserPtr);
@@ -304,9 +303,8 @@ static void addReferencesFromStmtSet(isl::set Set,
 /// @param References The SubtreeReferences data structure through which
 ///                   results are returned and further information is
 ///                   provided.
-static void
-addReferencesFromStmtUnionSet(isl::union_set USet,
-                              struct SubtreeReferences &References) {
+static void addReferencesFromStmtUnionSet(isl::union_set USet,
+                                          SubtreeReferences &References) {
 
   for (isl::set Set : USet.get_set_list())
     addReferencesFromStmtSet(Set, &References);
@@ -321,7 +319,7 @@ void IslNodeBuilder::getReferencesInSubtree(const isl::ast_node &For,
                                             SetVector<Value *> &Values,
                                             SetVector<const Loop *> &Loops) {
   SetVector<const SCEV *> SCEVs;
-  struct SubtreeReferences References = {
+  SubtreeReferences References = {
       LI, SE, S, ValueMap, Values, SCEVs, getBlockGenerator(), nullptr};
 
   for (const auto &I : IDToValue)

diff  --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
index 449a4b54ba2a7..1b63da728bfb8 100644
--- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
+++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
@@ -348,7 +348,7 @@ static void replaceAllUsesAndConstantUses(Value *Old, Value *New,
     rewriteOldValToNew(I, Old, New, Builder);
 }
 
-class ManagedMemoryRewritePass : public ModulePass {
+class ManagedMemoryRewritePass final : public ModulePass {
 public:
   static char ID;
   GPUArch Architecture;

diff  --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 111edc1b0ed88..2b6ae8584c548 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -346,7 +346,7 @@ static int computeSizeInBytes(const Type *T) {
 /// for generating GPU specific user nodes.
 ///
 /// @see GPUNodeBuilder::createUser
-class GPUNodeBuilder : public IslNodeBuilder {
+class GPUNodeBuilder final : public IslNodeBuilder {
 public:
   GPUNodeBuilder(PollyIRBuilder &Builder, ScopAnnotator &Annotator,
                  const DataLayout &DL, LoopInfo &LI, ScalarEvolution &SE,
@@ -409,7 +409,7 @@ class GPUNodeBuilder : public IslNodeBuilder {
   GPUArch Arch;
 
   /// Class to free isl_ids.
-  class IslIdDeleter {
+  class IslIdDeleter final {
   public:
     void operator()(__isl_take isl_id *Id) { isl_id_free(Id); };
   };
@@ -2558,7 +2558,7 @@ alignPwAffs(const std::vector<__isl_take isl_pw_aff *> &&PwAffs,
 }
 
 namespace {
-class PPCGCodeGeneration : public ScopPass {
+class PPCGCodeGeneration final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index 0676bfa7ae8fb..3bb2a9aafe1d1 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -51,7 +51,8 @@ static cl::opt<std::string>
                   cl::Hidden, cl::value_desc("File postfix"), cl::ValueRequired,
                   cl::init(""), cl::cat(PollyCategory));
 
-struct JSONExporter : public ScopPass {
+class JSONExporter : public ScopPass {
+public:
   static char ID;
   explicit JSONExporter() : ScopPass(ID) {}
 
@@ -65,7 +66,8 @@ struct JSONExporter : public ScopPass {
   void getAnalysisUsage(AnalysisUsage &AU) const override;
 };
 
-struct JSONImporter : public ScopPass {
+class JSONImporter : public ScopPass {
+public:
   static char ID;
   std::vector<std::string> NewAccessStrings;
   explicit JSONImporter() : ScopPass(ID) {}
@@ -838,7 +840,7 @@ INITIALIZE_PASS_END(JSONImporter, "polly-import-jscop",
 
 namespace {
 /// Print result from JSONImporter.
-class JSONImporterPrinterLegacyPass : public ScopPass {
+class JSONImporterPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Support/DumpFunctionPass.cpp b/polly/lib/Support/DumpFunctionPass.cpp
index a14e0efb82caf..9256f12d76621 100644
--- a/polly/lib/Support/DumpFunctionPass.cpp
+++ b/polly/lib/Support/DumpFunctionPass.cpp
@@ -82,7 +82,7 @@ static void runDumpFunction(llvm::Function &F, StringRef Suffix) {
   LLVM_DEBUG(dbgs() << "Dump file " << Dumpfile << " written successfully\n");
 }
 
-class DumpFunctionWrapperPass : public FunctionPass {
+class DumpFunctionWrapperPass final : public FunctionPass {
 private:
   DumpFunctionWrapperPass(const DumpFunctionWrapperPass &) = delete;
   const DumpFunctionWrapperPass &

diff  --git a/polly/lib/Support/DumpModulePass.cpp b/polly/lib/Support/DumpModulePass.cpp
index 85f4dd39adde8..5df74b2df43bb 100644
--- a/polly/lib/Support/DumpModulePass.cpp
+++ b/polly/lib/Support/DumpModulePass.cpp
@@ -48,7 +48,7 @@ static void runDumpModule(llvm::Module &M, StringRef Filename, bool IsSuffix) {
   Out->keep();
 }
 
-class DumpModuleWrapperPass : public ModulePass {
+class DumpModuleWrapperPass final : public ModulePass {
 private:
   DumpModuleWrapperPass(const DumpModuleWrapperPass &) = delete;
   const DumpModuleWrapperPass &

diff  --git a/polly/lib/Support/RegisterPasses.cpp b/polly/lib/Support/RegisterPasses.cpp
index ef52adf56019b..e5fbb280db8c2 100644
--- a/polly/lib/Support/RegisterPasses.cpp
+++ b/polly/lib/Support/RegisterPasses.cpp
@@ -234,8 +234,7 @@ namespace {
 /// We use the constructor of a statically declared object to initialize the
 /// 
diff erent Polly passes right after the Polly library is loaded. This ensures
 /// that the Polly passes are available e.g. in the 'opt' tool.
-class StaticInitializer {
-public:
+struct StaticInitializer {
   StaticInitializer() {
     llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
     polly::initializePollyPasses(Registry);

diff  --git a/polly/lib/Support/SCEVValidator.cpp b/polly/lib/Support/SCEVValidator.cpp
index 2ca41c3ee46f6..7f2a4910c6f27 100644
--- a/polly/lib/Support/SCEVValidator.cpp
+++ b/polly/lib/Support/SCEVValidator.cpp
@@ -35,7 +35,7 @@ enum TYPE {
 } // namespace SCEVType
 
 /// The result the validator returns for a SCEV expression.
-class ValidatorResult {
+class ValidatorResult final {
   /// The type of the expression
   SCEVType::TYPE Type;
 
@@ -112,14 +112,13 @@ class ValidatorResult {
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS, class ValidatorResult &VR) {
+raw_ostream &operator<<(raw_ostream &OS, ValidatorResult &VR) {
   VR.print(OS);
   return OS;
 }
 
 /// Check if a SCEV is valid in a SCoP.
-struct SCEVValidator
-    : public SCEVVisitor<SCEVValidator, class ValidatorResult> {
+class SCEVValidator : public SCEVVisitor<SCEVValidator, ValidatorResult> {
 private:
   const Region *R;
   Loop *Scope;
@@ -131,12 +130,12 @@ struct SCEVValidator
                 InvariantLoadsSetTy *ILS)
       : R(R), Scope(Scope), SE(SE), ILS(ILS) {}
 
-  class ValidatorResult visitConstant(const SCEVConstant *Constant) {
+  ValidatorResult visitConstant(const SCEVConstant *Constant) {
     return ValidatorResult(SCEVType::INT);
   }
 
-  class ValidatorResult visitZeroExtendOrTruncateExpr(const SCEV *Expr,
-                                                      const SCEV *Operand) {
+  ValidatorResult visitZeroExtendOrTruncateExpr(const SCEV *Expr,
+                                                const SCEV *Operand) {
     ValidatorResult Op = visit(Operand);
     auto Type = Op.getType();
 
@@ -150,23 +149,23 @@ struct SCEVValidator
     return ValidatorResult(SCEVType::PARAM, Expr);
   }
 
-  class ValidatorResult visitPtrToIntExpr(const SCEVPtrToIntExpr *Expr) {
+  ValidatorResult visitPtrToIntExpr(const SCEVPtrToIntExpr *Expr) {
     return visit(Expr->getOperand());
   }
 
-  class ValidatorResult visitTruncateExpr(const SCEVTruncateExpr *Expr) {
+  ValidatorResult visitTruncateExpr(const SCEVTruncateExpr *Expr) {
     return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand());
   }
 
-  class ValidatorResult visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) {
+  ValidatorResult visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) {
     return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand());
   }
 
-  class ValidatorResult visitSignExtendExpr(const SCEVSignExtendExpr *Expr) {
+  ValidatorResult visitSignExtendExpr(const SCEVSignExtendExpr *Expr) {
     return visit(Expr->getOperand());
   }
 
-  class ValidatorResult visitAddExpr(const SCEVAddExpr *Expr) {
+  ValidatorResult visitAddExpr(const SCEVAddExpr *Expr) {
     ValidatorResult Return(SCEVType::INT);
 
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -181,7 +180,7 @@ struct SCEVValidator
     return Return;
   }
 
-  class ValidatorResult visitMulExpr(const SCEVMulExpr *Expr) {
+  ValidatorResult visitMulExpr(const SCEVMulExpr *Expr) {
     ValidatorResult Return(SCEVType::INT);
 
     bool HasMultipleParams = false;
@@ -217,7 +216,7 @@ struct SCEVValidator
     return Return;
   }
 
-  class ValidatorResult visitAddRecExpr(const SCEVAddRecExpr *Expr) {
+  ValidatorResult visitAddRecExpr(const SCEVAddRecExpr *Expr) {
     if (!Expr->isAffine()) {
       LLVM_DEBUG(dbgs() << "INVALID: AddRec is not affine");
       return ValidatorResult(SCEVType::INVALID);
@@ -272,7 +271,7 @@ struct SCEVValidator
     return ZeroStartResult;
   }
 
-  class ValidatorResult visitSMaxExpr(const SCEVSMaxExpr *Expr) {
+  ValidatorResult visitSMaxExpr(const SCEVSMaxExpr *Expr) {
     ValidatorResult Return(SCEVType::INT);
 
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -287,7 +286,7 @@ struct SCEVValidator
     return Return;
   }
 
-  class ValidatorResult visitSMinExpr(const SCEVSMinExpr *Expr) {
+  ValidatorResult visitSMinExpr(const SCEVSMinExpr *Expr) {
     ValidatorResult Return(SCEVType::INT);
 
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -302,7 +301,7 @@ struct SCEVValidator
     return Return;
   }
 
-  class ValidatorResult visitUMaxExpr(const SCEVUMaxExpr *Expr) {
+  ValidatorResult visitUMaxExpr(const SCEVUMaxExpr *Expr) {
     // We do not support unsigned max operations. If 'Expr' is constant during
     // Scop execution we treat this as a parameter, otherwise we bail out.
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -317,7 +316,7 @@ struct SCEVValidator
     return ValidatorResult(SCEVType::PARAM, Expr);
   }
 
-  class ValidatorResult visitUMinExpr(const SCEVUMinExpr *Expr) {
+  ValidatorResult visitUMinExpr(const SCEVUMinExpr *Expr) {
     // We do not support unsigned min operations. If 'Expr' is constant during
     // Scop execution we treat this as a parameter, otherwise we bail out.
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -332,8 +331,7 @@ struct SCEVValidator
     return ValidatorResult(SCEVType::PARAM, Expr);
   }
 
-  class ValidatorResult
-  visitSequentialUMinExpr(const SCEVSequentialUMinExpr *Expr) {
+  ValidatorResult visitSequentialUMinExpr(const SCEVSequentialUMinExpr *Expr) {
     // We do not support unsigned min operations. If 'Expr' is constant during
     // Scop execution we treat this as a parameter, otherwise we bail out.
     for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@@ -464,7 +462,7 @@ struct SCEVValidator
 };
 
 /// Check whether a SCEV refers to an SSA name defined inside a region.
-class SCEVInRegionDependences {
+class SCEVInRegionDependences final {
   const Region *R;
   Loop *Scope;
   const InvariantLoadsSetTy &ILS;
@@ -520,7 +518,7 @@ class SCEVInRegionDependences {
 };
 
 /// Find all loops referenced in SCEVAddRecExprs.
-class SCEVFindLoops {
+class SCEVFindLoops final {
   SetVector<const Loop *> &Loops;
 
 public:
@@ -541,7 +539,7 @@ void polly::findLoops(const SCEV *Expr, SetVector<const Loop *> &Loops) {
 }
 
 /// Find all values referenced in SCEVUnknowns.
-class SCEVFindValues {
+class SCEVFindValues final {
   ScalarEvolution &SE;
   SetVector<Value *> &Values;
 

diff  --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index 2f4f5e74318c8..162b18544aef4 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -233,7 +233,7 @@ void polly::recordAssumption(polly::RecordedAssumptionsTy *RecordedAssumptions,
 /// and we generate code outside/in front of that region. Hence, we generate the
 /// code for the SDiv/SRem operands in front of the analyzed region and then
 /// create a new SDiv/SRem operation there too.
-struct ScopExpander : SCEVVisitor<ScopExpander, const SCEV *> {
+struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
   friend struct SCEVVisitor<ScopExpander, const SCEV *>;
 
   explicit ScopExpander(const Region &R, ScalarEvolution &SE,

diff  --git a/polly/lib/Transform/Canonicalization.cpp b/polly/lib/Transform/Canonicalization.cpp
index d65d626df0c5b..d55bbe26a7b4a 100644
--- a/polly/lib/Transform/Canonicalization.cpp
+++ b/polly/lib/Transform/Canonicalization.cpp
@@ -132,7 +132,7 @@ polly::buildCanonicalicationPassesForNPM(llvm::ModulePassManager &MPM,
 }
 
 namespace {
-class PollyCanonicalize : public ModulePass {
+class PollyCanonicalize final : public ModulePass {
   PollyCanonicalize(const PollyCanonicalize &) = delete;
   const PollyCanonicalize &operator=(const PollyCanonicalize &) = delete;
 

diff  --git a/polly/lib/Transform/CodePreparation.cpp b/polly/lib/Transform/CodePreparation.cpp
index dfbf616ff96c4..7c8579eb93218 100644
--- a/polly/lib/Transform/CodePreparation.cpp
+++ b/polly/lib/Transform/CodePreparation.cpp
@@ -31,7 +31,7 @@ namespace {
 
 /// Prepare the IR for the scop detection.
 ///
-class CodePreparation : public FunctionPass {
+class CodePreparation final : public FunctionPass {
   CodePreparation(const CodePreparation &) = delete;
   const CodePreparation &operator=(const CodePreparation &) = delete;
 

diff  --git a/polly/lib/Transform/DeLICM.cpp b/polly/lib/Transform/DeLICM.cpp
index 7cf7ebe463ceb..9948e08971d89 100644
--- a/polly/lib/Transform/DeLICM.cpp
+++ b/polly/lib/Transform/DeLICM.cpp
@@ -183,7 +183,7 @@ isl::union_map expandMapping(isl::union_map Relevant, isl::union_set Universe) {
 /// conflict, but overwrite values that might still be required. Another source
 /// of problems are multiple writes to the same element at the same timepoint,
 /// because their order is undefined.
-class Knowledge {
+class Knowledge final {
 private:
   /// { [Element[] -> Zone[]] }
   /// Set of array elements and when they are alive.
@@ -520,7 +520,7 @@ class Knowledge {
 };
 
 /// Implementation of the DeLICM/DePRE transformation.
-class DeLICMImpl : public ZoneAlgorithm {
+class DeLICMImpl final : public ZoneAlgorithm {
 private:
   /// Knowledge before any transformation took place.
   Knowledge OriginalZone;
@@ -1416,7 +1416,7 @@ static PreservedAnalyses runDeLICMUsingNPM(Scop &S, ScopAnalysisManager &SAM,
   return PA;
 }
 
-class DeLICMWrapperPass : public ScopPass {
+class DeLICMWrapperPass final : public ScopPass {
 private:
   DeLICMWrapperPass(const DeLICMWrapperPass &) = delete;
   const DeLICMWrapperPass &operator=(const DeLICMWrapperPass &) = delete;
@@ -1459,7 +1459,7 @@ class DeLICMWrapperPass : public ScopPass {
 char DeLICMWrapperPass::ID;
 
 /// Print result from DeLICMWrapperPass.
-class DeLICMPrinterLegacyPass : public ScopPass {
+class DeLICMPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Transform/DeadCodeElimination.cpp b/polly/lib/Transform/DeadCodeElimination.cpp
index 546f38653b969..42b48f4106dd8 100644
--- a/polly/lib/Transform/DeadCodeElimination.cpp
+++ b/polly/lib/Transform/DeadCodeElimination.cpp
@@ -51,7 +51,7 @@ cl::opt<int> DCEPreciseSteps(
              "before the actual dead code elimination."),
     cl::ZeroOrMore, cl::init(-1), cl::cat(PollyCategory));
 
-class DeadCodeElimWrapperPass : public ScopPass {
+class DeadCodeElimWrapperPass final : public ScopPass {
 public:
   static char ID;
   explicit DeadCodeElimWrapperPass() : ScopPass(ID) {}

diff  --git a/polly/lib/Transform/FlattenSchedule.cpp b/polly/lib/Transform/FlattenSchedule.cpp
index 5d551c8fed815..27de81f433b82 100644
--- a/polly/lib/Transform/FlattenSchedule.cpp
+++ b/polly/lib/Transform/FlattenSchedule.cpp
@@ -35,7 +35,7 @@ void printSchedule(raw_ostream &OS, const isl::union_map &Schedule,
 }
 
 /// Flatten the schedule stored in an polly::Scop.
-class FlattenSchedule : public ScopPass {
+class FlattenSchedule final : public ScopPass {
 private:
   FlattenSchedule(const FlattenSchedule &) = delete;
   const FlattenSchedule &operator=(const FlattenSchedule &) = delete;
@@ -98,7 +98,7 @@ class FlattenSchedule : public ScopPass {
 char FlattenSchedule::ID;
 
 /// Print result from FlattenSchedule.
-class FlattenSchedulePrinterLegacyPass : public ScopPass {
+class FlattenSchedulePrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Transform/ForwardOpTree.cpp b/polly/lib/Transform/ForwardOpTree.cpp
index 567faea5003b0..fd4052f57a437 100644
--- a/polly/lib/Transform/ForwardOpTree.cpp
+++ b/polly/lib/Transform/ForwardOpTree.cpp
@@ -197,7 +197,7 @@ struct ForwardingAction {
 /// the MemoryAccess is removed and the all the operand tree instructions are
 /// moved into the statement. All original instructions are left in the source
 /// statements. The simplification pass can clean these up.
-class ForwardOpTreeImpl : ZoneAlgorithm {
+class ForwardOpTreeImpl final : ZoneAlgorithm {
 private:
   using MemoizationTy = DenseMap<ForwardingAction::KeyTy, ForwardingAction>;
 
@@ -1101,7 +1101,7 @@ runForwardOpTreeUsingNPM(Scop &S, ScopAnalysisManager &SAM,
 /// scalar definition are redirected (We currently do not care about removing
 /// the write in this case).  This is also useful for the main DeLICM pass as
 /// there are less scalars to be mapped.
-class ForwardOpTreeWrapperPass : public ScopPass {
+class ForwardOpTreeWrapperPass final : public ScopPass {
 private:
   /// The pass implementation, also holding per-scop data.
   std::unique_ptr<ForwardOpTreeImpl> Impl;
@@ -1145,7 +1145,7 @@ class ForwardOpTreeWrapperPass : public ScopPass {
 char ForwardOpTreeWrapperPass::ID;
 
 /// Print result from ForwardOpTreeWrapperPass.
-class ForwardOpTreePrinterLegacyPass : public ScopPass {
+class ForwardOpTreePrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Transform/ManualOptimizer.cpp b/polly/lib/Transform/ManualOptimizer.cpp
index ec4c584b27e2e..c3f040a018b24 100644
--- a/polly/lib/Transform/ManualOptimizer.cpp
+++ b/polly/lib/Transform/ManualOptimizer.cpp
@@ -132,7 +132,7 @@ static auto getLoopMDProps(MDNode *LoopMD) {
 
 /// Recursively visit all nodes in a schedule, loop for loop-transformations
 /// metadata and apply the first encountered.
-class SearchTransformVisitor
+class SearchTransformVisitor final
     : public RecursiveScheduleTreeVisitor<SearchTransformVisitor> {
 private:
   using BaseTy = RecursiveScheduleTreeVisitor<SearchTransformVisitor>;

diff  --git a/polly/lib/Transform/MatmulOptimizer.cpp b/polly/lib/Transform/MatmulOptimizer.cpp
index 60dd9eda3c2c0..38636b7b528c3 100644
--- a/polly/lib/Transform/MatmulOptimizer.cpp
+++ b/polly/lib/Transform/MatmulOptimizer.cpp
@@ -539,8 +539,8 @@ static uint64_t getMatMulTypeSize(MatMulInfoTy MMI) {
 /// @param MMI Parameters of the matrix multiplication operands.
 /// @return The structure of type MicroKernelParamsTy.
 /// @see MicroKernelParamsTy
-static struct MicroKernelParamsTy
-getMicroKernelParams(const TargetTransformInfo *TTI, MatMulInfoTy MMI) {
+static MicroKernelParamsTy getMicroKernelParams(const TargetTransformInfo *TTI,
+                                                MatMulInfoTy MMI) {
   assert(TTI && "The target transform info should be provided.");
 
   // Nvec - Number of double-precision floating-point numbers that can be hold
@@ -614,7 +614,7 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
 /// @return The structure of type MacroKernelParamsTy.
 /// @see MacroKernelParamsTy
 /// @see MicroKernelParamsTy
-static struct MacroKernelParamsTy
+static MacroKernelParamsTy
 getMacroKernelParams(const llvm::TargetTransformInfo *TTI,
                      const MicroKernelParamsTy &MicroKernelParams,
                      MatMulInfoTy MMI) {
@@ -893,7 +893,7 @@ getInductionVariablesSubstitution(isl::schedule_node Node,
 /// @return The modified isl_schedule_node.
 static isl::schedule_node
 isolateAndUnrollMatMulInnerLoops(isl::schedule_node Node,
-                                 struct MicroKernelParamsTy MicroKernelParams) {
+                                 MicroKernelParamsTy MicroKernelParams) {
   isl::schedule_node Child = Node.child(0);
   isl::union_map UnMapOldIndVar = Child.get_prefix_schedule_relation();
   isl::set Prefix = isl::map::from_union_map(UnMapOldIndVar).range();

diff  --git a/polly/lib/Transform/MaximalStaticExpansion.cpp b/polly/lib/Transform/MaximalStaticExpansion.cpp
index f0893b72db7aa..c1baa2080b463 100644
--- a/polly/lib/Transform/MaximalStaticExpansion.cpp
+++ b/polly/lib/Transform/MaximalStaticExpansion.cpp
@@ -34,7 +34,7 @@ using namespace polly;
 
 namespace {
 
-class MaximalStaticExpander : public ScopPass {
+class MaximalStaticExpander final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp
index fad62d9b20830..34d95ea11d594 100644
--- a/polly/lib/Transform/ScheduleOptimizer.cpp
+++ b/polly/lib/Transform/ScheduleOptimizer.cpp
@@ -237,7 +237,7 @@ struct OptimizerAdditionalInfoTy {
   bool Prevect;
 };
 
-class ScheduleTreeOptimizer {
+class ScheduleTreeOptimizer final {
 public:
   /// Apply schedule tree transformations.
   ///
@@ -384,7 +384,7 @@ ScheduleTreeOptimizer::isolateFullPartialTiles(isl::schedule_node Node,
   return Result;
 }
 
-struct InsertSimdMarkers : public ScheduleNodeRewriter<InsertSimdMarkers> {
+struct InsertSimdMarkers final : ScheduleNodeRewriter<InsertSimdMarkers> {
   isl::schedule_node visitBand(isl::schedule_node_band Band) {
     isl::schedule_node Node = visitChildren(Band);
 
@@ -588,7 +588,7 @@ bool ScheduleTreeOptimizer::isProfitableSchedule(Scop &S,
   return changed;
 }
 
-class IslScheduleOptimizerWrapperPass : public ScopPass {
+class IslScheduleOptimizerWrapperPass final : public ScopPass {
 public:
   static char ID;
 
@@ -1013,7 +1013,7 @@ IslScheduleOptimizerPrinterPass::run(Scop &S, ScopAnalysisManager &SAM,
 
 namespace {
 /// Print result from IslScheduleOptimizerWrapperPass.
-class IslScheduleOptimizerPrinterLegacyPass : public ScopPass {
+class IslScheduleOptimizerPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 

diff  --git a/polly/lib/Transform/ScheduleTreeTransform.cpp b/polly/lib/Transform/ScheduleTreeTransform.cpp
index fad9eb25173f5..7c3d047d1078c 100644
--- a/polly/lib/Transform/ScheduleTreeTransform.cpp
+++ b/polly/lib/Transform/ScheduleTreeTransform.cpp
@@ -128,7 +128,7 @@ static isl::schedule rebuildBand(isl::schedule_node_band OldBand,
 /// AST build options must be set after the tree has been constructed.
 template <typename Derived, typename... Args>
 struct ScheduleTreeRewriter
-    : public RecursiveScheduleTreeVisitor<Derived, isl::schedule, Args...> {
+    : RecursiveScheduleTreeVisitor<Derived, isl::schedule, Args...> {
   Derived &getDerived() { return *static_cast<Derived *>(this); }
   const Derived &getDerived() const {
     return *static_cast<const Derived *>(this);
@@ -212,7 +212,7 @@ struct ScheduleTreeRewriter
 
 /// Rewrite the schedule tree without any changes. Useful to copy a subtree into
 /// a new schedule, discarding everything but.
-struct IdentityRewriter : public ScheduleTreeRewriter<IdentityRewriter> {};
+struct IdentityRewriter : ScheduleTreeRewriter<IdentityRewriter> {};
 
 /// Rewrite a schedule tree to an equivalent one without extension nodes.
 ///
@@ -225,9 +225,9 @@ struct IdentityRewriter : public ScheduleTreeRewriter<IdentityRewriter> {};
 ///    band nodes to schedule the additional domains at the same position as the
 ///    extension node would.
 ///
-struct ExtensionNodeRewriter
-    : public ScheduleTreeRewriter<ExtensionNodeRewriter, const isl::union_set &,
-                                  isl::union_map &> {
+struct ExtensionNodeRewriter final
+    : ScheduleTreeRewriter<ExtensionNodeRewriter, const isl::union_set &,
+                           isl::union_map &> {
   using BaseTy = ScheduleTreeRewriter<ExtensionNodeRewriter,
                                       const isl::union_set &, isl::union_map &>;
   BaseTy &getBase() { return *this; }
@@ -356,8 +356,8 @@ struct ExtensionNodeRewriter
 ///
 /// ScheduleTreeRewriter cannot apply the schedule tree options. This class
 /// collects these options to apply them later.
-struct CollectASTBuildOptions
-    : public RecursiveScheduleTreeVisitor<CollectASTBuildOptions> {
+struct CollectASTBuildOptions final
+    : RecursiveScheduleTreeVisitor<CollectASTBuildOptions> {
   using BaseTy = RecursiveScheduleTreeVisitor<CollectASTBuildOptions>;
   BaseTy &getBase() { return *this; }
   const BaseTy &getBase() const { return *this; }
@@ -376,8 +376,7 @@ struct CollectASTBuildOptions
 /// This rewrites a schedule tree with the AST build options applied. We assume
 /// that the band nodes are visited in the same order as they were when the
 /// build options were collected, typically by CollectASTBuildOptions.
-struct ApplyASTBuildOptions
-    : public ScheduleNodeRewriter<ApplyASTBuildOptions> {
+struct ApplyASTBuildOptions final : ScheduleNodeRewriter<ApplyASTBuildOptions> {
   using BaseTy = ScheduleNodeRewriter<ApplyASTBuildOptions>;
   BaseTy &getBase() { return *this; }
   const BaseTy &getBase() const { return *this; }
@@ -560,7 +559,8 @@ static isl::set addExtentConstraints(isl::set Set, int VectorWidth) {
 }
 
 /// Collapse perfectly nested bands into a single band.
-class BandCollapseRewriter : public ScheduleTreeRewriter<BandCollapseRewriter> {
+class BandCollapseRewriter final
+    : public ScheduleTreeRewriter<BandCollapseRewriter> {
 private:
   using BaseTy = ScheduleTreeRewriter<BandCollapseRewriter>;
   BaseTy &getBase() { return *this; }
@@ -833,7 +833,7 @@ static isl::schedule tryGreedyFuse(isl::schedule_node LHS,
 ///
 /// The isl::union_map parameters is the set of validity dependencies that have
 /// not been resolved/carried by a parent schedule node.
-class GreedyFusionRewriter
+class GreedyFusionRewriter final
     : public ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map> {
 private:
   using BaseTy = ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map>;

diff  --git a/polly/lib/Transform/ScopInliner.cpp b/polly/lib/Transform/ScopInliner.cpp
index c93c00f5870c2..ca61407d25873 100644
--- a/polly/lib/Transform/ScopInliner.cpp
+++ b/polly/lib/Transform/ScopInliner.cpp
@@ -27,7 +27,7 @@ using namespace llvm;
 using namespace polly;
 
 namespace {
-class ScopInliner : public CallGraphSCCPass {
+class ScopInliner final : public CallGraphSCCPass {
   using llvm::Pass::doInitialization;
 
 public:

diff  --git a/polly/lib/Transform/Simplify.cpp b/polly/lib/Transform/Simplify.cpp
index c9f88a879eddc..f6cbfceb1c273 100644
--- a/polly/lib/Transform/Simplify.cpp
+++ b/polly/lib/Transform/Simplify.cpp
@@ -119,7 +119,7 @@ static isl::union_map underapproximatedAddMap(isl::union_map UMap,
   return UResult;
 }
 
-class SimplifyImpl {
+class SimplifyImpl final {
 private:
   /// The invocation id (if there are multiple instances in the pass manager's
   /// pipeline) to determine which statistics to update.
@@ -754,7 +754,7 @@ void SimplifyImpl::printScop(raw_ostream &OS, Scop &S) const {
   printAccesses(OS);
 }
 
-class SimplifyWrapperPass : public ScopPass {
+class SimplifyWrapperPass final : public ScopPass {
 public:
   static char ID;
   int CallNo;
@@ -855,7 +855,7 @@ INITIALIZE_PASS_END(SimplifyWrapperPass, "polly-simplify", "Polly - Simplify",
 
 namespace {
 /// Print result from SimplifyWrapperPass.
-class SimplifyPrinterLegacyPass : public ScopPass {
+class SimplifyPrinterLegacyPass final : public ScopPass {
 public:
   static char ID;
 


        


More information about the llvm-commits mailing list