mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
changed function_ingredients struct to FunctionIngredients class with accessors
This commit is contained in:
parent
5718046b96
commit
0c434ca4f8
11 changed files with 63 additions and 53 deletions
|
@ -29,8 +29,8 @@ void CPPCompile::DeclareLambda(const LambdaExpr* l, const ProfileFunc* pf)
|
|||
ASSERT(is_CPP_compilable(pf));
|
||||
|
||||
auto lname = Canonicalize(l->Name().c_str()) + "_lb";
|
||||
auto body = l->Ingredients().body;
|
||||
auto l_id = l->Ingredients().id;
|
||||
auto body = l->Ingredients().Body();
|
||||
auto l_id = l->Ingredients().GetID();
|
||||
auto& ids = l->OuterIDs();
|
||||
|
||||
for ( auto id : ids )
|
||||
|
|
|
@ -150,7 +150,7 @@ void CPPCompile::Compile(bool report_uncompilable)
|
|||
for ( const auto& l : pfs.Lambdas() )
|
||||
{
|
||||
const auto& n = l->Name();
|
||||
const auto body = l->Ingredients().body.get();
|
||||
const auto body = l->Ingredients().Body().get();
|
||||
if ( lambda_ASTs.count(n) > 0 )
|
||||
// Reuse previous body.
|
||||
body_names[body] = body_names[lambda_ASTs[n]];
|
||||
|
@ -176,7 +176,7 @@ void CPPCompile::Compile(bool report_uncompilable)
|
|||
continue;
|
||||
|
||||
CompileLambda(l, pfs.ExprProf(l).get());
|
||||
lambda_ASTs[n] = l->Ingredients().body.get();
|
||||
lambda_ASTs[n] = l->Ingredients().Body().get();
|
||||
}
|
||||
|
||||
NL();
|
||||
|
|
|
@ -23,8 +23,8 @@ void CPPCompile::CompileFunc(const FuncInfo& func)
|
|||
void CPPCompile::CompileLambda(const LambdaExpr* l, const ProfileFunc* pf)
|
||||
{
|
||||
auto lname = Canonicalize(l->Name().c_str()) + "_lb";
|
||||
auto body = l->Ingredients().body;
|
||||
auto l_id = l->Ingredients().id;
|
||||
auto body = l->Ingredients().Body();
|
||||
auto l_id = l->Ingredients().GetID();
|
||||
auto& ids = l->OuterIDs();
|
||||
|
||||
DefineBody(l_id->GetType<FuncType>(), pf, lname, body, &ids, FUNC_FLAVOR_FUNCTION);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue