mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +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
|
@ -390,8 +390,12 @@ GlobalInitInfo::GlobalInitInfo(CPPCompile* c, IDPtr g, string _CPP_name)
|
|||
else
|
||||
attrs = -1;
|
||||
|
||||
is_exported = g->IsExport();
|
||||
is_option = g->IsOption();
|
||||
gc.is_exported = g->IsExport();
|
||||
gc.is_const = g->IsConst();
|
||||
gc.is_option = g->IsOption();
|
||||
gc.is_enum_const = g->IsEnumConst();
|
||||
gc.is_type = g->IsType();
|
||||
|
||||
val = ValElem(c, nullptr); // empty because we initialize dynamically
|
||||
|
||||
if ( gt->Tag() == TYPE_FUNC && (! g->GetVal() || g->GetVal()->AsFunc()->GetKind() == Func::BUILTIN_FUNC) )
|
||||
|
@ -407,8 +411,11 @@ void GlobalInitInfo::InitializerVals(std::vector<std::string>& ivs) const {
|
|||
ivs.push_back(Fmt(type));
|
||||
ivs.push_back(Fmt(attrs));
|
||||
ivs.push_back(val);
|
||||
ivs.push_back(Fmt(is_exported));
|
||||
ivs.push_back(Fmt(is_option));
|
||||
ivs.push_back(Fmt(gc.is_exported));
|
||||
ivs.push_back(Fmt(gc.is_const));
|
||||
ivs.push_back(Fmt(gc.is_option));
|
||||
ivs.push_back(Fmt(gc.is_enum_const));
|
||||
ivs.push_back(Fmt(gc.is_type));
|
||||
ivs.push_back(Fmt(func_with_no_val));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue