mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Deprecate ID::Attrs(), replace with GetAttrs()
This commit is contained in:
parent
28b4206519
commit
2ebc20a164
3 changed files with 9 additions and 4 deletions
5
src/ID.h
5
src/ID.h
|
@ -102,6 +102,11 @@ public:
|
||||||
void AddAttrs(IntrusivePtr<Attributes> attr);
|
void AddAttrs(IntrusivePtr<Attributes> attr);
|
||||||
void RemoveAttr(attr_tag a);
|
void RemoveAttr(attr_tag a);
|
||||||
void UpdateValAttrs();
|
void UpdateValAttrs();
|
||||||
|
|
||||||
|
const IntrusivePtr<Attributes>& GetAttrs() const
|
||||||
|
{ return attrs; }
|
||||||
|
|
||||||
|
[[deprecated("Remove in 4.1. Use GetAttrs().")]]
|
||||||
Attributes* Attrs() const { return attrs.get(); }
|
Attributes* Attrs() const { return attrs.get(); }
|
||||||
|
|
||||||
Attr* FindAttr(attr_tag t) const;
|
Attr* FindAttr(attr_tag t) const;
|
||||||
|
|
|
@ -1664,7 +1664,7 @@ IntrusivePtr<Val> InitStmt::Exec(Frame* f, stmt_flow_type& flow) const
|
||||||
break;
|
break;
|
||||||
case TYPE_TABLE:
|
case TYPE_TABLE:
|
||||||
v = make_intrusive<TableVal>(cast_intrusive<TableType>(t),
|
v = make_intrusive<TableVal>(cast_intrusive<TableType>(t),
|
||||||
IntrusivePtr{NewRef{}, aggr->Attrs()});
|
aggr->GetAttrs());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -250,8 +250,8 @@ static void make_var(ID* id, IntrusivePtr<BroType> t, init_class c,
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( t->Tag() == TYPE_TABLE )
|
else if ( t->Tag() == TYPE_TABLE )
|
||||||
aggr = make_intrusive<TableVal>(IntrusivePtr{NewRef{}, t->AsTableType()},
|
aggr = make_intrusive<TableVal>(cast_intrusive<TableType>(t),
|
||||||
IntrusivePtr{NewRef{}, id->Attrs()});
|
id->GetAttrs());
|
||||||
|
|
||||||
else if ( t->Tag() == TYPE_VECTOR )
|
else if ( t->Tag() == TYPE_VECTOR )
|
||||||
aggr = make_intrusive<VectorVal>(cast_intrusive<VectorType>(t));
|
aggr = make_intrusive<VectorVal>(cast_intrusive<VectorType>(t));
|
||||||
|
@ -326,7 +326,7 @@ IntrusivePtr<Stmt> add_local(IntrusivePtr<ID> id, IntrusivePtr<BroType> t,
|
||||||
*init->GetLocationInfo() : no_location;
|
*init->GetLocationInfo() : no_location;
|
||||||
|
|
||||||
auto name_expr = make_intrusive<NameExpr>(id, dt == VAR_CONST);
|
auto name_expr = make_intrusive<NameExpr>(id, dt == VAR_CONST);
|
||||||
auto attrs = id->Attrs() ? id->Attrs()->Attrs() : nullptr;
|
auto attrs = id->GetAttrs() ? id->GetAttrs()->Attrs() : nullptr;
|
||||||
auto assign_expr = make_intrusive<AssignExpr>(std::move(name_expr),
|
auto assign_expr = make_intrusive<AssignExpr>(std::move(name_expr),
|
||||||
std::move(init), 0,
|
std::move(init), 0,
|
||||||
nullptr, attrs);
|
nullptr, attrs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue