mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Add Attributes ctor that takes IntrusivePtrs
This commit is contained in:
parent
102e58b80b
commit
ccd1cbbc54
6 changed files with 87 additions and 14 deletions
10
src/ID.cc
10
src/ID.cc
|
@ -258,7 +258,7 @@ void ID::UpdateValAttrs()
|
|||
TypeDecl* fd = rt->FieldDecl(i);
|
||||
|
||||
if ( ! fd->attrs )
|
||||
fd->attrs = make_intrusive<Attributes>(new attr_list, rt->GetFieldType(i), true, IsGlobal());
|
||||
fd->attrs = make_intrusive<Attributes>(rt->GetFieldType(i), true, IsGlobal());
|
||||
|
||||
fd->attrs->AddAttr(make_intrusive<Attr>(ATTR_LOG));
|
||||
}
|
||||
|
@ -281,8 +281,8 @@ void ID::MakeDeprecated(IntrusivePtr<Expr> deprecation)
|
|||
if ( IsDeprecated() )
|
||||
return;
|
||||
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_DEPRECATED, std::move(deprecation))};
|
||||
AddAttrs(make_intrusive<Attributes>(attr, GetType(), false, IsGlobal()));
|
||||
std::vector<IntrusivePtr<Attr>> attrv{make_intrusive<Attr>(ATTR_DEPRECATED, std::move(deprecation))};
|
||||
AddAttrs(make_intrusive<Attributes>(std::move(attrv), GetType(), false, IsGlobal()));
|
||||
}
|
||||
|
||||
std::string ID::GetDeprecationWarning() const
|
||||
|
@ -331,8 +331,8 @@ void ID::SetOption()
|
|||
// option implied redefinable
|
||||
if ( ! IsRedefinable() )
|
||||
{
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_REDEF)};
|
||||
AddAttrs(make_intrusive<Attributes>(attr, GetType(), false, IsGlobal()));
|
||||
std::vector<IntrusivePtr<Attr>> attrv{make_intrusive<Attr>(ATTR_REDEF)};
|
||||
AddAttrs(make_intrusive<Attributes>(std::move(attrv), GetType(), false, IsGlobal()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue