mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
addressed some nits re "-O gen-C++" script optimization
This commit is contained in:
parent
6af0014a7b
commit
4928e074d4
3 changed files with 5 additions and 7 deletions
|
@ -830,7 +830,7 @@ private:
|
||||||
|
|
||||||
// If "all_deep" is true, it means make all of the captures
|
// If "all_deep" is true, it means make all of the captures
|
||||||
// deep copies, not just the ones that were explicitly marked
|
// deep copies, not just the ones that were explicitly marked
|
||||||
// as deep copies. That functionality is used to supporting
|
// as deep copies. That functionality is used to support
|
||||||
// Clone() methods; it's not needed when creating a new lambda
|
// Clone() methods; it's not needed when creating a new lambda
|
||||||
// instance.
|
// instance.
|
||||||
std::string GenLambdaClone(const LambdaExpr* l, bool all_deep);
|
std::string GenLambdaClone(const LambdaExpr* l, bool all_deep);
|
||||||
|
@ -928,7 +928,7 @@ private:
|
||||||
// an IntrusivePtr to such a type.
|
// an IntrusivePtr to such a type.
|
||||||
const char* IntrusiveVal(const TypePtr& t);
|
const char* IntrusiveVal(const TypePtr& t);
|
||||||
|
|
||||||
// Maps types to indices in the global "types__CPP" array.
|
// Maps types to indices in the global "CPP__Type__" array.
|
||||||
CPPTracker<Type> types = {"types", true};
|
CPPTracker<Type> types = {"types", true};
|
||||||
|
|
||||||
// Used to prevent analysis of mutually-referring types from
|
// Used to prevent analysis of mutually-referring types from
|
||||||
|
|
|
@ -124,8 +124,6 @@ void CPPCompile::Compile(bool report_uncompilable)
|
||||||
types.AddKey(tp, pfs.HashType(t));
|
types.AddKey(tp, pfs.HashType(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
Emit("TypePtr types__CPP[%s];", Fmt(static_cast<int>(types.DistinctKeys().size())));
|
|
||||||
|
|
||||||
NL();
|
NL();
|
||||||
|
|
||||||
for ( auto& g : pfs.AllGlobals() )
|
for ( auto& g : pfs.AllGlobals() )
|
||||||
|
|
|
@ -89,6 +89,9 @@ void CPPCompile::GenStmt(const Stmt* s)
|
||||||
Emit("return false;");
|
Emit("return false;");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case STMT_FALLTHROUGH:
|
||||||
|
break;
|
||||||
|
|
||||||
case STMT_PRINT:
|
case STMT_PRINT:
|
||||||
{
|
{
|
||||||
auto el = static_cast<const ExprListStmt*>(s)->ExprList();
|
auto el = static_cast<const ExprListStmt*>(s)->ExprList();
|
||||||
|
@ -96,9 +99,6 @@ void CPPCompile::GenStmt(const Stmt* s)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STMT_FALLTHROUGH:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
reporter->InternalError("bad statement type in CPPCompile::GenStmt");
|
reporter->InternalError("bad statement type in CPPCompile::GenStmt");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue