mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
AST profiles track the associated function/body/expression
This commit is contained in:
parent
8e1d770966
commit
f865897cac
2 changed files with 23 additions and 6 deletions
|
@ -60,12 +60,23 @@ p_hash_type script_specific_hash(const StmtPtr& body, p_hash_type generic_hash)
|
|||
|
||||
ProfileFunc::ProfileFunc(const Func* func, const StmtPtr& body, bool _abs_rec_fields)
|
||||
{
|
||||
profiled_func = func;
|
||||
profiled_body = body.get();
|
||||
abs_rec_fields = _abs_rec_fields;
|
||||
Profile(func->GetType().get(), body);
|
||||
}
|
||||
|
||||
ProfileFunc::ProfileFunc(const Stmt* s, bool _abs_rec_fields)
|
||||
{
|
||||
profiled_body = s;
|
||||
abs_rec_fields = _abs_rec_fields;
|
||||
s->Traverse(this);
|
||||
}
|
||||
|
||||
ProfileFunc::ProfileFunc(const Expr* e, bool _abs_rec_fields)
|
||||
{
|
||||
profiled_expr = e;
|
||||
|
||||
abs_rec_fields = _abs_rec_fields;
|
||||
|
||||
if ( e->Tag() == EXPR_LAMBDA )
|
||||
|
@ -84,12 +95,6 @@ ProfileFunc::ProfileFunc(const Expr* e, bool _abs_rec_fields)
|
|||
e->Traverse(this);
|
||||
}
|
||||
|
||||
ProfileFunc::ProfileFunc(const Stmt* s, bool _abs_rec_fields)
|
||||
{
|
||||
abs_rec_fields = _abs_rec_fields;
|
||||
s->Traverse(this);
|
||||
}
|
||||
|
||||
void ProfileFunc::Profile(const FuncType* ft, const StmtPtr& body)
|
||||
{
|
||||
num_params = ft->Params()->NumFields();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue