-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with Sinfo; use Sinfo;
with Stand; use Stand;
with Targparm; use Targparm;
+with Uintp; use Uintp;
package body Itypes is
Typ : Entity_Id;
begin
+ -- Should comment setting of Public_Status here ???
+
if Related_Id = Empty then
Typ := New_Internal_Entity (Ekind, Scope_Id, Sloc (Related_Nod), 'T');
Set_Public_Status (Typ);
else
- Typ := New_External_Entity
- (Ekind, Scope_Id, Sloc (Related_Nod), Related_Id, Suffix,
- Suffix_Index, 'T');
+ Typ :=
+ New_External_Entity
+ (Ekind, Scope_Id, Sloc (Related_Nod), Related_Id, Suffix,
+ Suffix_Index, 'T');
end if;
- Init_Size_Align (Typ);
+ -- Make sure Esize (Typ) was properly initialized, it should be since
+ -- New_Internal_Entity/New_External_Entity call Init_Size_Align.
+
+ pragma Assert (Esize (Typ) = Uint_0);
+
Set_Etype (Typ, Any_Type);
Set_Is_Itype (Typ);
Set_Associated_Node_For_Itype (Typ, Related_Nod);
Set_Directly_Designated_Type (I_Typ, Directly_Designated_Type (T));
Set_Etype (I_Typ, T);
- Init_Size_Align (I_Typ);
Set_Depends_On_Private (I_Typ, Depends_On_Private (T));
Set_Is_Public (I_Typ, Is_Public (T));
Set_From_With_Type (I_Typ, From_With_Type (T));
with Opt; use Opt;
with Output; use Output;
with Rtsfind; use Rtsfind;
+with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Sinput.D; use Sinput.D;
Sprint_Node (Subtype_Indication (Node));
if Present (Interface_List (Node)) then
+ Write_Str_With_Col_Check (" and ");
Sprint_And_List (Interface_List (Node));
Write_Str_With_Col_Check (" with ");
end if;
Write_Char (' ');
end loop;
- -- If we have a constructed declaration, print it
-
- if Present (P) and then Nkind (P) in N_Declaration then
+ -- If we have a constructed declaration for the itype, print it
+ if Present (P)
+ and then Nkind (P) in N_Declaration
+ and then Defining_Entity (P) = Typ
+ then
-- We must set Itype_Printed true before the recursive call to
-- print the node, otherwise we get an infinite recursion!