elsif Is_Class_Wide_Type (Unc_Typ) then
declare
- CW_Subtype : Entity_Id;
- EQ_Typ : Entity_Id := Empty;
+ CW_Subtype : constant Entity_Id :=
+ New_Class_Wide_Subtype (Unc_Typ, E);
begin
-- A class-wide equivalent type is not needed on VM targets
Set_Etype (Unc_Typ, Base_Type (Full_View (Etype (Unc_Typ))));
end if;
- EQ_Typ := Make_CW_Equivalent_Type (Unc_Typ, E);
+ Set_Equivalent_Type
+ (CW_Subtype, Make_CW_Equivalent_Type (Unc_Typ, E));
end if;
- CW_Subtype := New_Class_Wide_Subtype (Unc_Typ, E);
- Set_Equivalent_Type (CW_Subtype, EQ_Typ);
Set_Cloned_Subtype (CW_Subtype, Base_Type (Unc_Typ));
return New_Occurrence_Of (CW_Subtype, Loc);
end if;
-- If a record subtype is simply copied, the entity list will be
- -- shared. Thus cloned_Subtype must be set to indicate the sharing.
- -- ??? What does this do?
+ -- shared, so Cloned_Subtype must be set to indicate this.
if Ekind (Itype) in E_Class_Wide_Subtype | E_Record_Subtype then
Set_Cloned_Subtype (New_Itype, Itype);