1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2002 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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This package defines the set of restriction identifiers. It is in a
28 -- separate package from Restrict so that it can be easily used by the
29 -- binder without dragging in a lot of stuff.
33 -- The following enumeration type defines the set of restriction
34 -- identifiers not taking a parameter that are implemented in GNAT.
35 -- To add a new restriction identifier, add an entry with the name
36 -- to be used in the pragma, and add appropriate calls to the
37 -- Restrict.Check_Restriction routine.
39 type Restriction_Id
is (
41 -- The following cases are checked for consistency in the binder
43 Boolean_Entry_Barriers
, -- GNAT (Ravenscar)
44 No_Abort_Statements
, -- (RM D.7(5), H.4(3))
45 No_Access_Subprograms
, -- (RM H.4(17))
46 No_Allocators
, -- (RM H.4(7))
47 No_Asynchronous_Control
, -- (RM D.7(10))
49 No_Delay
, -- (RM H.4(21))
50 No_Dispatch
, -- (RM H.4(19))
51 No_Dynamic_Interrupts
, -- GNAT
52 No_Dynamic_Priorities
, -- (RM D.9(9))
53 No_Enumeration_Maps
, -- GNAT
54 No_Entry_Calls_In_Elaboration_Code
, -- GNAT
55 No_Entry_Queue
, -- GNAT
56 No_Exception_Handlers
, -- GNAT
57 No_Exceptions
, -- (RM H.4(12))
58 No_Fixed_Point
, -- (RM H.4(15))
59 No_Floating_Point
, -- (RM H.4(14))
60 No_IO
, -- (RM H.4(20))
61 No_Implicit_Conditionals
, -- GNAT
62 No_Implicit_Dynamic_Code
, -- GNAT
63 No_Implicit_Heap_Allocations
, -- (RM D.8(8), H.4(3))
64 No_Implicit_Loops
, -- GNAT
65 No_Local_Allocators
, -- (RM H.4(8))
66 No_Local_Protected_Objects
, -- GNAT
67 No_Nested_Finalization
, -- (RM D.7(4))
68 No_Protected_Type_Allocators
, -- GNAT
69 No_Protected_Types
, -- (RM H.4(5))
70 No_Recursion
, -- (RM H.4(22))
71 No_Reentrancy
, -- (RM H.4(23))
72 No_Relative_Delay
, -- GNAT
74 No_Secondary_Stack
, -- GNAT
75 No_Select_Statements
, -- GNAT (Ravenscar)
76 No_Standard_Storage_Pools
, -- GNAT
78 No_Task_Allocators
, -- (RM D.7(7))
79 No_Task_Attributes
, -- GNAT
80 No_Task_Hierarchy
, -- (RM D.7(3), H.4(3))
81 No_Task_Termination
, -- GNAT
83 No_Terminate_Alternatives
, -- (RM D.7(6))
84 No_Unchecked_Access
, -- (RM H.4(18))
85 No_Unchecked_Conversion
, -- (RM H.4(16))
86 No_Unchecked_Deallocation
, -- (RM H.4(9))
87 No_Wide_Characters
, -- GNAT
88 Static_Priorities
, -- GNAT
89 Static_Storage_Size
, -- GNAT
91 -- The following cases do not require partition-wide checks
93 Immediate_Reclamation
, -- (RM H.4(10))
94 No_Implementation_Attributes
, -- GNAT
95 No_Implementation_Pragmas
, -- GNAT
96 No_Implementation_Restrictions
, -- GNAT
97 No_Elaboration_Code
, -- GNAT
99 Not_A_Restriction_Id
);
101 subtype All_Restrictions
is
102 Restriction_Id
range Boolean_Entry_Barriers
.. No_Elaboration_Code
;
103 -- All restrictions except Not_A_Restriction_Id
105 -- The following range of Restriction identifiers is checked for
106 -- consistency across a partition. The generated ali file is marked
107 -- for each entry to show one of three possibilities:
109 -- Corresponding restriction is set (so unit does not violate it)
110 -- Corresponding restriction is not violated
111 -- Corresponding restriction is violated
113 subtype Partition_Restrictions
is
114 Restriction_Id
range Boolean_Entry_Barriers
.. Static_Storage_Size
;
116 -- The following set of Restriction identifiers is not checked for
117 -- consistency across a partition. The generated ali file still
118 -- contains indications of the above three possibilities for the
119 -- purposes of listing applicable restrictions.
121 subtype Compilation_Unit_Restrictions
is
122 Restriction_Id
range Immediate_Reclamation
.. No_Elaboration_Code
;
124 -- The following enumeration type defines the set of restriction
125 -- parameter identifiers taking a parameter that are implemented in
126 -- GNAT. To add a new restriction parameter identifier, add an entry
127 -- with the name to be used in the pragma, and add appropriate
128 -- calls to Restrict.Check_Restriction.
130 -- Note: the GNAT implementation currently only accomodates restriction
131 -- parameter identifiers whose expression value is a non-negative
132 -- integer. This is true for all language defined parameters.
134 type Restriction_Parameter_Id
is (
135 Max_Asynchronous_Select_Nesting
, -- (RM D.7(18), H.4(3))
136 Max_Entry_Queue_Depth
, -- GNAT
137 Max_Protected_Entries
, -- (RM D.7(14))
138 Max_Select_Alternatives
, -- (RM D.7(12))
139 Max_Storage_At_Blocking
, -- (RM D.7(17))
140 Max_Task_Entries
, -- (RM D.7(13), H.4(3))
141 Max_Tasks
, -- (RM D.7(19), H.4(3))
142 Not_A_Restriction_Parameter_Id
);