mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Stmt tag for compiled-to-C++; Inliner knows to avoid it
This commit is contained in:
parent
8d10fd32d0
commit
5efba9e115
3 changed files with 6 additions and 3 deletions
|
@ -34,6 +34,7 @@ const char* stmt_name(StmtTag t)
|
||||||
"<init>", "fallthrough", "while",
|
"<init>", "fallthrough", "while",
|
||||||
"catch-return",
|
"catch-return",
|
||||||
"check-any-length",
|
"check-any-length",
|
||||||
|
"compiled-C++",
|
||||||
"null",
|
"null",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ enum StmtTag {
|
||||||
STMT_WHILE,
|
STMT_WHILE,
|
||||||
STMT_CATCH_RETURN, // for reduced InlineExpr's
|
STMT_CATCH_RETURN, // for reduced InlineExpr's
|
||||||
STMT_CHECK_ANY_LEN, // internal reduced statement
|
STMT_CHECK_ANY_LEN, // internal reduced statement
|
||||||
|
STMT_CPP, // compiled C++
|
||||||
STMT_NULL
|
STMT_NULL
|
||||||
#define NUM_STMTS (int(STMT_NULL) + 1)
|
#define NUM_STMTS (int(STMT_NULL) + 1)
|
||||||
};
|
};
|
||||||
|
|
|
@ -109,8 +109,8 @@ void Inliner::Analyze()
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( auto& f : funcs )
|
for ( auto& f : funcs )
|
||||||
// Candidates are non-event, non-hook, non-recursive
|
// Candidates are non-event, non-hook, non-recursive,
|
||||||
// functions ... that don't use lambdas or when's,
|
// non-compiled functions ... that don't use lambdas or when's,
|
||||||
// since we don't currently compute the closures/frame
|
// since we don't currently compute the closures/frame
|
||||||
// sizes for them correctly, and more fundamentally since
|
// sizes for them correctly, and more fundamentally since
|
||||||
// we don't compile them and hence inlining them will
|
// we don't compile them and hence inlining them will
|
||||||
|
@ -118,7 +118,8 @@ void Inliner::Analyze()
|
||||||
if ( f.Func()->Flavor() == FUNC_FLAVOR_FUNCTION &&
|
if ( f.Func()->Flavor() == FUNC_FLAVOR_FUNCTION &&
|
||||||
non_recursive_funcs.count(f.Func()) > 0 &&
|
non_recursive_funcs.count(f.Func()) > 0 &&
|
||||||
f.Profile()->NumLambdas() == 0 &&
|
f.Profile()->NumLambdas() == 0 &&
|
||||||
f.Profile()->NumWhenStmts() == 0 )
|
f.Profile()->NumWhenStmts() == 0 &&
|
||||||
|
f.Body()->Tag() != STMT_CPP )
|
||||||
inline_ables.insert(f.Func());
|
inline_ables.insert(f.Func());
|
||||||
|
|
||||||
for ( auto& f : funcs )
|
for ( auto& f : funcs )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue