driver class for generating RDs across an AST, and logic to invoke it

This commit is contained in:
Vern Paxson 2021-01-23 10:54:43 -08:00
parent baab336d2e
commit 2f0d02c878
4 changed files with 1461 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#include "zeek/script_opt/ProfileFunc.h"
#include "zeek/script_opt/Inline.h"
#include "zeek/script_opt/Reduce.h"
#include "zeek/script_opt/GenRDs.h"
namespace zeek::detail {
@ -75,6 +76,10 @@ void optimize_func(ScriptFunc* f, ProfileFunc* pf, ScopePtr scope_ptr,
f->ReplaceBody(body, new_body);
body = new_body;
body->Traverse(pf);
RD_Decorate reduced_rds(pf);
reduced_rds.TraverseFunction(f, scope, body);
int new_frame_size =
scope->Length() + rc->NumTemps() + rc->NumNewLocals();