restructured tracking of initializations of globals for script compilation

This commit is contained in:
Vern Paxson 2022-09-29 15:08:53 -07:00
parent 0d5c669c1c
commit 1af905a14f
5 changed files with 80 additions and 32 deletions

View file

@ -102,7 +102,6 @@
#include "zeek/zeekygen/Manager.h"
#include "zeek/module_util.h"
#include "zeek/IntrusivePtr.h"
#include "zeek/script_opt/IDOptInfo.h"
extern const char* filename; // Absolute path of file currently being parsed.
extern const char* last_filename; // Absolute path of last file parsed.
@ -321,8 +320,6 @@ static void build_global(ID* id, Type* t, InitClass ic, Expr* e,
add_global(id_ptr, std::move(t_ptr), ic, e_ptr, std::move(attrs_ptr), dt);
id->GetOptInfo()->AddInitExpr(e_ptr);
if ( dt == VAR_REDEF )
zeekygen_mgr->Redef(id, ::filename, ic, std::move(e_ptr));
else
@ -342,8 +339,6 @@ static StmtPtr build_local(ID* id, Type* t, InitClass ic, Expr* e,
auto init = add_local(std::move(id_ptr), std::move(t_ptr), ic,
e_ptr, std::move(attrs_ptr), dt);
id->GetOptInfo()->AddInitExpr(std::move(e_ptr));
if ( do_coverage )
script_coverage_mgr.AddStmt(init.get());