Daily bump.
[official-gcc.git] / gcc / ada / targparm.ads
blobca4fa3a2bde3c01dbaf281d73416c5cd07c398d9
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- T A R G P A R M --
6 -- --
7 -- S p e c --
8 -- --
9 -- $Revision: 1.1 $
10 -- --
11 -- Copyright (C) 1999-2001 Free Software Foundation, Inc. --
12 -- --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- Extensive contributions were provided by Ada Core Technologies Inc. --
26 -- --
27 ------------------------------------------------------------------------------
29 -- This package obtains parameters from the target runtime version of
30 -- System, to indicate parameters relevant to the target environment.
32 -- Conceptually, these parameters could be obtained using rtsfind, but
33 -- we do not do this for three reasons:
35 -- 1. Compiling System for every compilation wastes time
36 -- 2. This compilation impedes debugging by adding extra compile steps
37 -- 3. There are recursion problems coming from compiling System itself
38 -- or any of its children.
40 -- For all these reasons, we read in the source of System, and then scan
41 -- it at the text level to extract the parameter values.
43 -- Note however, that later on, when the ali file is written, we make sure
44 -- that the System file is at least parsed, so that the checksum is properly
45 -- computed and set in the ali file. This partially negates points 1 and 2
46 -- above although just parsing is quick and does not impact debugging much.
48 package Targparm is
50 -- The following parameters correspond to the variables defined in the
51 -- private part of System (without the terminating _On_Target). Note
52 -- that it is required that all parameters be specified in system.ads.
54 -----------------------------------
55 -- Control of Exception Handling --
56 -----------------------------------
58 -- GNAT provides two methods of implementing exceptions:
60 -- Longjmp/Setjmp (-gnatL)
62 -- This approach uses longjmp/setjmp to handle exceptions. It
63 -- uses less storage, and can often propagate exceptions faster,
64 -- at the expense of (sometimes considerable) overhead in setting
65 -- up an exception handler. This approach is available on all
66 -- targets, and is the default where it is the only approach.
68 -- Zero Cost (-gnatZ)
70 -- This approach uses separate exception tables. These use extra
71 -- storage, and exception propagation can be quite slow, but there
72 -- is no overhead in setting up an exception handler (it is to this
73 -- latter operation that the phrase zero-cost refers). This approach
74 -- is only available on some targets, and is the default where it is
75 -- available.
77 ZCX_By_Default_On_Target : Boolean;
78 -- Indicates if zero cost exceptions are active by default. Can be modified
79 -- by the use of -gnatZ and -gnatL switches.
81 GCC_ZCX_Support_On_Target : Boolean;
82 -- Indicates that when ZCX is active the mechanism to be used is the
83 -- standard GCC ZCX mechanism (introduced in GCC 3.1)
85 Front_End_ZCX_Support_On_Target : Boolean;
86 -- Indicates that when ZCX is active (and GCC_ZCX_Support is not set)
87 -- the mechanism to be used is the GNAT front end specific ZCX mechanism
89 ---------------------------------------
90 -- High_Integrity (No Run Time) Mode --
91 ---------------------------------------
93 -- In High_Integrity mode, there is no system run-time, and the flag
94 -- Opt.No_Run_Time is set so that the language is appropriately
95 -- restricted to forbid construct that would generate run-time calls.
97 High_Integrity_Mode_On_Target : Boolean;
98 -- Indicates that this build is for a high integrity mode version of
99 -- GNAT, so that no run time is permitted.
101 -------------------------------
102 -- Control of Stack Checking --
103 -------------------------------
105 -- GNAT provides two methods of implementing exceptions:
107 -- GCC Probing Mechanism
109 -- This approach uses the standard GCC mechanism for
110 -- stack checking. The method assumes that accessing
111 -- storage immediately beyond the end of the stack
112 -- will result in a trap that is converted to a storage
113 -- error by the runtime system. This mechanism has
114 -- minimal overhead, but requires complex hardware,
115 -- operating system and run-time support. Probing is
116 -- the default method where it is available. The stack
117 -- size for the environment task depends on the operating
118 -- system and cannot be set in a system-independent way.
120 -- GNAT Stack-limit Checking
122 -- This method relies on comparing the stack pointer
123 -- with per-task stack limits. If the check fails, an
124 -- exception is explicitly raised. The advantage is
125 -- that the method requires no extra system dependent
126 -- runtime support and can be used on systems without
127 -- memory protection as well, but at the cost of more
128 -- overhead for doing the check. This method is the
129 -- default on systems that lack complete support for
130 -- probing.
132 Stack_Check_Probes_On_Target : Boolean;
133 -- Indicates if stack check probes are used, as opposed to the standard
134 -- target independent comparison method.
136 Stack_Check_Default_On_Target : Boolean;
137 -- Indicates if stack checking is on by default
139 ----------------------------
140 -- Command Line Arguments --
141 ----------------------------
143 -- For most ports of GNAT, command line arguments are supported. The
144 -- following flag is set to False for targets that do not support
145 -- command line arguments (notably VxWorks).
147 Command_Line_Args_On_Target : Boolean;
148 -- Set False if no command line arguments on target
150 -- Note: this is prepared for future use, but not yet used, since we
151 -- do not yet have a way of propagating Targparm params to the binder
153 -----------------------
154 -- Main Program Name --
155 -----------------------
157 -- When the binder generates the main program to be used to create the
158 -- executable, the main program name is main by default (to match the
159 -- usual Unix practice). If this parameter is set to True, then the
160 -- name is instead by default taken from the actual Ada main program
161 -- name (just the name of the child if the main program is a child unit).
162 -- In either case, this value can be overridden using -M name.
164 Use_Ada_Main_Program_Name_On_Target : Boolean;
165 -- Set True to use the Ada main program name as the main name
167 -- Note: this is prepared for future use, but not yet used, since we
168 -- do not yet have a way of propagating Targparm params to the binder
170 ----------------------------
171 -- Support of Long Shifts --
172 ----------------------------
174 -- In GNORT mode, we cannot call library routines, and in particular
175 -- we cannot call routines for long (64-bit) shifts if such routines
176 -- are required on the target. This comes up in the context of support
177 -- of packed arrays. We can only represent packed arrays whose length
178 -- is in the range 33- to 64-bits as modular types if long shifts are
179 -- done with inline code.
181 -- For the default version, for now we set long shifts inlined as True
182 -- This may not be quite accurate, but until we get proper separate
183 -- System's for each target, it is a safer choice.
185 Long_Shifts_Inlined_On_Target : Boolean;
186 -- Indicates if long (double word) shifts are generated using inlined
187 -- code (and thus are permissible in No_Run_Time mode).
189 ----------------------------------------------
190 -- Boolean-Valued Floating-Point Attributes --
191 ----------------------------------------------
193 -- The constants below give the values for representation oriented
194 -- floating-point attributes that are the same for all float types
195 -- on the target. These are all boolean values.
197 -- A value is only True if the target reliably supports the corresponding
198 -- feature. Reliably here means that support is guaranteed for all
199 -- possible settings of the relevant compiler switches (like -mieee),
200 -- since we cannot control the user setting of those switches.
202 -- The attributes cannot dependent on the current setting of compiler
203 -- switches, since the values must be static and consistent throughout
204 -- the partition. We probably should add such consistency checks in future,
205 -- but for now we don't do this.
207 AAMP_On_Target : Boolean;
208 -- Set to True if target is AAMP.
210 Denorm_On_Target : Boolean;
211 -- Set to False on targets that do not reliably support denormals.
212 -- Reliably here means for all settings of the relevant -m flag, so
213 -- for example, this is False on the Alpha where denormals are not
214 -- supported unless -mieee is used.
216 Machine_Rounds_On_Target : Boolean;
217 -- Set to False for targets where S'Machine_Rounds is False
219 Machine_Overflows_On_Target : Boolean;
220 -- Set to True for targets where S'Machine_Overflows is True
222 Signed_Zeros_On_Target : Boolean;
223 -- Set to False on targets that do not reliably support signed zeros.
225 OpenVMS_On_Target : Boolean;
226 -- Set to True if target is OpenVMS.
228 --------------------------------------------------------------
229 -- Handling of Unconstrained Values Returned from Functions --
230 --------------------------------------------------------------
232 -- Functions that return variable length objects, notably unconstrained
233 -- arrays are a special case, because there is no simple obvious way of
234 -- implementing this feature. Furthermore, this capability is not present
235 -- in C++ or C, so typically the system ABI does not handle this case.
237 -- GNAT uses two different approaches
239 -- The Secondary Stack
241 -- The secondary stack is a special storage pool that is used for
242 -- this purpose. The called function places the result on the
243 -- secondary stack, and the caller uses or copies the value from
244 -- the secondary stack, and pops the secondary stack after the
245 -- value is consumed. The secondary stack is outside the system
246 -- ABI, and the important point is that although generally it is
247 -- handled in a stack like manner corresponding to the subprogram
248 -- call structure, a return from a function does NOT pop the stack.
250 -- DSP (Depressed Stack Pointer)
252 -- Some targets permit the implementation of a function call/return
253 -- protocol in which the function does not pop the main stack pointer
254 -- on return, but rather returns with the stack pointer depressed.
255 -- This is not generally permitted by any ABI, but for at least some
256 -- targets, the implementation of alloca provides a model for this
257 -- approach. If return-with-DSP is implemented, then functions that
258 -- return variable length objects do it by returning with the stack
259 -- pointer depressed, and the returned object is a pointer to the
260 -- area within the stack frame of the called procedure that contains
261 -- the returned value. The caller must then pop the main stack when
262 -- this value is consumed.
264 Functions_Return_By_DSP_On_Target : Boolean;
265 -- Set to True if target permits functions to return with using the
266 -- DSP (depressed stack pointer) approach.
268 -----------------
269 -- Data Layout --
270 -----------------
272 -- Normally when using the GCC backend, Gigi and GCC perform much of the
273 -- data layout using the standard layout capabilities of GCC. If the
274 -- parameter Backend_Layout is set to False, then the front end must
275 -- perform all data layout. For further details see the package Layout.
277 Frontend_Layout_On_Target : Boolean;
278 -- Set True if front end does layout
280 -----------------
281 -- Subprograms --
282 -----------------
284 procedure Get_Target_Parameters;
285 -- Called at the start of execution to read the source of System and
286 -- obtain and set the values of the above parameters.
288 end Targparm;