From e4d928925c898e7afc5e09a10b0f096b43b9650e Mon Sep 17 00:00:00 2001 From: jiangkaiwen Date: Wed, 21 Sep 2022 17:00:06 +0800 Subject: [PATCH] Fix codecheck warnings of the 0913 branch 1. Override modifies virtual functions 2. The function declaration is consistent with the defined parameters 3. Single parameter constructors are declared explicit Issue:I5S8D8 Signed-off-by: jiangkaiwen Change-Id: If3ee58975f9c28045cc8603d72a7939bad857b40 --- es2panda/compiler/core/compileQueue.h | 10 +++++----- es2panda/es2panda.h | 2 +- es2panda/parser/parserImpl.h | 2 +- es2panda/util/symbolTable.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/es2panda/compiler/core/compileQueue.h b/es2panda/compiler/core/compileQueue.h index 17392fe4a0..fe1f0da290 100644 --- a/es2panda/compiler/core/compileQueue.h +++ b/es2panda/compiler/core/compileQueue.h @@ -55,7 +55,7 @@ public: explicit CompileFunctionJob(CompilerContext *context) : context_(context) {}; NO_COPY_SEMANTIC(CompileFunctionJob); NO_MOVE_SEMANTIC(CompileFunctionJob); - ~CompileFunctionJob() = default; + ~CompileFunctionJob() override = default; binder::FunctionScope *Scope() const { @@ -79,7 +79,7 @@ public: explicit CompileModuleRecordJob(CompilerContext *context) : context_(context) {}; NO_COPY_SEMANTIC(CompileModuleRecordJob); NO_MOVE_SEMANTIC(CompileModuleRecordJob); - ~CompileModuleRecordJob() = default; + ~CompileModuleRecordJob() override = default; void Run() override; @@ -95,7 +95,7 @@ public: : src_(src), options_(options), progsInfo_(progsInfo), symbolTable_(symbolTable), allocator_(allocator) {}; NO_COPY_SEMANTIC(CompileFileJob); NO_MOVE_SEMANTIC(CompileFileJob); - ~CompileFileJob() = default; + ~CompileFileJob() override = default; void Run() override; @@ -140,7 +140,7 @@ public: NO_COPY_SEMANTIC(CompileFuncQueue); NO_MOVE_SEMANTIC(CompileFuncQueue); - ~CompileFuncQueue() = default; + ~CompileFuncQueue() override = default; void Schedule() override; @@ -158,7 +158,7 @@ public: NO_COPY_SEMANTIC(CompileFileQueue); NO_MOVE_SEMANTIC(CompileFileQueue); - ~CompileFileQueue() = default; + ~CompileFileQueue() override = default; void Schedule() override; diff --git a/es2panda/es2panda.h b/es2panda/es2panda.h index ef72517fc3..70e5524b77 100644 --- a/es2panda/es2panda.h +++ b/es2panda/es2panda.h @@ -165,7 +165,7 @@ public: panda::pandasm::Program *Compile(const SourceFile &input, const CompilerOptions &options, util::SymbolTable *symbolTable = nullptr); - panda::pandasm::Program *CompileFile(CompilerOptions &options, SourceFile *src, util::SymbolTable *symbolTable_); + panda::pandasm::Program *CompileFile(CompilerOptions &options, SourceFile *src, util::SymbolTable *symbolTable); static int CompileFiles(CompilerOptions &options, std::map *cacheProgs, diff --git a/es2panda/parser/parserImpl.h b/es2panda/parser/parserImpl.h index 974a6a0baa..ff4a6e6653 100644 --- a/es2panda/parser/parserImpl.h +++ b/es2panda/parser/parserImpl.h @@ -282,7 +282,7 @@ private: ir::Statement *ParseClassProperty(ClassElmentDescriptor *desc, const ArenaVector &properties, ir::Expression *propName, ir::Expression *typeAnnotation, ArenaVector &&decorators, bool isDeclare); - void ParseClassKeyModifiers(ClassElmentDescriptor *descy); + void ParseClassKeyModifiers(ClassElmentDescriptor *desc); void CheckClassGeneratorMethod(ClassElmentDescriptor *desc); void CheckClassPrivateIdentifier(ClassElmentDescriptor *desc); ir::Expression *ParseClassKeyAnnotation(); diff --git a/es2panda/util/symbolTable.h b/es2panda/util/symbolTable.h index 518a1c7142..892a31ad4e 100644 --- a/es2panda/util/symbolTable.h +++ b/es2panda/util/symbolTable.h @@ -33,8 +33,8 @@ public: ArenaMap> lexenv; // lexenv: > ArenaMap classHash; - OriginFunctionInfo(ArenaAllocator *allocator) : lexenv(allocator->Adapter()), - classHash(allocator->Adapter()) {} + explicit OriginFunctionInfo(ArenaAllocator *allocator) : lexenv(allocator->Adapter()), + classHash(allocator->Adapter()) {} }; SymbolTable(const std::string &inputSymbolTable, const std::string &dumpSymbolTable) -- Gitee