| 1 |
.. _Implementation_Defined_Aspects: |
| 2 |
|
| 3 |
****************************** |
| 4 |
Implementation Defined Aspects |
| 5 |
****************************** |
| 6 |
|
| 7 |
Ada defines (throughout the Ada 2012 reference manual, summarized |
| 8 |
in Annex K) a set of aspects that can be specified for certain entities. |
| 9 |
These language defined aspects are implemented in GNAT in Ada 2012 mode |
| 10 |
and work as described in the Ada 2012 Reference Manual. |
| 11 |
|
| 12 |
In addition, Ada 2012 allows implementations to define additional aspects |
| 13 |
whose meaning is defined by the implementation. GNAT provides |
| 14 |
a number of these implementation-defined aspects which can be used |
| 15 |
to extend and enhance the functionality of the compiler. This section of |
| 16 |
the GNAT reference manual describes these additional aspects. |
| 17 |
|
| 18 |
Note that any program using these aspects may not be portable to |
| 19 |
other compilers (although GNAT implements this set of aspects on all |
| 20 |
platforms). Therefore if portability to other compilers is an important |
| 21 |
consideration, you should minimize the use of these aspects. |
| 22 |
|
| 23 |
Note that for many of these aspects, the effect is essentially similar |
| 24 |
to the use of a pragma or attribute specification with the same name |
| 25 |
applied to the entity. For example, if we write: |
| 26 |
|
| 27 |
|
| 28 |
.. code-block:: ada |
| 29 |
|
| 30 |
type R is range 1 .. 100 |
| 31 |
with Value_Size => 10; |
| 32 |
|
| 33 |
|
| 34 |
then the effect is the same as: |
| 35 |
|
| 36 |
.. code-block:: ada |
| 37 |
|
| 38 |
type R is range 1 .. 100; |
| 39 |
for R'Value_Size use 10; |
| 40 |
|
| 41 |
|
| 42 |
and if we write: |
| 43 |
|
| 44 |
.. code-block:: ada |
| 45 |
|
| 46 |
type R is new Integer |
| 47 |
with Shared => True; |
| 48 |
|
| 49 |
|
| 50 |
then the effect is the same as: |
| 51 |
|
| 52 |
.. code-block:: ada |
| 53 |
|
| 54 |
type R is new Integer; |
| 55 |
pragma Shared (R); |
| 56 |
|
| 57 |
|
| 58 |
In the documentation below, such cases are simply marked |
| 59 |
as being boolean aspects equivalent to the corresponding pragma |
| 60 |
or attribute definition clause. |
| 61 |
|
| 62 |
Aspect Abstract_State |
| 63 |
===================== |
| 64 |
|
| 65 |
.. index:: Abstract_State |
| 66 |
|
| 67 |
This aspect is equivalent to :ref:`pragma Abstract_State<Pragma-Abstract_State>`. |
| 68 |
|
| 69 |
Aspect Always_Terminates |
| 70 |
======================== |
| 71 |
.. index:: Always_Terminates |
| 72 |
|
| 73 |
This boolean aspect is equivalent to :ref:`pragma Always_Terminates<Pragma-Always_Terminates>`. |
| 74 |
|
| 75 |
Aspect Annotate |
| 76 |
=============== |
| 77 |
|
| 78 |
.. index:: Annotate |
| 79 |
|
| 80 |
There are three forms of this aspect (where ID is an identifier, |
| 81 |
and ARG is a general expression), |
| 82 |
corresponding to :ref:`pragma Annotate<Pragma-Annotate>`. |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
*Annotate => ID* |
| 87 |
Equivalent to ``pragma Annotate (ID, Entity => Name);`` |
| 88 |
|
| 89 |
|
| 90 |
*Annotate => (ID)* |
| 91 |
Equivalent to ``pragma Annotate (ID, Entity => Name);`` |
| 92 |
|
| 93 |
|
| 94 |
*Annotate => (ID ,ID {, ARG})* |
| 95 |
Equivalent to ``pragma Annotate (ID, ID {, ARG}, Entity => Name);`` |
| 96 |
|
| 97 |
Aspect Async_Readers |
| 98 |
==================== |
| 99 |
.. index:: Async_Readers |
| 100 |
|
| 101 |
This boolean aspect is equivalent to :ref:`pragma Async_Readers<Pragma-Async_Readers>`. |
| 102 |
|
| 103 |
Aspect Async_Writers |
| 104 |
==================== |
| 105 |
.. index:: Async_Writers |
| 106 |
|
| 107 |
This boolean aspect is equivalent to :ref:`pragma Async_Writers<Pragma-Async_Writers>`. |
| 108 |
|
| 109 |
Aspect Constant_After_Elaboration |
| 110 |
================================= |
| 111 |
.. index:: Constant_After_Elaboration |
| 112 |
|
| 113 |
This aspect is equivalent to :ref:`pragma Constant_After_Elaboration<Pragma-Constant_After_Elaboration>`. |
| 114 |
|
| 115 |
Aspect Contract_Cases |
| 116 |
===================== |
| 117 |
.. index:: Contract_Cases |
| 118 |
|
| 119 |
This aspect is equivalent to :ref:`pragma Contract_Cases<Pragma-Contract_Cases>`, the sequence |
| 120 |
of clauses being enclosed in parentheses so that syntactically it is an |
| 121 |
aggregate. |
| 122 |
|
| 123 |
Aspect Depends |
| 124 |
============== |
| 125 |
.. index:: Depends |
| 126 |
|
| 127 |
This aspect is equivalent to :ref:`pragma Depends<Pragma-Depends>`. |
| 128 |
|
| 129 |
Aspect Default_Initial_Condition |
| 130 |
================================ |
| 131 |
.. index:: Default_Initial_Condition |
| 132 |
|
| 133 |
This aspect is equivalent to :ref:`pragma Default_Initial_Condition<Pragma-Default_Initial_Condition>`. |
| 134 |
|
| 135 |
Aspect Dimension |
| 136 |
================ |
| 137 |
.. index:: Dimension |
| 138 |
|
| 139 |
The ``Dimension`` aspect is used to specify the dimensions of a given |
| 140 |
subtype of a dimensioned numeric type. The aspect also specifies a symbol |
| 141 |
used when doing formatted output of dimensioned quantities. The syntax is:: |
| 142 |
|
| 143 |
with Dimension => |
| 144 |
([Symbol =>] SYMBOL, DIMENSION_VALUE {, DIMENSION_Value}) |
| 145 |
|
| 146 |
SYMBOL ::= STRING_LITERAL | CHARACTER_LITERAL |
| 147 |
|
| 148 |
DIMENSION_VALUE ::= |
| 149 |
RATIONAL |
| 150 |
| others => RATIONAL |
| 151 |
| DISCRETE_CHOICE_LIST => RATIONAL |
| 152 |
|
| 153 |
RATIONAL ::= [-] NUMERIC_LITERAL [/ NUMERIC_LITERAL] |
| 154 |
|
| 155 |
|
| 156 |
This aspect can only be applied to a subtype whose parent type has |
| 157 |
a ``Dimension_System`` aspect. The aspect must specify values for |
| 158 |
all dimensions of the system. The rational values are the powers of the |
| 159 |
corresponding dimensions that are used by the compiler to verify that |
| 160 |
physical (numeric) computations are dimensionally consistent. For example, |
| 161 |
the computation of a force must result in dimensions (L => 1, M => 1, T => -2). |
| 162 |
For further examples of the usage |
| 163 |
of this aspect, see package ``System.Dim.Mks``. |
| 164 |
Note that when the dimensioned type is an integer type, then any |
| 165 |
dimension value must be an integer literal. |
| 166 |
|
| 167 |
Aspect Dimension_System |
| 168 |
======================= |
| 169 |
.. index:: Dimension_System |
| 170 |
|
| 171 |
The ``Dimension_System`` aspect is used to define a system of |
| 172 |
dimensions that will be used in subsequent subtype declarations with |
| 173 |
``Dimension`` aspects that reference this system. The syntax is:: |
| 174 |
|
| 175 |
with Dimension_System => (DIMENSION {, DIMENSION}); |
| 176 |
|
| 177 |
DIMENSION ::= ([Unit_Name =>] IDENTIFIER, |
| 178 |
[Unit_Symbol =>] SYMBOL, |
| 179 |
[Dim_Symbol =>] SYMBOL) |
| 180 |
|
| 181 |
SYMBOL ::= CHARACTER_LITERAL | STRING_LITERAL |
| 182 |
|
| 183 |
|
| 184 |
This aspect is applied to a type, which must be a numeric derived type |
| 185 |
(typically a floating-point type), that |
| 186 |
will represent values within the dimension system. Each ``DIMENSION`` |
| 187 |
corresponds to one particular dimension. A maximum of 7 dimensions may |
| 188 |
be specified. ``Unit_Name`` is the name of the dimension (for example |
| 189 |
``Meter``). ``Unit_Symbol`` is the shorthand used for quantities |
| 190 |
of this dimension (for example ``m`` for ``Meter``). |
| 191 |
``Dim_Symbol`` gives |
| 192 |
the identification within the dimension system (typically this is a |
| 193 |
single letter, e.g. ``L`` standing for length for unit name ``Meter``). |
| 194 |
The ``Unit_Symbol`` is used in formatted output of dimensioned quantities. |
| 195 |
The ``Dim_Symbol`` is used in error messages when numeric operations have |
| 196 |
inconsistent dimensions. |
| 197 |
|
| 198 |
GNAT provides the standard definition of the International MKS system in |
| 199 |
the run-time package ``System.Dim.Mks``. You can easily define |
| 200 |
similar packages for cgs units or British units, and define conversion factors |
| 201 |
between values in different systems. The MKS system is characterized by the |
| 202 |
following aspect: |
| 203 |
|
| 204 |
.. code-block:: ada |
| 205 |
|
| 206 |
type Mks_Type is new Long_Long_Float with |
| 207 |
Dimension_System => ( |
| 208 |
(Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'), |
| 209 |
(Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'), |
| 210 |
(Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'), |
| 211 |
(Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'), |
| 212 |
(Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => '@'), |
| 213 |
(Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'), |
| 214 |
(Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J')); |
| 215 |
|
| 216 |
|
| 217 |
Note that in the above type definition, we use the ``at`` symbol (``@``) to |
| 218 |
represent a theta character (avoiding the use of extended Latin-1 |
| 219 |
characters in this context). |
| 220 |
|
| 221 |
See section 'Performing Dimensionality Analysis in GNAT' in the GNAT Users |
| 222 |
Guide for detailed examples of use of the dimension system. |
| 223 |
|
| 224 |
Aspect Disable_Controlled |
| 225 |
========================= |
| 226 |
.. index:: Disable_Controlled |
| 227 |
|
| 228 |
The aspect ``Disable_Controlled`` is defined for controlled record types. If |
| 229 |
active, this aspect causes suppression of all related calls to ``Initialize``, |
| 230 |
``Adjust``, and ``Finalize``. The intended use is for conditional compilation, |
| 231 |
where for example you might want a record to be controlled or not depending on |
| 232 |
whether some run-time check is enabled or suppressed. |
| 233 |
|
| 234 |
Aspect Effective_Reads |
| 235 |
====================== |
| 236 |
.. index:: Effective_Reads |
| 237 |
|
| 238 |
This aspect is equivalent to :ref:`pragma Effective_Reads<Pragma-Effective_Reads>`. |
| 239 |
|
| 240 |
Aspect Effective_Writes |
| 241 |
======================= |
| 242 |
.. index:: Effective_Writes |
| 243 |
|
| 244 |
This aspect is equivalent to :ref:`pragma Effective_Writes<Pragma-Effective_Writes>`. |
| 245 |
|
| 246 |
Aspect Exceptional_Cases |
| 247 |
======================== |
| 248 |
.. index:: Exceptional_Cases |
| 249 |
|
| 250 |
This aspect may be specified for procedures and functions with side effects; |
| 251 |
it can be used to list exceptions that might be propagated by the subprogram |
| 252 |
with side effects in the context of its precondition, and associate them |
| 253 |
with a specific postcondition. |
| 254 |
|
| 255 |
For the syntax and semantics of this aspect, see the SPARK 2014 Reference |
| 256 |
Manual, section 6.1.9. |
| 257 |
|
| 258 |
Aspect Exit_Cases |
| 259 |
================= |
| 260 |
.. index:: Exit_Cases |
| 261 |
|
| 262 |
This aspect may be specified for procedures and functions with side effects; |
| 263 |
it can be used to partition the input state into a list of cases and specify, |
| 264 |
for each case, how the subprogram is allowed to terminate (i.e. return normally |
| 265 |
or propagate an exception). |
| 266 |
|
| 267 |
For the syntax and semantics of this aspect, see the SPARK 2014 Reference |
| 268 |
Manual, section 6.1.10. |
| 269 |
|
| 270 |
Aspect Extensions_Visible |
| 271 |
========================= |
| 272 |
.. index:: Extensions_Visible |
| 273 |
|
| 274 |
This aspect is equivalent to :ref:`pragma Extensions_Visible<Pragma-Extensions_Visible>`. |
| 275 |
|
| 276 |
Aspect Favor_Top_Level |
| 277 |
====================== |
| 278 |
.. index:: Favor_Top_Level |
| 279 |
|
| 280 |
This boolean aspect is equivalent to :ref:`pragma Favor_Top_Level<Pragma-Favor_Top_Level>`. |
| 281 |
|
| 282 |
Aspect Ghost |
| 283 |
============= |
| 284 |
.. index:: Ghost |
| 285 |
|
| 286 |
This aspect is equivalent to :ref:`pragma Ghost<Pragma-Ghost>`. |
| 287 |
|
| 288 |
Aspect Ghost_Predicate |
| 289 |
====================== |
| 290 |
.. index:: Ghost_Predicate |
| 291 |
|
| 292 |
This aspect introduces a subtype predicate that can reference ghost |
| 293 |
entities. The subtype cannot appear as a subtype_mark in a membership test. |
| 294 |
|
| 295 |
For the detailed semantics of this aspect, see the entry for subtype predicates |
| 296 |
in the SPARK Reference Manual, section 3.2.4. |
| 297 |
|
| 298 |
Aspect Global |
| 299 |
============= |
| 300 |
.. index:: Global |
| 301 |
|
| 302 |
This aspect is equivalent to :ref:`pragma Global<Pragma-Global>`. |
| 303 |
|
| 304 |
Aspect Initial_Condition |
| 305 |
======================== |
| 306 |
.. index:: Initial_Condition |
| 307 |
|
| 308 |
This aspect is equivalent to :ref:`pragma Initial_Condition<Pragma-Initial_Condition>`. |
| 309 |
|
| 310 |
Aspect Initializes |
| 311 |
================== |
| 312 |
.. index:: Initializes |
| 313 |
|
| 314 |
This aspect is equivalent to :ref:`pragma Initializes<Pragma-Initializes>`. |
| 315 |
|
| 316 |
Aspect Inline_Always |
| 317 |
==================== |
| 318 |
.. index:: Inline_Always |
| 319 |
|
| 320 |
This boolean aspect is equivalent to :ref:`pragma Inline_Always<Pragma-Inline_Always>`. |
| 321 |
|
| 322 |
Aspect Invariant |
| 323 |
================ |
| 324 |
.. index:: Invariant |
| 325 |
|
| 326 |
This aspect is equivalent to :ref:`pragma Invariant<Pragma-Invariant>`. It is a |
| 327 |
synonym for the language defined aspect ``Type_Invariant`` except |
| 328 |
that it is separately controllable using pragma ``Assertion_Policy``. |
| 329 |
|
| 330 |
Aspect Invariant'Class |
| 331 |
====================== |
| 332 |
.. index:: Invariant'Class |
| 333 |
|
| 334 |
This aspect is equivalent to :ref:`pragma Type_Invariant_Class<Pragma-Type_Invariant_Class>`. It is a |
| 335 |
synonym for the language defined aspect ``Type_Invariant'Class`` except |
| 336 |
that it is separately controllable using pragma ``Assertion_Policy``. |
| 337 |
|
| 338 |
Aspect Iterable |
| 339 |
=============== |
| 340 |
.. index:: Iterable |
| 341 |
|
| 342 |
This aspect provides a light-weight mechanism for loops and quantified |
| 343 |
expressions over container types, without the overhead imposed by the tampering |
| 344 |
checks of standard Ada 2012 iterators. The value of the aspect is an aggregate |
| 345 |
with six named components, of which the last three are optional: ``First``, |
| 346 |
``Next``, ``Has_Element``, ``Element``, ``Last``, and ``Previous``. |
| 347 |
When only the first three components are specified, only the |
| 348 |
``for .. in`` form of iteration over cursors is available. When ``Element`` |
| 349 |
is specified, both this form and the ``for .. of`` form of iteration over |
| 350 |
elements are available. If the last two components are specified, reverse |
| 351 |
iterations over the container can be specified (analogous to what can be done |
| 352 |
over predefined containers that support the ``Reverse_Iterator`` interface). |
| 353 |
The following is a typical example of use: |
| 354 |
|
| 355 |
.. code-block:: ada |
| 356 |
|
| 357 |
type List is private with |
| 358 |
Iterable => (First => First_Cursor, |
| 359 |
Next => Advance, |
| 360 |
Has_Element => Cursor_Has_Element |
| 361 |
[,Element => Get_Element] |
| 362 |
[,Last => Last_Cursor] |
| 363 |
[,Previous => Retreat]); |
| 364 |
|
| 365 |
* The values of ``First`` and ``Last`` are primitive operations of the |
| 366 |
container type that return a ``Cursor``, which must be a type declared in |
| 367 |
the container package or visible from it. For example: |
| 368 |
|
| 369 |
.. code-block:: ada |
| 370 |
|
| 371 |
function First_Cursor (Cont : Container) return Cursor; |
| 372 |
function Last_Cursor (Cont : Container) return Cursor; |
| 373 |
|
| 374 |
* The values of ``Next`` and ``Previous`` are primitive operations of the container type that take |
| 375 |
both a container and a cursor and yield a cursor. For example: |
| 376 |
|
| 377 |
.. code-block:: ada |
| 378 |
|
| 379 |
function Advance (Cont : Container; Position : Cursor) return Cursor; |
| 380 |
function Retreat (Cont : Container; Position : Cursor) return Cursor; |
| 381 |
|
| 382 |
* The value of ``Has_Element`` is a primitive operation of the container type |
| 383 |
that takes both a container and a cursor and yields a boolean. For example: |
| 384 |
|
| 385 |
.. code-block:: ada |
| 386 |
|
| 387 |
function Cursor_Has_Element (Cont : Container; Position : Cursor) return Boolean; |
| 388 |
|
| 389 |
* The value of ``Element`` is a primitive operation of the container type that |
| 390 |
takes both a container and a cursor and yields an ``Element_Type``, which must |
| 391 |
be a type declared in the container package or visible from it. For example: |
| 392 |
|
| 393 |
.. code-block:: ada |
| 394 |
|
| 395 |
function Get_Element (Cont : Container; Position : Cursor) return Element_Type; |
| 396 |
|
| 397 |
This aspect is used in the GNAT-defined formal container packages. |
| 398 |
|
| 399 |
Aspect Linker_Section |
| 400 |
===================== |
| 401 |
.. index:: Linker_Section |
| 402 |
|
| 403 |
This aspect is equivalent to :ref:`pragma Linker_Section<Pragma-Linker_Section>`. |
| 404 |
|
| 405 |
Aspect Local_Restrictions |
| 406 |
========================= |
| 407 |
.. index:: Local_Restrictions |
| 408 |
|
| 409 |
This aspect may be specified for a subprogram (and for other declarations |
| 410 |
as described below). It is used to specify that a particular subprogram does |
| 411 |
not violate one or more local restrictions, nor can it call a subprogram |
| 412 |
that is not subject to the same requirement. Positional aggregate syntax |
| 413 |
(with parentheses, not square brackets) may be used to specify more than one |
| 414 |
local restriction, as in |
| 415 |
|
| 416 |
.. code-block:: ada |
| 417 |
|
| 418 |
procedure Do_Something |
| 419 |
with Local_Restrictions => (Some_Restriction, Another_Restriction); |
| 420 |
|
| 421 |
Parentheses are currently required even in the case of specifying a single |
| 422 |
local restriction (this requirement may be relaxed in the future). |
| 423 |
Supported local restrictions currently include (only) No_Heap_Allocations and |
| 424 |
No_Secondary_Stack. |
| 425 |
No_Secondary_Stack corresponds to the GNAT-defined (global) restriction |
| 426 |
of the same name. No_Heap_Allocations corresponds to the conjunction of the |
| 427 |
Ada-defined restrictions No_Allocators and No_Implicit_Heap_Allocations. |
| 428 |
|
| 429 |
Additional requirements are imposed in order to ensure that restriction |
| 430 |
violations cannot be achieved via overriding dispatching operations, |
| 431 |
calling through an access-to-subprogram value, calling a generic formal |
| 432 |
subprogram, or calling through a subprogram renaming. |
| 433 |
For a dispatching operation, an overrider must be subject to (at least) the |
| 434 |
same restrictions as the overridden inherited subprogram; similarly, the |
| 435 |
actual subprogram corresponding to a generic formal subprogram |
| 436 |
in an instantiation must be subject to (at least) the same restrictions |
| 437 |
as the formal subprogram. A call through an access-to-subprogram value |
| 438 |
is conservatively assumed to violate all local restrictions; tasking-related |
| 439 |
constructs (notably entry calls) are treated similarly. A renaming-as-body is |
| 440 |
treated like a subprogram body containing a call to the renamed subprogram. |
| 441 |
|
| 442 |
The Local_Restrictions aspect can be specified for a package specification, |
| 443 |
in which case the aspect specification also applies to all eligible entities |
| 444 |
declared with the package. This includes types. Default initialization of an |
| 445 |
object of a given type is treated like a call to an implicitly-declared |
| 446 |
initialization subprogram. Such a "call" is subject to the same local |
| 447 |
restriction checks as any other call. If a type is subject to a local |
| 448 |
restriction, then any violations of that restriction within the default |
| 449 |
initialization expressions (if any) of the type are rejected. This may |
| 450 |
include "calls" to the default initialization subprograms of other types. |
| 451 |
|
| 452 |
Local_Restrictions aspect specifications are additive (for example, in the |
| 453 |
case of a declaration that occurs within nested packages that each have |
| 454 |
a Local_Restrictions specification). |
| 455 |
|
| 456 |
|
| 457 |
Aspect Lock_Free |
| 458 |
================ |
| 459 |
.. index:: Lock_Free |
| 460 |
|
| 461 |
This boolean aspect is equivalent to :ref:`pragma Lock_Free<Pragma-Lock_Free>`. |
| 462 |
|
| 463 |
Aspect Max_Queue_Length |
| 464 |
======================= |
| 465 |
.. index:: Max_Queue_Length |
| 466 |
|
| 467 |
This aspect is equivalent to :ref:`pragma Max_Queue_Length<Pragma-Max_Queue_Length>`. |
| 468 |
|
| 469 |
Aspect No_Caching |
| 470 |
================= |
| 471 |
.. index:: No_Caching |
| 472 |
|
| 473 |
This boolean aspect is equivalent to :ref:`pragma No_Caching<Pragma-No_Caching>`. |
| 474 |
|
| 475 |
Aspect No_Elaboration_Code_All |
| 476 |
============================== |
| 477 |
.. index:: No_Elaboration_Code_All |
| 478 |
|
| 479 |
This aspect is equivalent to :ref:`pragma No_Elaboration_Code_All<Pragma-No_Elaboration_Code_All>` |
| 480 |
for a program unit. |
| 481 |
|
| 482 |
Aspect No_Inline |
| 483 |
================ |
| 484 |
.. index:: No_Inline |
| 485 |
|
| 486 |
This boolean aspect is equivalent to :ref:`pragma No_Inline<Pragma-No_Inline>`. |
| 487 |
|
| 488 |
Aspect No_Raise |
| 489 |
=============== |
| 490 |
.. index:: No_Raise |
| 491 |
|
| 492 |
This boolean aspect is equivalent to :ref:`pragma No_Raise<Pragma-No_Raise>`. |
| 493 |
|
| 494 |
Aspect No_Tagged_Streams |
| 495 |
======================== |
| 496 |
.. index:: No_Tagged_Streams |
| 497 |
|
| 498 |
This aspect is equivalent to :ref:`pragma No_Tagged_Streams<Pragma-No_Tagged_Streams>` with an |
| 499 |
argument specifying a root tagged type (thus this aspect can only be |
| 500 |
applied to such a type). |
| 501 |
|
| 502 |
Aspect No_Task_Parts |
| 503 |
======================== |
| 504 |
.. index:: No_Task_Parts |
| 505 |
|
| 506 |
Applies to a type. If True, requires that the type and any descendants |
| 507 |
do not have any task parts. The rules for this aspect are the same as |
| 508 |
for the language-defined No_Controlled_Parts aspect (see RM-H.4.1), |
| 509 |
replacing "controlled" with "task". |
| 510 |
|
| 511 |
If No_Task_Parts is True for a type T, then the compiler can optimize |
| 512 |
away certain tasking-related code that would otherwise be needed |
| 513 |
for T'Class, because descendants of T might contain tasks. |
| 514 |
|
| 515 |
Aspect Object_Size |
| 516 |
================== |
| 517 |
.. index:: Object_Size |
| 518 |
|
| 519 |
This aspect is equivalent to :ref:`attribute Object_Size<Attribute-Object_Size>`. |
| 520 |
|
| 521 |
Aspect Obsolescent |
| 522 |
================== |
| 523 |
.. index:: Obsolescent |
| 524 |
|
| 525 |
This aspect is equivalent to :ref:`pragma Obsolescent<Pragma_Obsolescent>`. Note that the |
| 526 |
evaluation of this aspect happens at the point of occurrence, it is not |
| 527 |
delayed until the freeze point. |
| 528 |
|
| 529 |
Aspect Part_Of |
| 530 |
============== |
| 531 |
.. index:: Part_Of |
| 532 |
|
| 533 |
This aspect is equivalent to :ref:`pragma Part_Of<Pragma-Part_Of>`. |
| 534 |
|
| 535 |
Aspect Persistent_BSS |
| 536 |
===================== |
| 537 |
.. index:: Persistent_BSS |
| 538 |
|
| 539 |
This boolean aspect is equivalent to :ref:`pragma Persistent_BSS<Pragma-Persistent_BSS>`. |
| 540 |
|
| 541 |
Aspect Predicate |
| 542 |
================ |
| 543 |
.. index:: Predicate |
| 544 |
|
| 545 |
This aspect is equivalent to :ref:`pragma Predicate<Pragma-Predicate>`. It is thus |
| 546 |
similar to the language defined aspects ``Dynamic_Predicate`` |
| 547 |
and ``Static_Predicate`` except that whether the resulting |
| 548 |
predicate is static or dynamic is controlled by the form of the |
| 549 |
expression. It is also separately controllable using pragma |
| 550 |
``Assertion_Policy``. |
| 551 |
|
| 552 |
Aspect Pure_Function |
| 553 |
==================== |
| 554 |
.. index:: Pure_Function |
| 555 |
|
| 556 |
This boolean aspect is equivalent to :ref:`pragma Pure_Function<Pragma-Pure_Function>`. |
| 557 |
|
| 558 |
Aspect Refined_Depends |
| 559 |
====================== |
| 560 |
.. index:: Refined_Depends |
| 561 |
|
| 562 |
This aspect is equivalent to :ref:`pragma Refined_Depends<Pragma-Refined_Depends>`. |
| 563 |
|
| 564 |
Aspect Refined_Global |
| 565 |
===================== |
| 566 |
.. index:: Refined_Global |
| 567 |
|
| 568 |
This aspect is equivalent to :ref:`pragma Refined_Global<Pragma-Refined_Global>`. |
| 569 |
|
| 570 |
Aspect Refined_Post |
| 571 |
=================== |
| 572 |
.. index:: Refined_Post |
| 573 |
|
| 574 |
This aspect is equivalent to :ref:`pragma Refined_Post<Pragma-Refined_Post>`. |
| 575 |
|
| 576 |
Aspect Refined_State |
| 577 |
==================== |
| 578 |
.. index:: Refined_State |
| 579 |
|
| 580 |
This aspect is equivalent to :ref:`pragma Refined_State<Pragma-Refined_State>`. |
| 581 |
|
| 582 |
Aspect Relaxed_Initialization |
| 583 |
============================= |
| 584 |
.. index:: Refined_Initialization |
| 585 |
|
| 586 |
For the syntax and semantics of this aspect, see the SPARK 2014 Reference |
| 587 |
Manual, section 6.10. |
| 588 |
|
| 589 |
Aspect Remote_Access_Type |
| 590 |
========================= |
| 591 |
.. index:: Remote_Access_Type |
| 592 |
|
| 593 |
This aspect is equivalent to :ref:`pragma Remote_Access_Type<Pragma-Remote_Access_Type>`. |
| 594 |
|
| 595 |
Aspect Scalar_Storage_Order |
| 596 |
=========================== |
| 597 |
.. index:: Scalar_Storage_Order |
| 598 |
|
| 599 |
This aspect is equivalent to a :ref:`attribute Scalar_Storage_Order<Attribute-Scalar_Storage_Order>`. |
| 600 |
|
| 601 |
Aspect Secondary_Stack_Size |
| 602 |
=========================== |
| 603 |
|
| 604 |
.. index:: Secondary_Stack_Size |
| 605 |
|
| 606 |
This aspect is equivalent to :ref:`pragma Secondary_Stack_Size<Pragma-Secondary_Stack_Size>`. |
| 607 |
|
| 608 |
Aspect Shared |
| 609 |
============= |
| 610 |
.. index:: Shared |
| 611 |
|
| 612 |
This boolean aspect is equivalent to :ref:`pragma Shared<Pragma-Shared>` |
| 613 |
and is thus a synonym for aspect ``Atomic``. |
| 614 |
|
| 615 |
Aspect Side_Effects |
| 616 |
=================== |
| 617 |
.. index:: Side_Effects |
| 618 |
|
| 619 |
This aspect is equivalent to :ref:`pragma Side_Effects<Pragma-Side_Effects>`. |
| 620 |
|
| 621 |
Aspect Simple_Storage_Pool |
| 622 |
========================== |
| 623 |
.. index:: Simple_Storage_Pool |
| 624 |
|
| 625 |
This aspect is equivalent to :ref:`attribute Simple_Storage_Pool<Attribute_Simple_Storage_Pool>`. |
| 626 |
|
| 627 |
Aspect Simple_Storage_Pool_Type |
| 628 |
=============================== |
| 629 |
.. index:: Simple_Storage_Pool_Type |
| 630 |
|
| 631 |
This boolean aspect is equivalent to :ref:`pragma Simple_Storage_Pool_Type<Pragma-Simple_Storage_Pool_Type>`. |
| 632 |
|
| 633 |
Aspect SPARK_Mode |
| 634 |
================= |
| 635 |
.. index:: SPARK_Mode |
| 636 |
|
| 637 |
This aspect is equivalent to :ref:`pragma SPARK_Mode<Pragma-SPARK_Mode>` and |
| 638 |
may be specified for either or both of the specification and body |
| 639 |
of a subprogram or package. |
| 640 |
|
| 641 |
Aspect Subprogram_Variant |
| 642 |
========================= |
| 643 |
.. index:: Subprogram_Variant |
| 644 |
|
| 645 |
For the syntax and semantics of this aspect, see the SPARK 2014 Reference |
| 646 |
Manual, section 6.1.8. |
| 647 |
|
| 648 |
Aspect Suppress_Debug_Info |
| 649 |
========================== |
| 650 |
.. index:: Suppress_Debug_Info |
| 651 |
|
| 652 |
This boolean aspect is equivalent to :ref:`pragma Suppress_Debug_Info<Pragma-Suppress_Debug_Info>`. |
| 653 |
|
| 654 |
Aspect Suppress_Initialization |
| 655 |
============================== |
| 656 |
.. index:: Suppress_Initialization |
| 657 |
|
| 658 |
This boolean aspect is equivalent to :ref:`pragma Suppress_Initialization<Pragma-Suppress_Initialization>`. |
| 659 |
|
| 660 |
Aspect Test_Case |
| 661 |
================ |
| 662 |
.. index:: Test_Case |
| 663 |
|
| 664 |
This aspect is equivalent to :ref:`pragma Test_Case<Pragma-Test_Case>`. |
| 665 |
|
| 666 |
Aspect Thread_Local_Storage |
| 667 |
=========================== |
| 668 |
.. index:: Thread_Local_Storage |
| 669 |
|
| 670 |
This boolean aspect is equivalent to :ref:`pragma Thread_Local_Storage<Pragma-Thread_Local_Storage>`. |
| 671 |
|
| 672 |
Aspect Universal_Aliasing |
| 673 |
========================= |
| 674 |
.. index:: Universal_Aliasing |
| 675 |
|
| 676 |
This boolean aspect is equivalent to :ref:`pragma Universal_Aliasing<Pragma-Universal_Aliasing>`. |
| 677 |
|
| 678 |
Aspect Unmodified |
| 679 |
================= |
| 680 |
.. index:: Unmodified |
| 681 |
|
| 682 |
This boolean aspect is equivalent to :ref:`pragma Unmodified<Pragma-Unmodified>`. |
| 683 |
|
| 684 |
Aspect Unreferenced |
| 685 |
=================== |
| 686 |
.. index:: Unreferenced |
| 687 |
|
| 688 |
This boolean aspect is equivalent to :ref:`pragma Unreferenced<Pragma-Unreferenced>`. |
| 689 |
|
| 690 |
When using the ``-gnat2022`` switch, this aspect is also supported on formal |
| 691 |
parameters, which is in particular the only form possible for expression |
| 692 |
functions. |
| 693 |
|
| 694 |
Aspect Unreferenced_Objects |
| 695 |
=========================== |
| 696 |
.. index:: Unreferenced_Objects |
| 697 |
|
| 698 |
This boolean aspect is equivalent to :ref:`pragma Unreferenced_Objects<Pragma-Unreferenced_Objects>`. |
| 699 |
|
| 700 |
Aspect User_Aspect |
| 701 |
================== |
| 702 |
.. index:: User_Aspect |
| 703 |
|
| 704 |
This aspect takes an argument that is the name of an aspect defined by a |
| 705 |
User_Aspect_Definition configuration pragma. |
| 706 |
A User_Aspect aspect specification is semantically equivalent to |
| 707 |
replicating the set of aspect specifications associated with the named |
| 708 |
pragma-defined aspect. |
| 709 |
|
| 710 |
Aspect Value_Size |
| 711 |
================= |
| 712 |
.. index:: Value_Size |
| 713 |
|
| 714 |
This aspect is equivalent to :ref:`attribute Value_Size<Attribute-Value_Size>`. |
| 715 |
|
| 716 |
Aspect Volatile_Full_Access |
| 717 |
=========================== |
| 718 |
.. index:: Volatile_Full_Access |
| 719 |
|
| 720 |
This boolean aspect is equivalent to :ref:`pragma Volatile_Full_Access<Pragma-Volatile_Full_Access>`. |
| 721 |
|
| 722 |
Aspect Volatile_Function |
| 723 |
=========================== |
| 724 |
.. index:: Volatile_Function |
| 725 |
|
| 726 |
This boolean aspect is equivalent to :ref:`pragma Volatile_Function<Pragma-Volatile_Function>`. |
| 727 |
|
| 728 |
Aspect Warnings |
| 729 |
=============== |
| 730 |
.. index:: Warnings |
| 731 |
|
| 732 |
This aspect is equivalent to the two argument form of :ref:`pragma Warnings<Pragma_Warnings>`, |
| 733 |
where the first argument is ``ON`` or ``OFF`` and the second argument |
| 734 |
is the entity. |