support for profiling function bodies w/o needing accompanying ScriptFunc object

This commit is contained in:
Vern Paxson 2021-05-30 17:44:24 -07:00
parent 6a0bee1108
commit 9900a3468c
2 changed files with 12 additions and 5 deletions

View file

@ -85,6 +85,12 @@ 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();