Ada Reference Manual (Ada 2022) — Legal Information

# J.15.14 Elaboration Control Pragmas

1/5
This subclause defines pragmas that specify aspects that help control the elaboration order of library_items.

#### Syntax

2/5
The following pragmas are defined with the given forms:
3/5
pragma Preelaborate[(library_unit_name)];
4/5
pragma Preelaborable_Initialization(direct_name);
5/5
pragma Pure[(library_unit_name)];
6/5
pragma Elaborate_Body[(library_unit_name)];
7/5
Pragmas Preelaborate, Pure, and Elaborate_Body are library unit pragmas.

#### Static Semantics

8/5
A pragma Preelaborate specifies that a library unit is preelaborated, namely that the Preelaborate aspect (see 10.2.1) of the library unit is True.
9/5
A pragma Pure specifies that a library unit is declared pure, namely that the Pure aspect (see 10.2.1) of the library unit is True.
10/5
A pragma Elaborate_Body specifies that a library unit requires a completion, namely that the Elaborate_Body aspect (see 10.2.1) of the library unit is True.

#### Legality Rules

11/5
A pragma Preelaborable_Initialization specifies that the Preelaborable_Initialization aspect (see 10.2.1) for a composite type is True. This pragma shall appear in the visible part of a package or generic package.
12/5
If the pragma appears in the first declaration list of a package_specification, then the direct_name shall denote the first subtype of a composite type, and the type shall be declared immediately within the same package as the pragma. The composite type shall be one for which the Preelaborable_Initialization aspect can be directly specified as True. In addition to the places where Legality Rules normally apply (see 12.3), these rules also apply in the private part of an instance of a generic unit.
13/5
If the pragma appears in a generic_formal_part, then the direct_name shall denote a type declared in the same generic_formal_part as the pragma, and be one for which the Preelaborable_Initialization aspect can be directly specified as True.
14/5
NOTE Pragmas Elaborate and Elaborate_All, which do not have associated aspects, are found in 10.2.1.

Ada 2005 and 2012 Editions sponsored in part by Ada-Europe