AST profiling enhnacements in support of script optimization for lambdas/whens

This commit is contained in:
Vern Paxson 2023-06-16 15:50:00 -07:00 committed by Arne Welzel
parent 46983cfb2f
commit 110ba7a0a1
3 changed files with 63 additions and 32 deletions

View file

@ -420,9 +420,9 @@ void CPPCompile::GenWhenStmt(const WhenStmt* w)
NL();
Emit("std::vector<ValPtr> CPP__local_aggrs;");
for ( auto l : wi->WhenExprLocals() )
for ( auto& l : wi->WhenExprLocals() )
if ( IsAggr(l->GetType()) )
Emit("CPP__local_aggrs.emplace_back(%s);", IDNameStr(l));
Emit("CPP__local_aggrs.emplace_back(%s);", IDNameStr(l.get()));
Emit("CPP__wi->Instantiate(%s);", GenExpr(wi->Lambda(), GEN_NATIVE));