mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +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
|
@ -39,6 +39,12 @@ string scope_prefix(const string& scope) { return "zeek::detail::CPP_" + scope;
|
|||
string scope_prefix(int scope) { return scope_prefix(to_string(scope)); }
|
||||
|
||||
bool is_CPP_compilable(const ProfileFunc* pf, const char** reason) {
|
||||
if ( has_AST_node_unknown_to_script_opt(pf, false) ) {
|
||||
if ( reason )
|
||||
*reason = "unknown AST node type";
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( analysis_options.allow_cond )
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue