From d7a616cb50895d63ee7d5fce2e4f9beaa3c027ab Mon Sep 17 00:00:00 2001 From: jiangkaiwen Date: Wed, 21 Sep 2022 17:00:06 +0800 Subject: [PATCH] fixed e4d9289 from https://gitee.com/jiangkaiwen678217/ark_ts2abc/pulls/528 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 c6144e2e6f..9478bef35b 100644 --- a/es2panda/es2panda.h +++ b/es2panda/es2panda.h @@ -163,7 +163,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 ed541f881c..19138ee7a6 100644 --- a/es2panda/parser/parserImpl.h +++ b/es2panda/parser/parserImpl.h @@ -281,7 +281,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