diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -539,8 +539,8 @@ }; /// Represent a C++ namespace. -class NamespaceDecl : public NamedDecl, public DeclContext, - public Redeclarable +class NamespaceDecl final : public NamedDecl, public DeclContext, + public Redeclarable { /// The starting location of the source range, pointing /// to either the namespace or the inline keyword. @@ -1684,7 +1684,7 @@ }; /// Represents a parameter to a function. -class ParmVarDecl : public VarDecl { +class ParmVarDecl final : public VarDecl { public: enum { MaxFunctionScopeDepth = 255 }; enum { MaxFunctionScopeIndex = 255 }; @@ -3677,7 +3677,7 @@ /// Represents an enum. In C++11, enums can be forward-declared /// with a fixed underlying type, and in C we allow them to be forward-declared /// with no underlying type as an extension. -class EnumDecl : public TagDecl { +class EnumDecl final : public TagDecl { // This class stores some data in DeclContext::EnumDeclBits // to save some space. Use the provided accessors to access it. @@ -4255,7 +4255,7 @@ /// Represents a block literal declaration, which is like an /// unnamed FunctionDecl. For example: /// ^{ statement-body } or ^(int arg1, float arg2){ statement-body } -class BlockDecl : public Decl, public DeclContext { +class BlockDecl final : public Decl, public DeclContext { // This class stores some data in DeclContext::BlockDeclBits // to save some space. Use the provided accessors to access it. public: diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -2763,7 +2763,7 @@ /// operator bool(); /// }; /// \endcode -class CXXConversionDecl : public CXXMethodDecl { +class CXXConversionDecl final : public CXXMethodDecl { CXXConversionDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool UsesFPIntrin, bool isInline, @@ -3956,7 +3956,7 @@ }; /// Represents a C++11 static_assert declaration. -class StaticAssertDecl : public Decl { +class StaticAssertDecl final : public Decl { llvm::PointerIntPair AssertExprAndFailed; StringLiteral *Message; SourceLocation RParenLoc; diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -136,7 +136,7 @@ /// A selector represents a unique name for a method. The selector names for /// the above methods are setMenu:, menu, replaceSubview:with:, and defaultMenu. /// -class ObjCMethodDecl : public NamedDecl, public DeclContext { +class ObjCMethodDecl final : public NamedDecl, public DeclContext { // This class stores some data in DeclContext::ObjCMethodDeclBits // to save some space. Use the provided accessors to access it. @@ -1146,8 +1146,8 @@ /// Unlike C++, ObjC is a single-rooted class model. In Cocoa, classes /// typically inherit from NSObject (an exception is NSProxy). /// -class ObjCInterfaceDecl : public ObjCContainerDecl - , public Redeclarable { +class ObjCInterfaceDecl final : public ObjCContainerDecl, + public Redeclarable { friend class ASTContext; /// TypeForDecl - This indicates the Type object that represents this @@ -1918,7 +1918,7 @@ /// id canBePackage; // framework visibility (not available in C++). /// } /// -class ObjCIvarDecl : public FieldDecl { +class ObjCIvarDecl final : public FieldDecl { void anchor() override; public: @@ -1995,7 +1995,7 @@ }; /// Represents a field declaration created by an \@defs(...). -class ObjCAtDefsFieldDecl : public FieldDecl { +class ObjCAtDefsFieldDecl final : public FieldDecl { ObjCAtDefsFieldDecl(DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW) diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -1003,7 +1003,7 @@ }; /// Declaration of a template function. -class FunctionTemplateDecl : public RedeclarableTemplateDecl { +class FunctionTemplateDecl final : public RedeclarableTemplateDecl { protected: friend class FunctionDecl; @@ -2270,7 +2270,7 @@ }; /// Declaration of a class template. -class ClassTemplateDecl : public RedeclarableTemplateDecl { +class ClassTemplateDecl final : public RedeclarableTemplateDecl { protected: /// Data that is common to all of the declarations of a given /// class template. diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -69,7 +69,7 @@ /// in to the compiler instance for everything. When possible, utility functions /// come in two forms; a short form that reuses the CompilerInstance objects, /// and a long form that takes explicit instances of any required objects. -class CompilerInstance : public ModuleLoader { +class CompilerInstance final : public ModuleLoader { /// The options used in this compiler instance. std::shared_ptr Invocation; diff --git a/clang/include/clang/Lex/Lexer.h b/clang/include/clang/Lex/Lexer.h --- a/clang/include/clang/Lex/Lexer.h +++ b/clang/include/clang/Lex/Lexer.h @@ -75,7 +75,7 @@ /// stream of tokens. This provides no support for file reading or buffering, /// or buffering/seeking of tokens, only forward lexing is supported. It relies /// on the specified Preprocessor object to handle preprocessor directives, etc. -class Lexer : public PreprocessorLexer { +class Lexer final : public PreprocessorLexer { friend class Preprocessor; void anchor() override; diff --git a/clang/include/clang/Lex/Pragma.h b/clang/include/clang/Lex/Pragma.h --- a/clang/include/clang/Lex/Pragma.h +++ b/clang/include/clang/Lex/Pragma.h @@ -93,7 +93,7 @@ /// allowing hierarchical pragmas to be defined. Common examples of namespaces /// are "\#pragma GCC", "\#pragma STDC", and "\#pragma omp", but any namespaces /// may be (potentially recursively) defined. -class PragmaNamespace : public PragmaHandler { +class PragmaNamespace final : public PragmaHandler { /// Handlers - This is a map of the handlers in this namespace with their name /// as key. llvm::StringMap> Handlers; diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -57,7 +57,7 @@ /// parsing units of the grammar, productions are invoked to handle whatever has /// been read. /// -class Parser : public CodeCompletionHandler { +class Parser final : public CodeCompletionHandler { friend class ColonProtectionRAIIObject; friend class ParsingOpenMPDirectiveRAII; friend class InMessageExpressionRAIIObject; diff --git a/clang/include/clang/Sema/CodeCompleteConsumer.h b/clang/include/clang/Sema/CodeCompleteConsumer.h --- a/clang/include/clang/Sema/CodeCompleteConsumer.h +++ b/clang/include/clang/Sema/CodeCompleteConsumer.h @@ -1243,7 +1243,7 @@ /// A simple code-completion consumer that prints the results it /// receives in a simple format. -class PrintingCodeCompleteConsumer : public CodeCompleteConsumer { +class PrintingCodeCompleteConsumer final : public CodeCompleteConsumer { /// The raw output stream. raw_ostream &OS; diff --git a/clang/include/clang/Sema/SemaInternal.h b/clang/include/clang/Sema/SemaInternal.h --- a/clang/include/clang/Sema/SemaInternal.h +++ b/clang/include/clang/Sema/SemaInternal.h @@ -82,7 +82,7 @@ return getDepthAndIndex(UPP.first.get()); } -class TypoCorrectionConsumer : public VisibleDeclConsumer { +class TypoCorrectionConsumer final : public VisibleDeclConsumer { typedef SmallVector TypoResultList; typedef llvm::StringMap TypoResultsMap; typedef std::map TypoEditDistanceMap; diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -338,7 +338,7 @@ /// The AST reader provides lazy de-serialization of declarations, as /// required when traversing the AST. Only those AST nodes that are /// actually required will be de-serialized. -class ASTReader +class ASTReader final : public ExternalPreprocessorSource, public ExternalPreprocessingRecordSource, public ExternalHeaderFileInfoSource, diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h @@ -163,7 +163,7 @@ /// Tracker aimes at providing a sensible set of default behaviors that can be /// used by any checker, while providing mechanisms to hook into any part of the /// tracking process and insert checker-specific logic. -class Tracker : public llvm::RefCountedBase { +class Tracker final : public llvm::RefCountedBase { private: using ExpressionHandlerPtr = std::unique_ptr; using StoreHandlerPtr = std::unique_ptr; diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h @@ -64,7 +64,7 @@ bool isSuppressOnSink() const { return SuppressOnSink; } }; -class BuiltinBug : public BugType { +class BuiltinBug final : public BugType { const std::string desc; void anchor() override; public: diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -871,7 +871,7 @@ /// Represents a call to a C++ constructor. /// /// Example: \c T(1) -class CXXConstructorCall : public AnyCXXConstructorCall { +class CXXConstructorCall final : public AnyCXXConstructorCall { friend class CallEventManager; protected: @@ -1128,7 +1128,7 @@ /// Represents any expression that calls an Objective-C method. /// /// This includes all of the kinds listed in ObjCMessageKind. -class ObjCMethodCall : public CallEvent { +class ObjCMethodCall final : public CallEvent { friend class CallEventManager; const PseudoObjectExpr *getContainingPseudoObjectExpr() const; diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h @@ -1093,7 +1093,7 @@ const PointerType *ThisPointerTy; }; -class FieldRegion : public DeclRegion { +class FieldRegion final : public DeclRegion { friend class MemRegionManager; const FieldDecl *FD; diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h @@ -27,7 +27,7 @@ namespace clang { namespace ento { -class SMTConstraintManager : public clang::ento::SimpleConstraintManager { +class SMTConstraintManager final : public clang::ento::SimpleConstraintManager { mutable llvm::SMTSolverRef Solver = llvm::CreateZ3Solver(); public: diff --git a/clang/lib/Driver/ToolChains/AIX.h b/clang/lib/Driver/ToolChains/AIX.h --- a/clang/lib/Driver/ToolChains/AIX.h +++ b/clang/lib/Driver/ToolChains/AIX.h @@ -19,7 +19,7 @@ /// aix -- Directly call system default assembler and linker. namespace aix { -class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: Assembler(const ToolChain &TC) : Tool("aix::Assembler", "assembler", TC) {} @@ -31,7 +31,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("aix::Linker", "linker", TC) {} @@ -54,7 +54,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY AIX : public ToolChain { +class LLVM_LIBRARY_VISIBILITY AIX final : public ToolChain { public: AIX(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/BareMetal.h b/clang/lib/Driver/ToolChains/BareMetal.h --- a/clang/lib/Driver/ToolChains/BareMetal.h +++ b/clang/lib/Driver/ToolChains/BareMetal.h @@ -19,7 +19,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY BareMetal : public ToolChain { +class LLVM_LIBRARY_VISIBILITY BareMetal final : public ToolChain { public: BareMetal(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); @@ -77,7 +77,7 @@ namespace tools { namespace baremetal { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("baremetal::Linker", "ld.lld", TC) {} bool isLinkJob() const override { return true; } diff --git a/clang/lib/Driver/ToolChains/CSKYToolChain.h b/clang/lib/Driver/ToolChains/CSKYToolChain.h --- a/clang/lib/Driver/ToolChains/CSKYToolChain.h +++ b/clang/lib/Driver/ToolChains/CSKYToolChain.h @@ -16,7 +16,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY CSKYToolChain : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY CSKYToolChain final : public Generic_ELF { public: CSKYToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); @@ -44,7 +44,7 @@ namespace tools { namespace CSKY { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("CSKY::Linker", "ld", TC) {} bool hasIntegratedCPP() const override { return false; } diff --git a/clang/lib/Driver/ToolChains/CrossWindows.h b/clang/lib/Driver/ToolChains/CrossWindows.h --- a/clang/lib/Driver/ToolChains/CrossWindows.h +++ b/clang/lib/Driver/ToolChains/CrossWindows.h @@ -20,7 +20,7 @@ namespace tools { namespace CrossWindows { -class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: Assembler(const ToolChain &TC) : Tool("CrossWindows::Assembler", "as", TC) {} @@ -32,7 +32,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("CrossWindows::Linker", "ld", TC) {} @@ -49,7 +49,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain : public Generic_GCC { +class LLVM_LIBRARY_VISIBILITY CrossWindowsToolChain final : public Generic_GCC { public: CrossWindowsToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/Darwin.h b/clang/lib/Driver/ToolChains/Darwin.h --- a/clang/lib/Driver/ToolChains/Darwin.h +++ b/clang/lib/Driver/ToolChains/Darwin.h @@ -46,7 +46,7 @@ : Tool(Name, ShortName, TC) {} }; -class LLVM_LIBRARY_VISIBILITY Assembler : public MachOTool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public MachOTool { public: Assembler(const ToolChain &TC) : MachOTool("darwin::Assembler", "assembler", TC) {} @@ -59,7 +59,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public MachOTool { +class LLVM_LIBRARY_VISIBILITY Linker final : public MachOTool { bool NeedsTempPath(const InputInfoList &Inputs) const; void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, @@ -78,7 +78,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY StaticLibTool : public MachOTool { +class LLVM_LIBRARY_VISIBILITY StaticLibTool final : public MachOTool { public: StaticLibTool(const ToolChain &TC) : MachOTool("darwin::StaticLibTool", "static-lib-linker", TC) {} @@ -92,7 +92,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool { +class LLVM_LIBRARY_VISIBILITY Lipo final : public MachOTool { public: Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {} @@ -104,7 +104,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool { +class LLVM_LIBRARY_VISIBILITY Dsymutil final : public MachOTool { public: Dsymutil(const ToolChain &TC) : MachOTool("darwin::Dsymutil", "dsymutil", TC) {} @@ -118,7 +118,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool { +class LLVM_LIBRARY_VISIBILITY VerifyDebug final : public MachOTool { public: VerifyDebug(const ToolChain &TC) : MachOTool("darwin::VerifyDebug", "dwarfdump", TC) {} @@ -572,7 +572,7 @@ }; /// DarwinClang - The Darwin toolchain used by Clang. -class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin { +class LLVM_LIBRARY_VISIBILITY DarwinClang final : public Darwin { public: DarwinClang(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/Fuchsia.h b/clang/lib/Driver/ToolChains/Fuchsia.h --- a/clang/lib/Driver/ToolChains/Fuchsia.h +++ b/clang/lib/Driver/ToolChains/Fuchsia.h @@ -18,7 +18,7 @@ namespace driver { namespace tools { namespace fuchsia { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("fuchsia::Linker", "ld.lld", TC) {} @@ -35,7 +35,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY Fuchsia : public ToolChain { +class LLVM_LIBRARY_VISIBILITY Fuchsia final : public ToolChain { public: Fuchsia(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/Gnu.h b/clang/lib/Driver/ToolChains/Gnu.h --- a/clang/lib/Driver/ToolChains/Gnu.h +++ b/clang/lib/Driver/ToolChains/Gnu.h @@ -50,7 +50,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("GNU::Linker", "linker", TC) {} @@ -63,7 +63,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY StaticLibTool : public Tool { +class LLVM_LIBRARY_VISIBILITY StaticLibTool final : public Tool { public: StaticLibTool(const ToolChain &TC) : Tool("GNU::StaticLibTool", "static-lib-linker", TC) {} @@ -100,7 +100,7 @@ llvm::opt::ArgStringList &CmdArgs) const = 0; }; -class LLVM_LIBRARY_VISIBILITY Preprocessor : public Common { +class LLVM_LIBRARY_VISIBILITY Preprocessor final : public Common { public: Preprocessor(const ToolChain &TC) : Common("gcc::Preprocessor", "gcc preprocessor", TC) {} @@ -112,7 +112,7 @@ llvm::opt::ArgStringList &CmdArgs) const override; }; -class LLVM_LIBRARY_VISIBILITY Compiler : public Common { +class LLVM_LIBRARY_VISIBILITY Compiler final : public Common { public: Compiler(const ToolChain &TC) : Common("gcc::Compiler", "gcc frontend", TC) {} @@ -123,7 +123,7 @@ llvm::opt::ArgStringList &CmdArgs) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Common { +class LLVM_LIBRARY_VISIBILITY Linker final : public Common { public: Linker(const ToolChain &TC) : Common("gcc::Linker", "linker (via gcc)", TC) {} diff --git a/clang/lib/Driver/ToolChains/Hexagon.h b/clang/lib/Driver/ToolChains/Hexagon.h --- a/clang/lib/Driver/ToolChains/Hexagon.h +++ b/clang/lib/Driver/ToolChains/Hexagon.h @@ -20,7 +20,7 @@ // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile // and Compile. // We simply use "clang -cc1" for those actions. -class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: Assembler(const ToolChain &TC) : Tool("hexagon::Assembler", "hexagon-as", TC) {} @@ -35,7 +35,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("hexagon::Linker", "hexagon-ld", TC) {} @@ -58,7 +58,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY HexagonToolChain : public Linux { +class LLVM_LIBRARY_VISIBILITY HexagonToolChain final : public Linux { protected: GCCVersion GCCLibAndIncVersion; Tool *buildAssembler() const override; diff --git a/clang/lib/Driver/ToolChains/Hurd.h b/clang/lib/Driver/ToolChains/Hurd.h --- a/clang/lib/Driver/ToolChains/Hurd.h +++ b/clang/lib/Driver/ToolChains/Hurd.h @@ -16,7 +16,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY Hurd final : public Generic_ELF { public: Hurd(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/Lanai.h b/clang/lib/Driver/ToolChains/Lanai.h --- a/clang/lib/Driver/ToolChains/Lanai.h +++ b/clang/lib/Driver/ToolChains/Lanai.h @@ -16,7 +16,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY LanaiToolChain : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY LanaiToolChain final : public Generic_ELF { public: LanaiToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args) diff --git a/clang/lib/Driver/ToolChains/MSP430.h b/clang/lib/Driver/ToolChains/MSP430.h --- a/clang/lib/Driver/ToolChains/MSP430.h +++ b/clang/lib/Driver/ToolChains/MSP430.h @@ -25,7 +25,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY MSP430ToolChain : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY MSP430ToolChain final : public Generic_ELF { public: MSP430ToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); @@ -59,7 +59,7 @@ namespace tools { namespace msp430 { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("MSP430::Linker", "msp430-elf-ld", TC) {} bool hasIntegratedCPP() const override { return false; } diff --git a/clang/lib/Driver/ToolChains/MSVC.h b/clang/lib/Driver/ToolChains/MSVC.h --- a/clang/lib/Driver/ToolChains/MSVC.h +++ b/clang/lib/Driver/ToolChains/MSVC.h @@ -23,7 +23,7 @@ /// Visual studio tools. namespace visualstudio { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("visualstudio::Linker", "linker", TC) {} @@ -41,7 +41,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY MSVCToolChain : public ToolChain { +class LLVM_LIBRARY_VISIBILITY MSVCToolChain final : public ToolChain { public: MSVCToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/MinGW.h b/clang/lib/Driver/ToolChains/MinGW.h --- a/clang/lib/Driver/ToolChains/MinGW.h +++ b/clang/lib/Driver/ToolChains/MinGW.h @@ -22,7 +22,7 @@ /// MinGW -- Directly call GNU Binutils assembler and linker namespace MinGW { -class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: Assembler(const ToolChain &TC) : Tool("MinGW::Assemble", "assembler", TC) {} @@ -34,7 +34,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("MinGW::Linker", "linker", TC) {} @@ -55,7 +55,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY MinGW : public ToolChain { +class LLVM_LIBRARY_VISIBILITY MinGW final : public ToolChain { public: MinGW(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/NaCl.h b/clang/lib/Driver/ToolChains/NaCl.h --- a/clang/lib/Driver/ToolChains/NaCl.h +++ b/clang/lib/Driver/ToolChains/NaCl.h @@ -17,7 +17,7 @@ namespace driver { namespace tools { namespace nacltools { -class LLVM_LIBRARY_VISIBILITY AssemblerARM : public gnutools::Assembler { +class LLVM_LIBRARY_VISIBILITY AssemblerARM final : public gnutools::Assembler { public: AssemblerARM(const ToolChain &TC) : gnutools::Assembler(TC) {} @@ -27,7 +27,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("NaCl::Linker", "linker", TC) {} @@ -44,7 +44,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY NaClToolChain : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY NaClToolChain final : public Generic_ELF { public: NaClToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/OpenBSD.h b/clang/lib/Driver/ToolChains/OpenBSD.h --- a/clang/lib/Driver/ToolChains/OpenBSD.h +++ b/clang/lib/Driver/ToolChains/OpenBSD.h @@ -20,7 +20,7 @@ /// openbsd -- Directly call GNU Binutils assembler and linker namespace openbsd { -class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { +class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: Assembler(const ToolChain &TC) : Tool("openbsd::Assembler", "assembler", TC) {} @@ -33,7 +33,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("openbsd::Linker", "linker", TC) {} @@ -50,7 +50,7 @@ namespace toolchains { -class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY OpenBSD final : public Generic_ELF { public: OpenBSD(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Driver/ToolChains/PPCFreeBSD.h b/clang/lib/Driver/ToolChains/PPCFreeBSD.h --- a/clang/lib/Driver/ToolChains/PPCFreeBSD.h +++ b/clang/lib/Driver/ToolChains/PPCFreeBSD.h @@ -15,7 +15,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY PPCFreeBSDToolChain : public FreeBSD { +class LLVM_LIBRARY_VISIBILITY PPCFreeBSDToolChain final : public FreeBSD { public: PPCFreeBSDToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args) diff --git a/clang/lib/Driver/ToolChains/RISCVToolchain.h b/clang/lib/Driver/ToolChains/RISCVToolchain.h --- a/clang/lib/Driver/ToolChains/RISCVToolchain.h +++ b/clang/lib/Driver/ToolChains/RISCVToolchain.h @@ -16,7 +16,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY RISCVToolChain : public Generic_ELF { +class LLVM_LIBRARY_VISIBILITY RISCVToolChain final : public Generic_ELF { public: RISCVToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); @@ -46,7 +46,7 @@ namespace tools { namespace RISCV { -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("RISCV::Linker", "ld", TC) {} bool hasIntegratedCPP() const override { return false; } diff --git a/clang/lib/Driver/ToolChains/SPIRV.h b/clang/lib/Driver/ToolChains/SPIRV.h --- a/clang/lib/Driver/ToolChains/SPIRV.h +++ b/clang/lib/Driver/ToolChains/SPIRV.h @@ -25,7 +25,7 @@ const InputInfo &Input, const llvm::opt::ArgStringList &Args); -class LLVM_LIBRARY_VISIBILITY Translator : public Tool { +class LLVM_LIBRARY_VISIBILITY Translator final : public Tool { public: Translator(const ToolChain &TC) : Tool("SPIR-V::Translator", "llvm-spirv", TC) {} @@ -39,7 +39,7 @@ const char *LinkingOutput) const override; }; -class LLVM_LIBRARY_VISIBILITY Linker : public Tool { +class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: Linker(const ToolChain &TC) : Tool("SPIRV::Linker", "spirv-link", TC) {} bool hasIntegratedCPP() const override { return false; } diff --git a/clang/lib/Driver/ToolChains/VEToolchain.h b/clang/lib/Driver/ToolChains/VEToolchain.h --- a/clang/lib/Driver/ToolChains/VEToolchain.h +++ b/clang/lib/Driver/ToolChains/VEToolchain.h @@ -16,7 +16,7 @@ namespace driver { namespace toolchains { -class LLVM_LIBRARY_VISIBILITY VEToolChain : public Linux { +class LLVM_LIBRARY_VISIBILITY VEToolChain final : public Linux { public: VEToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/lib/Frontend/MultiplexConsumer.cpp @@ -81,7 +81,7 @@ // This ASTMutationListener forwards its notifications to a set of // child listeners. -class MultiplexASTMutationListener : public ASTMutationListener { +class MultiplexASTMutationListener final : public ASTMutationListener { public: // Does NOT take ownership of the elements in L. MultiplexASTMutationListener(ArrayRef L); diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -130,7 +130,7 @@ namespace clang { namespace sema { -class SemaPPCallbacks : public PPCallbacks { +class SemaPPCallbacks final : public PPCallbacks { Sema *S = nullptr; llvm::SmallVector IncludeStack; diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h @@ -24,7 +24,7 @@ namespace ento { namespace retaincountchecker { -class RefCountBug : public BugType { +class RefCountBug final : public BugType { public: enum RefCountBugKind { UseAfterRelease, diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h --- a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h @@ -26,7 +26,7 @@ class TargetLowering; class DataLayout; -class GISelKnownBits : public GISelChangeObserver { +class GISelKnownBits final : public GISelChangeObserver { MachineFunction &MF; MachineRegisterInfo &MRI; const TargetLowering &TL; diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h @@ -80,7 +80,7 @@ /// This implements the Apple accelerator table format, a precursor of the /// DWARF 5 accelerator table format. -class AppleAcceleratorTable : public DWARFAcceleratorTable { +class AppleAcceleratorTable final : public DWARFAcceleratorTable { struct Header { uint32_t Magic; uint16_t Version; @@ -228,7 +228,7 @@ /// The last segment consists of a list of entries, which is a 0-terminated list /// referenced by the name table and interpreted with the help of the /// abbreviation table. -class DWARFDebugNames : public DWARFAcceleratorTable { +class DWARFDebugNames final : public DWARFAcceleratorTable { public: class NameIndex; class NameIterator; @@ -323,7 +323,7 @@ /// Error returned by NameIndex::getEntry to report it has reached the end of /// the entry list. - class SentinelError : public ErrorInfo { + class SentinelError final : public ErrorInfo { public: static char ID; diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h @@ -44,7 +44,7 @@ /// DWARFContext /// This data structure is the top level entity that deals with dwarf debug /// information parsing. The actual data is supplied through DWARFObj. -class DWARFContext : public DIContext { +class DWARFContext final : public DIContext { DWARFUnitVector NormalUnits; Optional> NormalTypeUnits; std::unique_ptr CUIndex; diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h @@ -564,7 +564,7 @@ }; /// DWARF Common Information Entry (CIE) -class CIE : public FrameEntry { +class CIE final : public FrameEntry { public: // CIEs (and FDEs) are simply container classes, so the only sensible way to // create them is by providing the full parsed contents in the constructor. @@ -623,7 +623,7 @@ }; /// DWARF Frame Description Entry (FDE) -class FDE : public FrameEntry { +class FDE final : public FrameEntry { public: FDE(bool IsDWARF64, uint64_t Offset, uint64_t Length, uint64_t CIEPointer, uint64_t InitialLocation, uint64_t AddressRange, CIE *Cie, diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h @@ -146,7 +146,7 @@ uint16_t Version; }; -class ResolverError : public ErrorInfo { +class ResolverError final : public ErrorInfo { public: static char ID; diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h --- a/llvm/include/llvm/Object/COFF.h +++ b/llvm/include/llvm/Object/COFF.h @@ -785,7 +785,7 @@ support::ulittle16_t HashAlgorithm; }; -class COFFObjectFile : public ObjectFile { +class COFFObjectFile final : public ObjectFile { private: COFFObjectFile(MemoryBufferRef Object); diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -403,7 +403,7 @@ }; using fixup_iterator = content_iterator; -class MachOObjectFile : public ObjectFile { +class MachOObjectFile final : public ObjectFile { public: struct LoadCommandInfo { const char *Ptr; // Where in memory the load command is. diff --git a/llvm/include/llvm/Object/Wasm.h b/llvm/include/llvm/Object/Wasm.h --- a/llvm/include/llvm/Object/Wasm.h +++ b/llvm/include/llvm/Object/Wasm.h @@ -117,7 +117,7 @@ wasm::WasmDataSegment Data; }; -class WasmObjectFile : public ObjectFile { +class WasmObjectFile final : public ObjectFile { public: WasmObjectFile(MemoryBufferRef Object, Error &Err); diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h --- a/llvm/include/llvm/Object/XCOFFObjectFile.h +++ b/llvm/include/llvm/Object/XCOFFObjectFile.h @@ -470,7 +470,7 @@ class XCOFFSymbolRef; -class XCOFFObjectFile : public ObjectFile { +class XCOFFObjectFile final : public ObjectFile { private: const void *FileHeader = nullptr; const void *AuxiliaryHeader = nullptr; diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h --- a/llvm/include/llvm/ProfileData/InstrProfReader.h +++ b/llvm/include/llvm/ProfileData/InstrProfReader.h @@ -576,7 +576,7 @@ }; /// Reader for the indexed binary instrprof format. -class IndexedInstrProfReader : public InstrProfReader { +class IndexedInstrProfReader final : public InstrProfReader { private: /// The profile data file contents. std::unique_ptr DataBuffer; diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h --- a/llvm/include/llvm/Support/VirtualFileSystem.h +++ b/llvm/include/llvm/Support/VirtualFileSystem.h @@ -364,7 +364,7 @@ /// top-most (most recently added) directory are used. When there is a file /// that exists in more than one file system, the file in the top-most file /// system overrides the other(s). -class OverlayFileSystem : public FileSystem { +class OverlayFileSystem final : public FileSystem { using FileSystemList = SmallVector, 1>; /// The stack of file systems, implemented as a list in order of @@ -726,7 +726,7 @@ /// FIXME: 'use-external-name' causes behaviour that's inconsistent with how /// "real" filesystems behave. Maybe there should be a separate channel for /// this information. -class RedirectingFileSystem : public vfs::FileSystem { +class RedirectingFileSystem final : public vfs::FileSystem { public: enum EntryKind { EK_Directory, EK_DirectoryRemap, EK_File }; enum NameKind { NK_NotSet, NK_External, NK_Virtual }; @@ -759,7 +759,7 @@ }; /// A directory in the vfs with explicitly specified contents. - class DirectoryEntry : public Entry { + class DirectoryEntry final : public Entry { std::vector> Contents; Status S; @@ -828,7 +828,7 @@ /// A directory in the vfs that maps to a directory in the external file /// system. - class DirectoryRemapEntry : public RemapEntry { + class DirectoryRemapEntry final : public RemapEntry { public: DirectoryRemapEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName) @@ -840,7 +840,7 @@ }; /// A file in the vfs that maps to a file in the external file system. - class FileEntry : public RemapEntry { + class FileEntry final : public RemapEntry { public: FileEntry(StringRef Name, StringRef ExternalContentsPath, NameKind UseName) : RemapEntry(EK_File, Name, ExternalContentsPath, UseName) {} diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h --- a/llvm/include/llvm/TableGen/Record.h +++ b/llvm/include/llvm/TableGen/Record.h @@ -183,7 +183,7 @@ /// 'list' - Represent a list of element values, all of which must be of /// the specified type. The type is stored in ElementTy. -class ListRecTy : public RecTy { +class ListRecTy final : public RecTy { friend ListRecTy *RecTy::getListTy(); RecTy *ElementTy; @@ -575,7 +575,7 @@ }; /// '7' - Represent an initialization by a literal integer value. -class IntInit : public TypedInit { +class IntInit final : public TypedInit { int64_t Value; explicit IntInit(RecordKeeper &RK, int64_t V) @@ -605,7 +605,7 @@ }; /// "anonymous_n" - Represent an anonymous record name -class AnonymousNameInit : public TypedInit { +class AnonymousNameInit final : public TypedInit { unsigned Value; explicit AnonymousNameInit(RecordKeeper &RK, unsigned V) @@ -635,7 +635,7 @@ }; /// "foo" - Represent an initialization by a string value. -class StringInit : public TypedInit { +class StringInit final : public TypedInit { public: enum StringFormat { SF_String, // Format as "text" @@ -782,7 +782,7 @@ /// !op (X) - Transform an init. /// -class UnOpInit : public OpInit, public FoldingSetNode { +class UnOpInit final : public OpInit, public FoldingSetNode { public: enum UnaryOp : uint8_t { CAST, NOT, HEAD, TAIL, SIZE, EMPTY, GETDAGOP, LOG2 }; @@ -1152,7 +1152,7 @@ }; /// 'Opcode' - Represent a reference to an entire variable object. -class VarInit : public TypedInit { +class VarInit final : public TypedInit { Init *VarName; explicit VarInit(Init *VN, RecTy *T) @@ -1259,7 +1259,7 @@ }; /// AL - Represent a reference to a 'def' in the description -class DefInit : public TypedInit { +class DefInit final : public TypedInit { friend class Record; Record *Def; diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -620,7 +620,7 @@ virtual std::string toString(unsigned Indent) const = 0; }; -class InMemoryFile : public InMemoryNode { +class InMemoryFile final : public InMemoryNode { Status Stat; std::unique_ptr Buffer; @@ -722,7 +722,7 @@ }; } // namespace -class InMemoryDirectory : public InMemoryNode { +class InMemoryDirectory final : public InMemoryNode { Status Stat; llvm::StringMap> Entries; @@ -1066,7 +1066,7 @@ } /// Adaptor from InMemoryDir::iterator to directory_iterator. -class InMemoryFileSystem::DirIterator : public llvm::vfs::detail::DirIterImpl { +class InMemoryFileSystem::DirIterator final : public llvm::vfs::detail::DirIterImpl { const InMemoryFileSystem *FS; detail::InMemoryDirectory::const_iterator I; detail::InMemoryDirectory::const_iterator E; @@ -1231,7 +1231,7 @@ /// Directory iterator implementation for \c RedirectingFileSystem's /// directory entries. -class llvm::vfs::RedirectingFSDirIterImpl +class llvm::vfs::RedirectingFSDirIterImpl final : public llvm::vfs::detail::DirIterImpl { std::string Dir; RedirectingFileSystem::DirectoryEntry::iterator Current, End; diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.h b/llvm/lib/Target/AArch64/AArch64FrameLowering.h --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.h +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.h @@ -18,7 +18,7 @@ namespace llvm { -class AArch64FrameLowering : public TargetFrameLowering { +class AArch64FrameLowering final : public TargetFrameLowering { public: explicit AArch64FrameLowering() : TargetFrameLowering(StackGrowsDown, Align(16), 0, Align(16), diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.h b/llvm/lib/Target/AArch64/AArch64ISelLowering.h --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.h +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.h @@ -494,7 +494,7 @@ class AArch64Subtarget; -class AArch64TargetLowering : public TargetLowering { +class AArch64TargetLowering final : public TargetLowering { public: explicit AArch64TargetLowering(const TargetMachine &TM, const AArch64Subtarget &STI); diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h --- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h +++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h @@ -230,7 +230,7 @@ const MCSubtargetInfo &STI, raw_ostream &O); }; -class AArch64AppleInstPrinter : public AArch64InstPrinter { +class AArch64AppleInstPrinter final : public AArch64InstPrinter { public: AArch64AppleInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI); diff --git a/llvm/lib/Target/ARM/ARMISelLowering.h b/llvm/lib/Target/ARM/ARMISelLowering.h --- a/llvm/lib/Target/ARM/ARMISelLowering.h +++ b/llvm/lib/Target/ARM/ARMISelLowering.h @@ -387,7 +387,7 @@ //===--------------------------------------------------------------------===// // ARMTargetLowering - ARM Implementation of the TargetLowering interface - class ARMTargetLowering : public TargetLowering { + class ARMTargetLowering final : public TargetLowering { public: explicit ARMTargetLowering(const TargetMachine &TM, const ARMSubtarget &STI); diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h --- a/llvm/lib/Target/ARM/ARMSubtarget.h +++ b/llvm/lib/Target/ARM/ARMSubtarget.h @@ -44,7 +44,7 @@ class GlobalValue; class StringRef; -class ARMSubtarget : public ARMGenSubtargetInfo { +class ARMSubtarget final : public ARMGenSubtargetInfo { protected: enum ARMProcFamilyEnum { Others, diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.h b/llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.h --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.h +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.h @@ -18,7 +18,7 @@ namespace llvm { -class ARMInstPrinter : public MCInstPrinter { +class ARMInstPrinter final : public MCInstPrinter { public: ARMInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI); diff --git a/llvm/lib/Target/X86/X86FrameLowering.h b/llvm/lib/Target/X86/X86FrameLowering.h --- a/llvm/lib/Target/X86/X86FrameLowering.h +++ b/llvm/lib/Target/X86/X86FrameLowering.h @@ -25,7 +25,7 @@ class X86Subtarget; class X86RegisterInfo; -class X86FrameLowering : public TargetFrameLowering { +class X86FrameLowering final : public TargetFrameLowering { public: X86FrameLowering(const X86Subtarget &STI, MaybeAlign StackAlignOverride); diff --git a/llvm/utils/TableGen/DAGISelMatcher.h b/llvm/utils/TableGen/DAGISelMatcher.h --- a/llvm/utils/TableGen/DAGISelMatcher.h +++ b/llvm/utils/TableGen/DAGISelMatcher.h @@ -448,7 +448,7 @@ /// CheckOpcodeMatcher - This checks to see if the current node has the /// specified opcode, if not it fails to match. -class CheckOpcodeMatcher : public Matcher { +class CheckOpcodeMatcher final : public Matcher { const SDNodeInfo &Opcode; public: CheckOpcodeMatcher(const SDNodeInfo &opcode) @@ -494,7 +494,7 @@ /// CheckTypeMatcher - This checks to see if the current node has the /// specified type at the specified result, if not it fails to match. -class CheckTypeMatcher : public Matcher { +class CheckTypeMatcher final : public Matcher { MVT::SimpleValueType Type; unsigned ResNo; public: diff --git a/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h b/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h --- a/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h +++ b/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h @@ -80,7 +80,7 @@ #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) }; -class GIMatchDagOpcodePredicate : public GIMatchDagPredicate { +class GIMatchDagOpcodePredicate final : public GIMatchDagPredicate { const CodeGenInstruction &Instr; public: @@ -100,7 +100,7 @@ #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) }; -class GIMatchDagOneOfOpcodesPredicate : public GIMatchDagPredicate { +class GIMatchDagOneOfOpcodesPredicate final : public GIMatchDagPredicate { SmallVector Instrs; public: @@ -123,7 +123,7 @@ #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) }; -class GIMatchDagSameMOPredicate : public GIMatchDagPredicate { +class GIMatchDagSameMOPredicate final : public GIMatchDagPredicate { public: GIMatchDagSameMOPredicate(GIMatchDagContext &Ctx, StringRef Name); diff --git a/llvm/utils/TableGen/GlobalISel/GIMatchTree.h b/llvm/utils/TableGen/GlobalISel/GIMatchTree.h --- a/llvm/utils/TableGen/GlobalISel/GIMatchTree.h +++ b/llvm/utils/TableGen/GlobalISel/GIMatchTree.h @@ -553,7 +553,7 @@ /// result is that the cases that don't match the superset will match the /// subset rule, while the ones that do match the superset will match either /// (which one is algorithm dependent but will usually be the superset). -class GIMatchTreeOpcodePartitioner : public GIMatchTreePartitioner { +class GIMatchTreeOpcodePartitioner final : public GIMatchTreePartitioner { unsigned InstrID; DenseMap InstrToPartition; std::vector PartitionToInstr; @@ -582,7 +582,7 @@ StringRef Indent) const override; }; -class GIMatchTreeVRegDefPartitioner : public GIMatchTreePartitioner { +class GIMatchTreeVRegDefPartitioner final : public GIMatchTreePartitioner { unsigned NewInstrID = -1; unsigned InstrID; unsigned OpIdx;