mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Attr: use class IntrusivePtr
This commit is contained in:
parent
097a362c80
commit
36a26a7b43
8 changed files with 62 additions and 61 deletions
12
src/ID.cc
12
src/ID.cc
|
@ -188,9 +188,9 @@ void ID::UpdateValAttrs()
|
|||
TypeDecl* fd = rt->FieldDecl(i);
|
||||
|
||||
if ( ! fd->attrs )
|
||||
fd->attrs = make_intrusive<Attributes>(new attr_list, rt->FieldType(i), true, IsGlobal());
|
||||
fd->attrs = make_intrusive<Attributes>(new attr_list, IntrusivePtr{NewRef{}, rt->FieldType(i)}, true, IsGlobal());
|
||||
|
||||
fd->attrs->AddAttr(new Attr(ATTR_LOG));
|
||||
fd->attrs->AddAttr(make_intrusive<Attr>(ATTR_LOG));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,13 +206,13 @@ bool ID::IsDeprecated() const
|
|||
return FindAttr(ATTR_DEPRECATED) != 0;
|
||||
}
|
||||
|
||||
void ID::MakeDeprecated(Expr* deprecation)
|
||||
void ID::MakeDeprecated(IntrusivePtr<Expr> deprecation)
|
||||
{
|
||||
if ( IsDeprecated() )
|
||||
return;
|
||||
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_DEPRECATED, deprecation)};
|
||||
AddAttrs(make_intrusive<Attributes>(attr, Type(), false, IsGlobal()));
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_DEPRECATED, std::move(deprecation))};
|
||||
AddAttrs(make_intrusive<Attributes>(attr, IntrusivePtr{NewRef{}, Type()}, false, IsGlobal()));
|
||||
}
|
||||
|
||||
string ID::GetDeprecationWarning() const
|
||||
|
@ -262,7 +262,7 @@ void ID::SetOption()
|
|||
if ( ! IsRedefinable() )
|
||||
{
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_REDEF)};
|
||||
AddAttrs(make_intrusive<Attributes>(attr, Type(), false, IsGlobal()));
|
||||
AddAttrs(make_intrusive<Attributes>(attr, IntrusivePtr{NewRef{}, Type()}, false, IsGlobal()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue