Change Type::type_aliases map to store IntrusivePtr

And deprecate Type::GetAliases() and Type::AddAlias() since they
took raw pointers.  Now replaced with Type::Aliases() and
Type::RegisterAlias().
This commit is contained in:
Jon Siwek 2020-11-06 17:18:20 -08:00
parent bfb7afc600
commit 1dda387ac9
5 changed files with 65 additions and 13 deletions

View file

@ -1348,13 +1348,11 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
if ( vals.find(val) == vals.end() )
vals[val] = make_intrusive<EnumVal>(IntrusivePtr{NewRef{}, this}, val);
set<Type*> types = Type::GetAliases(GetName());
set<Type*>::const_iterator it;
const auto& types = Type::Aliases(GetName());
for ( it = types.begin(); it != types.end(); ++it )
if ( *it != this )
(*it)->AsEnumType()->AddNameInternal(module_name, name, val,
is_export);
for ( const auto& t : types )
if ( t.get() != this )
t->AsEnumType()->AddNameInternal(module_name, name, val, is_export);
}
void EnumType::AddNameInternal(const string& module_name, const char* name,