Merge remote-tracking branch 'origin/topic/jsiwek/type-alias-introspection'

* origin/topic/jsiwek/type-alias-introspection:
  Add enum_names() BIF to return names of an enum type's values
  Add type_aliases() BIF for introspecting type-names of types/values
  Change Type::type_aliases map to store IntrusivePtr
  Fix lookup_ID() BIF to return enum values
This commit is contained in:
Jon Siwek 2020-11-12 14:30:32 -08:00
commit aab99b743d
12 changed files with 301 additions and 13 deletions

View file

@ -382,10 +382,10 @@ void add_type(ID* id, TypePtr t, std::unique_ptr<std::vector<AttrPtr>> attr)
// Clone the type to preserve type name aliasing.
tnew = t->ShallowClone();
Type::AddAlias(new_type_name, tnew.get());
Type::RegisterAlias(new_type_name, tnew);
if ( new_type_name != old_type_name && ! old_type_name.empty() )
Type::AddAlias(old_type_name, tnew.get());
Type::RegisterAlias(old_type_name, tnew);
tnew->SetName(id->Name());