1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 -- This package defines the set of restriction identifiers. It is in a
29 -- separate package from Restrict so that it can be easily used by the
30 -- binder without dragging in a lot of stuff.
34 -- The following enumeration type defines the set of restriction
35 -- identifiers not taking a parameter that are implemented in GNAT.
36 -- To add a new restriction identifier, add an entry with the name
37 -- to be used in the pragma, and add appropriate calls to the
38 -- Restrict.Check_Restriction routine.
40 type Restriction_Id
is (
42 -- The following cases are checked for consistency in the binder
44 Boolean_Entry_Barriers
, -- GNAT (Ravenscar)
45 No_Abort_Statements
, -- (RM D.7(5), H.4(3))
46 No_Access_Subprograms
, -- (RM H.4(17))
47 No_Allocators
, -- (RM H.4(7))
48 No_Asynchronous_Control
, -- (RM D.7(10))
50 No_Delay
, -- (RM H.4(21))
51 No_Dispatch
, -- (RM H.4(19))
52 No_Dynamic_Interrupts
, -- GNAT
53 No_Dynamic_Priorities
, -- (RM D.9(9))
54 No_Enumeration_Maps
, -- GNAT
55 No_Entry_Calls_In_Elaboration_Code
, -- GNAT
56 No_Entry_Queue
, -- GNAT
57 No_Exception_Handlers
, -- GNAT
58 No_Exceptions
, -- (RM H.4(12))
59 No_Fixed_Point
, -- (RM H.4(15))
60 No_Floating_Point
, -- (RM H.4(14))
61 No_IO
, -- (RM H.4(20))
62 No_Implicit_Conditionals
, -- GNAT
63 No_Implicit_Dynamic_Code
, -- GNAT
64 No_Implicit_Heap_Allocations
, -- (RM D.8(8), H.4(3))
65 No_Implicit_Loops
, -- GNAT
66 No_Local_Allocators
, -- (RM H.4(8))
67 No_Local_Protected_Objects
, -- GNAT
68 No_Nested_Finalization
, -- (RM D.7(4))
69 No_Protected_Type_Allocators
, -- GNAT
70 No_Protected_Types
, -- (RM H.4(5))
71 No_Recursion
, -- (RM H.4(22))
72 No_Reentrancy
, -- (RM H.4(23))
73 No_Relative_Delay
, -- GNAT
75 No_Secondary_Stack
, -- GNAT
76 No_Select_Statements
, -- GNAT (Ravenscar)
77 No_Standard_Storage_Pools
, -- GNAT
79 No_Task_Allocators
, -- (RM D.7(7))
80 No_Task_Attributes
, -- GNAT
81 No_Task_Hierarchy
, -- (RM D.7(3), H.4(3))
82 No_Task_Termination
, -- GNAT
84 No_Terminate_Alternatives
, -- (RM D.7(6))
85 No_Unchecked_Access
, -- (RM H.4(18))
86 No_Unchecked_Conversion
, -- (RM H.4(16))
87 No_Unchecked_Deallocation
, -- (RM H.4(9))
88 No_Wide_Characters
, -- GNAT
89 Static_Priorities
, -- GNAT
90 Static_Storage_Size
, -- GNAT
92 -- The following cases do not require partition-wide checks
94 Immediate_Reclamation
, -- (RM H.4(10))
95 No_Implementation_Attributes
, -- GNAT
96 No_Implementation_Pragmas
, -- GNAT
97 No_Implementation_Restrictions
, -- GNAT
98 No_Elaboration_Code
, -- GNAT
100 Not_A_Restriction_Id
);
102 subtype All_Restrictions
is
103 Restriction_Id
range Boolean_Entry_Barriers
.. No_Elaboration_Code
;
104 -- All restrictions except Not_A_Restriction_Id
106 -- The following range of Restriction identifiers is checked for
107 -- consistency across a partition. The generated ali file is marked
108 -- for each entry to show one of three possibilities:
110 -- Corresponding restriction is set (so unit does not violate it)
111 -- Corresponding restriction is not violated
112 -- Corresponding restriction is violated
114 subtype Partition_Restrictions
is
115 Restriction_Id
range Boolean_Entry_Barriers
.. Static_Storage_Size
;
117 -- The following set of Restriction identifiers is not checked for
118 -- consistency across a partition. The generated ali file still
119 -- contains indications of the above three possibilities for the
120 -- purposes of listing applicable restrictions.
122 subtype Compilation_Unit_Restrictions
is
123 Restriction_Id
range Immediate_Reclamation
.. No_Elaboration_Code
;
125 -- The following enumeration type defines the set of restriction
126 -- parameter identifiers taking a parameter that are implemented in
127 -- GNAT. To add a new restriction parameter identifier, add an entry
128 -- with the name to be used in the pragma, and add appropriate
129 -- calls to Restrict.Check_Restriction.
131 -- Note: the GNAT implementation currently only accomodates restriction
132 -- parameter identifiers whose expression value is a non-negative
133 -- integer. This is true for all language defined parameters.
135 type Restriction_Parameter_Id
is (
136 Max_Asynchronous_Select_Nesting
, -- (RM D.7(18), H.4(3))
137 Max_Entry_Queue_Depth
, -- GNAT
138 Max_Protected_Entries
, -- (RM D.7(14))
139 Max_Select_Alternatives
, -- (RM D.7(12))
140 Max_Storage_At_Blocking
, -- (RM D.7(17))
141 Max_Task_Entries
, -- (RM D.7(13), H.4(3))
142 Max_Tasks
, -- (RM D.7(19), H.4(3))
143 Not_A_Restriction_Parameter_Id
);