Stmt tag for compiled-to-C++; Inliner knows to avoid it

This commit is contained in:
Vern Paxson 2021-04-19 16:12:15 -07:00
parent 8d10fd32d0
commit 5efba9e115
3 changed files with 6 additions and 3 deletions

View file

@ -34,6 +34,7 @@ const char* stmt_name(StmtTag t)
"<init>", "fallthrough", "while",
"catch-return",
"check-any-length",
"compiled-C++",
"null",
};

View file

@ -20,6 +20,7 @@ enum StmtTag {
STMT_WHILE,
STMT_CATCH_RETURN, // for reduced InlineExpr's
STMT_CHECK_ANY_LEN, // internal reduced statement
STMT_CPP, // compiled C++
STMT_NULL
#define NUM_STMTS (int(STMT_NULL) + 1)
};

View file

@ -109,8 +109,8 @@ void Inliner::Analyze()
}
for ( auto& f : funcs )
// Candidates are non-event, non-hook, non-recursive
// functions ... that don't use lambdas or when's,
// Candidates are non-event, non-hook, non-recursive,
// non-compiled functions ... that don't use lambdas or when's,
// since we don't currently compute the closures/frame
// sizes for them correctly, and more fundamentally since
// we don't compile them and hence inlining them will
@ -118,7 +118,8 @@ void Inliner::Analyze()
if ( f.Func()->Flavor() == FUNC_FLAVOR_FUNCTION &&
non_recursive_funcs.count(f.Func()) > 0 &&
f.Profile()->NumLambdas() == 0 &&
f.Profile()->NumWhenStmts() == 0 )
f.Profile()->NumWhenStmts() == 0 &&
f.Body()->Tag() != STMT_CPP )
inline_ables.insert(f.Func());
for ( auto& f : funcs )