mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
support for profiling function bodies w/o needing accompanying ScriptFunc object
This commit is contained in:
parent
6a0bee1108
commit
9900a3468c
2 changed files with 12 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -86,11 +86,12 @@ public:
|
|||
// function and one of its bodies.
|
||||
ProfileFunc(const Func* func, const StmtPtr& body, bool abs_rec_fields);
|
||||
|
||||
// Constructor for profiling an AST expression. This exists
|
||||
// to support (1) profiling lambda expressions, and (2) traversing
|
||||
// attribute expressions (such as &default=expr) to discover what
|
||||
// components they include.
|
||||
ProfileFunc(const Expr* func, bool abs_rec_fields);
|
||||
// Constructors for profiling an AST statement expression. These exist
|
||||
// to support (1) profiling lambda expressions and loop bodies, and
|
||||
// (2) traversing attribute expressions (such as &default=expr)
|
||||
// to discover what components they include.
|
||||
ProfileFunc(const Stmt* body, bool abs_rec_fields = false);
|
||||
ProfileFunc(const Expr* func, bool abs_rec_fields = false);
|
||||
|
||||
// See the comments for the associated member variables for each
|
||||
// of these accessors.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue