[clang] d5360b9 - [clang][Interp][NFC] Make classes final that can be final
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 29 03:51:38 PDT 2022
Author: Timm Bäder
Date: 2022-09-29T12:50:56+02:00
New Revision: d5360b932ecd6fc7ca45f89d7c87ffb39f7edfe2
URL: https://github.com/llvm/llvm-project/commit/d5360b932ecd6fc7ca45f89d7c87ffb39f7edfe2
DIFF: https://github.com/llvm/llvm-project/commit/d5360b932ecd6fc7ca45f89d7c87ffb39f7edfe2.diff
LOG: [clang][Interp][NFC] Make classes final that can be final
Added:
Modified:
clang/lib/AST/Interp/Boolean.h
clang/lib/AST/Interp/ByteCodeStmtGen.h
clang/lib/AST/Interp/Context.h
clang/lib/AST/Interp/Descriptor.h
clang/lib/AST/Interp/Function.h
clang/lib/AST/Interp/Integral.h
clang/lib/AST/Interp/InterpBlock.h
clang/lib/AST/Interp/Program.h
clang/lib/AST/Interp/Record.h
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/Boolean.h b/clang/lib/AST/Interp/Boolean.h
index f1a0b9007df8..20831fff9ade 100644
--- a/clang/lib/AST/Interp/Boolean.h
+++ b/clang/lib/AST/Interp/Boolean.h
@@ -22,7 +22,7 @@ namespace clang {
namespace interp {
/// Wrapper around boolean types.
-class Boolean {
+class Boolean final {
private:
/// Underlying boolean.
bool V;
diff --git a/clang/lib/AST/Interp/ByteCodeStmtGen.h b/clang/lib/AST/Interp/ByteCodeStmtGen.h
index 3bc665b84b4d..3a9a74038ee3 100644
--- a/clang/lib/AST/Interp/ByteCodeStmtGen.h
+++ b/clang/lib/AST/Interp/ByteCodeStmtGen.h
@@ -33,7 +33,7 @@ template <class Emitter> class LabelScope;
/// Compilation context for statements.
template <class Emitter>
-class ByteCodeStmtGen : public ByteCodeExprGen<Emitter> {
+class ByteCodeStmtGen final : public ByteCodeExprGen<Emitter> {
using LabelTy = typename Emitter::LabelTy;
using AddrTy = typename Emitter::AddrTy;
using OptLabelTy = llvm::Optional<LabelTy>;
diff --git a/clang/lib/AST/Interp/Context.h b/clang/lib/AST/Interp/Context.h
index fbd781026850..96e93dbfc48b 100644
--- a/clang/lib/AST/Interp/Context.h
+++ b/clang/lib/AST/Interp/Context.h
@@ -33,7 +33,7 @@ class State;
enum PrimType : unsigned;
/// Holds all information required to evaluate constexpr code in a module.
-class Context {
+class Context final {
public:
/// Initialises the constexpr VM.
Context(ASTContext &Ctx);
diff --git a/clang/lib/AST/Interp/Descriptor.h b/clang/lib/AST/Interp/Descriptor.h
index 11072cab3e90..823ecd144e7c 100644
--- a/clang/lib/AST/Interp/Descriptor.h
+++ b/clang/lib/AST/Interp/Descriptor.h
@@ -48,7 +48,7 @@ using BlockMoveFn = void (*)(Block *Storage, char *SrcFieldPtr,
using InterpSize = unsigned;
/// Describes a memory block created by an allocation site.
-struct Descriptor {
+struct Descriptor final {
private:
/// Original declaration, used to emit the error message.
const DeclTy Source;
diff --git a/clang/lib/AST/Interp/Function.h b/clang/lib/AST/Interp/Function.h
index d52560eaceb2..cd8b6d86eaed 100644
--- a/clang/lib/AST/Interp/Function.h
+++ b/clang/lib/AST/Interp/Function.h
@@ -29,7 +29,7 @@ enum PrimType : uint32_t;
/// Describes a scope block.
///
/// The block gathers all the descriptors of the locals defined in this block.
-class Scope {
+class Scope final {
public:
/// Information about a local's storage.
struct Local {
@@ -56,7 +56,7 @@ class Scope {
///
/// Contains links to the bytecode of the function, as well as metadata
/// describing all arguments and stack-local variables.
-class Function {
+class Function final {
public:
using ParamDescriptor = std::pair<PrimType, Descriptor *>;
diff --git a/clang/lib/AST/Interp/Integral.h b/clang/lib/AST/Interp/Integral.h
index d2498fda6181..50c9d7b6cc86 100644
--- a/clang/lib/AST/Interp/Integral.h
+++ b/clang/lib/AST/Interp/Integral.h
@@ -53,7 +53,7 @@ template <> struct Repr<64, true> { using Type = int64_t; };
/// These wrappers are required to shared an interface between APSint and
/// builtin primitive numeral types, while optimising for storage and
/// allowing methods operating on primitive type to compile to fast code.
-template <unsigned Bits, bool Signed> class Integral {
+template <unsigned Bits, bool Signed> class Integral final {
private:
template <unsigned OtherBits, bool OtherSigned> friend class Integral;
diff --git a/clang/lib/AST/Interp/InterpBlock.h b/clang/lib/AST/Interp/InterpBlock.h
index 2d5386e60b8c..e4e693dab093 100644
--- a/clang/lib/AST/Interp/InterpBlock.h
+++ b/clang/lib/AST/Interp/InterpBlock.h
@@ -32,7 +32,7 @@ enum PrimType : unsigned;
/// A memory block, either on the stack or in the heap.
///
/// The storage described by the block immediately follows it in memory.
-class Block {
+class Block final {
public:
// Creates a new block.
Block(const llvm::Optional<unsigned> &DeclID, Descriptor *Desc,
@@ -107,7 +107,7 @@ class Block {
///
/// Dead blocks are chained in a double-linked list to deallocate them
/// whenever pointers become dead.
-class DeadBlock {
+class DeadBlock final {
public:
/// Copies the block.
DeadBlock(DeadBlock *&Root, Block *Blk);
diff --git a/clang/lib/AST/Interp/Program.h b/clang/lib/AST/Interp/Program.h
index b711bd278bc1..4807b752deed 100644
--- a/clang/lib/AST/Interp/Program.h
+++ b/clang/lib/AST/Interp/Program.h
@@ -37,7 +37,7 @@ class Context;
class Record;
/// The program contains and links the bytecode for all functions.
-class Program {
+class Program final {
public:
Program(Context &Ctx) : Ctx(Ctx) {}
diff --git a/clang/lib/AST/Interp/Record.h b/clang/lib/AST/Interp/Record.h
index 117dd2b32d58..c59adef1e73d 100644
--- a/clang/lib/AST/Interp/Record.h
+++ b/clang/lib/AST/Interp/Record.h
@@ -21,7 +21,7 @@ namespace interp {
class Program;
/// Structure/Class descriptor.
-class Record {
+class Record final {
public:
/// Describes a record field.
struct Field {
More information about the cfe-commits
mailing list