1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2024, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Einfo
.Utils
; use Einfo
.Utils
;
28 with Sinfo
; use Sinfo
;
29 with Sinfo
.Nodes
; use Sinfo
.Nodes
;
30 with Stand
; use Stand
;
31 with Targparm
; use Targparm
;
33 package body Itypes
is
41 Related_Nod
: Node_Id
;
42 Related_Id
: Entity_Id
:= Empty
;
43 Suffix
: Character := ' ';
44 Suffix_Index
: Int
:= 0;
45 Scope_Id
: Entity_Id
:= Current_Scope
) return Entity_Id
50 -- Should comment setting of Public_Status here ???
52 if Related_Id
= Empty
then
53 Typ
:= New_Internal_Entity
(Ekind
, Scope_Id
, Sloc
(Related_Nod
), 'T');
54 Set_Public_Status
(Typ
);
59 (Ekind
, Scope_Id
, Sloc
(Related_Nod
), Related_Id
, Suffix
,
63 -- Make sure Esize (Typ) was properly initialized, it should be since
64 -- New_Internal_Entity/New_External_Entity call Reinit_Size_Align.
66 pragma Assert
(not Known_Esize
(Typ
));
68 Set_Etype
(Typ
, Any_Type
);
70 Set_Associated_Node_For_Itype
(Typ
, Related_Nod
);
72 if In_Deleted_Code
then
76 if Ekind
in Access_Subprogram_Kind
then
77 Set_Can_Use_Internal_Rep
(Typ
, not Always_Compatible_Rep_On_Target
);
83 ---------------------------------
84 -- Create_Null_Excluding_Itype --
85 ---------------------------------
87 function Create_Null_Excluding_Itype
89 Related_Nod
: Node_Id
;
90 Scope_Id
: Entity_Id
:= Current_Scope
) return Entity_Id
95 pragma Assert
(Is_Access_Type
(T
));
97 I_Typ
:= Create_Itype
(Ekind
=> E_Access_Subtype
,
98 Related_Nod
=> Related_Nod
,
99 Scope_Id
=> Scope_Id
);
101 Set_Directly_Designated_Type
(I_Typ
, Directly_Designated_Type
(T
));
102 Set_Etype
(I_Typ
, Base_Type
(T
));
103 Set_Depends_On_Private
(I_Typ
, Depends_On_Private
(T
));
104 Set_Is_Public
(I_Typ
, Is_Public
(T
));
105 Set_From_Limited_With
(I_Typ
, From_Limited_With
(T
));
106 Set_Is_Access_Constant
(I_Typ
, Is_Access_Constant
(T
));
107 Set_Is_Generic_Type
(I_Typ
, Is_Generic_Type
(T
));
108 Set_Is_Volatile
(I_Typ
, Is_Volatile
(T
));
109 Set_Treat_As_Volatile
(I_Typ
, Treat_As_Volatile
(T
));
110 Set_Is_Atomic
(I_Typ
, Is_Atomic
(T
));
111 Set_Is_Ada_2005_Only
(I_Typ
, Is_Ada_2005_Only
(T
));
112 Set_Is_Ada_2012_Only
(I_Typ
, Is_Ada_2012_Only
(T
));
113 Set_Is_Ada_2022_Only
(I_Typ
, Is_Ada_2022_Only
(T
));
114 Set_Can_Never_Be_Null
(I_Typ
);
117 end Create_Null_Excluding_Itype
;