mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
fix for associating attributes with globals for -O gen-standalone-C++
This commit is contained in:
parent
b25a844210
commit
0e5042e451
3 changed files with 3 additions and 11 deletions
|
@ -225,10 +225,9 @@ void CPPCompile::InitializeGlobals() {
|
|||
|
||||
const auto& attrs = g->GetAttrs();
|
||||
if ( attrs ) {
|
||||
string attr_tags;
|
||||
string attr_vals;
|
||||
BuildAttrs(attrs, attr_tags, attr_vals);
|
||||
Emit("assign_attrs__CPP(%s, %s, %s);", globals[g->Name()], attr_tags, attr_vals);
|
||||
auto attrs_offset = AttributesOffset(attrs);
|
||||
auto attrs_str = "CPP__Attributes__[" + Fmt(attrs_offset) + "]";
|
||||
Emit("%s->SetAttrs(%s);", globals[g->Name()], attrs_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -239,10 +239,6 @@ TableValPtr table_constructor__CPP(vector<ValPtr> indices, vector<ValPtr> vals,
|
|||
return aggr;
|
||||
}
|
||||
|
||||
void assign_attrs__CPP(IDPtr id, IntVec attr_tags, ValVec attr_vals) {
|
||||
id->SetAttrs(build_attrs__CPP(std::move(attr_tags), std::move(attr_vals)));
|
||||
}
|
||||
|
||||
RecordValPtr record_constructor__CPP(vector<ValPtr> vals, RecordTypePtr t) {
|
||||
auto rv = make_intrusive<RecordVal>(t);
|
||||
auto n = vals.size();
|
||||
|
|
|
@ -229,9 +229,6 @@ extern TableValPtr set_constructor__CPP(ValVec elements, TableTypePtr t, IntVec
|
|||
extern TableValPtr table_constructor__CPP(ValVec indices, ValVec vals, TableTypePtr t, IntVec attr_tags,
|
||||
ValVec attr_vals);
|
||||
|
||||
// Assigns a set of attributes to an identifier.
|
||||
extern void assign_attrs__CPP(IDPtr id, IntVec attr_tags, ValVec attr_vals);
|
||||
|
||||
// Constructs a record of the given type, whose (ordered) fields are
|
||||
// assigned to the corresponding elements of the given vector of values.
|
||||
extern RecordValPtr record_constructor__CPP(ValVec vals, RecordTypePtr t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue