mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
full tracking of the characteristics of globals when compiling scripts to C++
This commit is contained in:
parent
b25a844210
commit
bfc6508dff
6 changed files with 48 additions and 22 deletions
|
@ -135,12 +135,21 @@ void activate_bodies__CPP(const char* fn, const char* module, bool exported, Typ
|
|||
event_registry->Register(e);
|
||||
}
|
||||
|
||||
IDPtr lookup_global__CPP(const char* g, const TypePtr& t, bool exported) {
|
||||
IDPtr lookup_global__CPP(const char* g, const TypePtr& t, const GlobalCharacteristics& gc) {
|
||||
auto gl = lookup_ID(g, GLOBAL_MODULE_NAME, false, false, false);
|
||||
|
||||
if ( ! gl ) {
|
||||
gl = install_ID(g, GLOBAL_MODULE_NAME, true, exported);
|
||||
gl = install_ID(g, GLOBAL_MODULE_NAME, true, gc.is_exported);
|
||||
gl->SetType(t);
|
||||
|
||||
if ( gc.is_const )
|
||||
gl->SetConst();
|
||||
if ( gc.is_option )
|
||||
gl->SetOption();
|
||||
if ( gc.is_enum_const )
|
||||
gl->SetEnumConst();
|
||||
if ( gc.is_type )
|
||||
gl->MakeType();
|
||||
}
|
||||
|
||||
return gl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue