mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
restored support for incremental compilation of scripts to C++
This commit is contained in:
parent
3b3cea799b
commit
2f7137999f
11 changed files with 37 additions and 56 deletions
|
@ -350,17 +350,8 @@ static void report_CPP()
|
|||
auto name = f.Func()->Name();
|
||||
auto hash = f.Profile()->HashVal();
|
||||
bool have = compiled_scripts.count(hash) > 0;
|
||||
auto specific = "";
|
||||
|
||||
if ( ! have )
|
||||
{
|
||||
hash = script_specific_hash(f.Body(), hash);
|
||||
have = compiled_scripts.count(hash) > 0;
|
||||
if ( have )
|
||||
specific = " - specific";
|
||||
}
|
||||
|
||||
printf("script function %s (hash %llu%s): %s\n", name, hash, specific, have ? "yes" : "no");
|
||||
printf("script function %s (hash %llu): %s\n", name, hash, have ? "yes" : "no");
|
||||
|
||||
if ( have )
|
||||
already_reported.insert(hash);
|
||||
|
@ -387,12 +378,6 @@ static void use_CPP()
|
|||
auto hash = f.Profile()->HashVal();
|
||||
auto s = compiled_scripts.find(hash);
|
||||
|
||||
if ( s == compiled_scripts.end() )
|
||||
{ // Look for script-specific body.
|
||||
hash = script_specific_hash(f.Body(), hash);
|
||||
s = compiled_scripts.find(hash);
|
||||
}
|
||||
|
||||
if ( s != compiled_scripts.end() )
|
||||
{
|
||||
auto b = s->second.body;
|
||||
|
@ -418,6 +403,10 @@ static void use_CPP()
|
|||
auto h = event_registry->Register(e);
|
||||
h->SetUsed();
|
||||
}
|
||||
|
||||
auto finish = s->second.finish_init_func;
|
||||
if ( finish )
|
||||
(*finish)();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue