mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
skip optimization of functions with AST nodes unknown to script optimization
This commit is contained in:
parent
a2a47ba334
commit
35e157a0ab
7 changed files with 148 additions and 9 deletions
|
@ -101,7 +101,7 @@ ProfileFunc::ProfileFunc(const Expr* e, bool _abs_rec_fields) {
|
|||
}
|
||||
|
||||
TraversalCode ProfileFunc::PreStmt(const Stmt* s) {
|
||||
stmts.push_back(s);
|
||||
stmts.push_back({NewRef{}, const_cast<Stmt*>(s)});
|
||||
|
||||
switch ( s->Tag() ) {
|
||||
case STMT_INIT:
|
||||
|
@ -185,7 +185,7 @@ TraversalCode ProfileFunc::PreStmt(const Stmt* s) {
|
|||
}
|
||||
|
||||
TraversalCode ProfileFunc::PreExpr(const Expr* e) {
|
||||
exprs.push_back(e);
|
||||
exprs.push_back({NewRef{}, const_cast<Expr*>(e)});
|
||||
|
||||
TrackType(e->GetType());
|
||||
|
||||
|
@ -867,11 +867,11 @@ void ProfileFuncs::ComputeProfileHash(std::shared_ptr<ProfileFunc> pf) {
|
|||
h = merge_p_hashes(h, p_hash(ov[i]->Name()));
|
||||
|
||||
h = merge_p_hashes(h, p_hash("stmts"));
|
||||
for ( auto i : pf->Stmts() )
|
||||
for ( auto& i : pf->Stmts() )
|
||||
h = merge_p_hashes(h, p_hash(i->Tag()));
|
||||
|
||||
h = merge_p_hashes(h, p_hash("exprs"));
|
||||
for ( auto i : pf->Exprs() )
|
||||
for ( auto& i : pf->Exprs() )
|
||||
h = merge_p_hashes(h, p_hash(i->Tag()));
|
||||
|
||||
h = merge_p_hashes(h, p_hash("ids"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue