Change Attributes to store std:vector<IntrusivePtr<Attr>>

This also changes the return type of Attributes::Attrs() from attr_list*
This commit is contained in:
Jon Siwek 2020-05-26 13:05:24 -07:00
parent 007533295a
commit 102e58b80b
5 changed files with 59 additions and 54 deletions

View file

@ -2170,9 +2170,14 @@ bool AssignExpr::TypeCheck(attr_list* attrs)
if ( sce->Attrs() )
{
attr_list* a = sce->Attrs()->Attrs();
attrs = new attr_list(a->length());
std::copy(a->begin(), a->end(), std::back_inserter(*attrs));
const auto& a = sce->Attrs()->Attrs();
attr_copy = new attr_list(a.size());
for ( const auto& attr : a )
{
::Ref(attr.get());
attrs->push_back(attr.get());
}
}
int errors_before = reporter->Errors();