mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
CPP code-gen: Mark child classes final, remove final from function defs
This commit is contained in:
parent
0e40f7e6af
commit
73adf2bf01
2 changed files with 6 additions and 6 deletions
|
@ -117,7 +117,7 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
|
|||
NL();
|
||||
Emit("static %s %s(%s);", yt_decl, fname, ParamDecl(ft, lambda_ids, pf));
|
||||
|
||||
Emit("class %s_cl : public CPPStmt", fname);
|
||||
Emit("class %s_cl final : public CPPStmt", fname);
|
||||
StartBlock();
|
||||
|
||||
Emit("public:");
|
||||
|
@ -151,7 +151,7 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
|
|||
if ( lambda_ids && lambda_ids->length() > 0 )
|
||||
Emit("%s_cl(const char* name) : CPPStmt(name, %s) { }", fname, loc_info);
|
||||
|
||||
Emit("ValPtr Exec(Frame* f, StmtFlowType& flow) override final");
|
||||
Emit("ValPtr Exec(Frame* f, StmtFlowType& flow) override");
|
||||
StartBlock();
|
||||
|
||||
Emit("flow = FLOW_RETURN;");
|
||||
|
@ -182,13 +182,13 @@ void CPPCompile::DeclareDynCPPStmt()
|
|||
Emit("// dispatch. All of this is ugly, and only needed because clang");
|
||||
Emit("// goes nuts (super slow) in the face of thousands of templates");
|
||||
Emit("// in a given context (initializers, or a function body).");
|
||||
Emit("class CPPDynStmt : public CPPStmt");
|
||||
Emit("class CPPDynStmt final : public CPPStmt");
|
||||
Emit("\t{");
|
||||
Emit("public:");
|
||||
Emit("\tCPPDynStmt(const char* _name, void* _func, int _type_signature, const char* filename, "
|
||||
"int line_num) : CPPStmt(_name, filename, line_num), "
|
||||
"func(_func), type_signature(_type_signature) { }");
|
||||
Emit("\tValPtr Exec(Frame* f, StmtFlowType& flow) override final;");
|
||||
Emit("\tValPtr Exec(Frame* f, StmtFlowType& flow) override;");
|
||||
Emit("private:");
|
||||
Emit("\t// The function to call in Exec().");
|
||||
Emit("\tvoid* func;");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue