Script optimization maintenance and updates:

maintenance fixes for variadic run-time checks, '_' placeholder identifier
  "-O allow-cond" permits compiling scripts to C++ when influenced by @if conditionals
  more robust standalone compile-to-C++ properties
  fix for nested "when" statements
  test suite updates
This commit is contained in:
Vern Paxson 2022-11-08 11:56:32 -08:00
parent bc0284aefa
commit ee0a6f6835
40 changed files with 257 additions and 158 deletions

View file

@ -28,7 +28,7 @@ string Fmt(double d)
string scope_prefix(const string& scope)
{
return string("zeek::detail::CPP_") + scope + "::";
return "zeek::detail::CPP_" + scope;
}
string scope_prefix(int scope)
@ -38,6 +38,9 @@ string scope_prefix(int scope)
bool is_CPP_compilable(const ProfileFunc* pf, const char** reason)
{
if ( analysis_options.allow_cond )
return true;
auto body = pf->ProfiledBody();
if ( body && ! body->GetOptInfo()->is_free_of_conditionals )
{