mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
ZAM optimization now removes hook calls to hooks without any bodies
This commit is contained in:
parent
a2a47ba334
commit
0fda589a19
3 changed files with 28 additions and 6 deletions
|
@ -119,7 +119,7 @@ StmtPtr ExprStmt::DoReduce(Reducer* c) {
|
|||
|
||||
auto t = e->Tag();
|
||||
|
||||
if ( t == EXPR_NOP )
|
||||
if ( t == EXPR_NOP || t == EXPR_CONST )
|
||||
return TransformMe(make_intrusive<NullStmt>(), c);
|
||||
|
||||
if ( c->Optimizing() ) {
|
||||
|
@ -138,10 +138,9 @@ StmtPtr ExprStmt::DoReduce(Reducer* c) {
|
|||
|
||||
StmtPtr red_e_stmt;
|
||||
|
||||
if ( t == EXPR_CALL )
|
||||
// A bare call. If we reduce it regularly, if
|
||||
// it has a non-void type it'll generate an
|
||||
// assignment to a temporary.
|
||||
if ( t == EXPR_CALL && ! e->WillTransform(c) )
|
||||
// A bare call. If we reduce it regularly, if it has a non-void
|
||||
// type it'll generate an assignment to a temporary.
|
||||
red_e_stmt = e->ReduceToSingletons(c);
|
||||
else {
|
||||
e = e->Reduce(c, red_e_stmt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue