+2019-07-09 Piotr Trojanek <trojanek@adacore.com>
+
+ * ali.ads, bindo-graphs.adb, bindo-validators.adb, clean.adb,
+ doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, einfo.ads,
+ exp_aggr.adb, exp_ch13.adb, exp_ch4.adb, exp_ch5.adb,
+ exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_pakd.adb,
+ fname-uf.ads, gnatlink.adb, inline.adb, lib.ads, make.adb,
+ namet.ads, opt.ads, par-ch4.adb, par-ch6.adb, par-labl.adb,
+ prep.adb, sem_aggr.adb, sem_ch13.adb, sem_ch4.adb, sem_ch5.adb,
+ sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch8.adb, sem_dim.adb,
+ sem_disp.adb, sem_prag.adb, sem_res.adb, sem_warn.adb,
+ sinfo.ads: Replace ". " with ". ". Minor reformatting and typo
+ corrections.
+ * gnat_ugn.texi: Generate.
+
2019-07-09 Hristian Kirtchev <kirtchev@adacore.com>
* bindo.ads: Move type Precedence_Kind from the private to the
No_Component_Reordering : Boolean;
-- Set to True if file was compiled with a configuration pragma file
- -- containing pragma No_Component_Reordering. Not set if 'P' appears
+ -- containing pragma No_Component_Reordering. Not set if 'P' appears
-- in Ignore_Lines.
No_Object : Boolean;
Edge : Library_Graph_Edge_Id) return Boolean;
pragma Inline (Is_Static_Successor_Edge);
-- Determine whether the successor of invocation edge Edge represents a
- -- unit that was compile with the static model.
+ -- unit that was compiled with the static model.
function Links_Vertices_In_Same_Component
(G : Library_Graph;
-- Validate each unit in the elaboration order against the set of
-- units that need to be elaborated.
- for Index in Unit_Id_Tables.First .. Unit_Id_Tables.Last (Order) loop
+ for Index in Unit_Id_Tables.First .. Unit_Id_Tables.Last (Order) loop
Validate_Unit
(U_Id => Order.Table (Index),
Elab_Set => Elab_Set);
then
Project_File_Name :=
new String'
- (Prj (Prj'First + 1 .. Prj'Last));
+ (Prj (Prj'First + 1 .. Prj'Last));
else
Project_File_Name := new String'(Prj);
end if;
* preelaborability of units
-* presence of elaboration control pragmas
+* presence of elaboration-control pragmas
* invocations performed in elaboration code
Ada states that a total elaboration order must exist, but it does not define
what this order is. A compiler is thus tasked with choosing a suitable
elaboration order which satisfies the dependencies imposed by |with| clauses,
-unit categorization, elaboration control pragmas, and invocations performed in
+unit categorization, elaboration-control pragmas, and invocations performed in
elaboration code. Ideally an order that avoids ABE problems should be chosen,
however a compiler may not always find such an order due to complications with
respect to control and data flow.
Checking the Elaboration Order
==============================
-To avoid placing the entire elaboration order burden on the programmer, Ada
+To avoid placing the entire elaboration-order burden on the programmer, Ada
provides three lines of defense:
* *Static semantics*
be elaborated prior to ``Client``.
Removing pragma ``Elaborate_All`` could result in the following incorrect
- elaboration order
+ elaboration order:
::
- All code within all units in a partition is considered to be elaboration
code.
- - Some of the invocations in elaboration code may not take place at runtime
+ - Some of the invocations in elaboration code may not take place at run time
due to conditional execution.
GNAT performs extensive diagnostics on a unit-by-unit basis for all scenarios
all external targets and for all scenarios that may exhibit ABE problems.
The elaboration order is obtained by honoring all |with| clauses, purity and
- preelaborability of units, and elaboration control pragmas. The dynamic model
+ preelaborability of units, and elaboration-control pragmas. The dynamic model
attempts to take all invocations in elaboration code into account. If an
invocation leads to a circularity, GNAT ignores the invocation based on the
assumptions stated above. An order obtained using the dynamic model may fail
- an ABE check at runtime when GNAT ignored an invocation.
+ an ABE check at run time when GNAT ignored an invocation.
The dynamic model is enabled with compiler switch :switch:`-gnatE`.
- Only code at the library level and in package body statements within all
units in a partition is considered to be elaboration code.
- - All invocations in elaboration will take place at runtime, regardless of
+ - All invocations in elaboration will take place at run time, regardless of
conditional execution.
GNAT performs extensive diagnostics on a unit-by-unit basis for all scenarios
all external targets and for all scenarios that may exhibit ABE problems.
The elaboration order is obtained by honoring all |with| clauses, purity and
- preelaborability of units, presence of elaboration control pragmas, and all
+ preelaborability of units, presence of elaboration-control pragmas, and all
invocations in elaboration code. An order obtained using the static model is
guaranteed to be ABE problem-free, excluding dispatching calls and
access-to-subprogram types.
An **elaboration circularity** occurs whenever the elaboration of a set of
units enters a deadlocked state, where each unit is waiting for another unit
to be elaborated. This situation may be the result of improper use of |with|
-clauses, elaboration control pragmas, or invocations in elaboration code.
+clauses, elaboration-control pragmas, or invocations in elaboration code.
-The following example showcases an elaboration circularity.
+The following example exhibits an elaboration circularity.
::
When faced with an elaboration circularity, the programmer should also consider
the tactics given in the suggestions section of the circularity diagnostic.
Depending on the units involved in the circularity, their |with| clauses,
-purity, preelaborability, presence of elaboration control pragmas and
+purity, preelaborability, presence of elaboration-control pragmas and
invocations at elaboration time, the binder may suggest one or more of the
following tactics to eliminate the circularity:
remove pragma Elaborate for unit "..." in unit "..."
- This tactic is suggested when the binder has determine that pragma
- ``Elaborate``
+ This tactic is suggested when the binder has determined that pragma
+ ``Elaborate``:
- Prevents a set of units from being elaborated.
remove pragma Elaborate_All for unit "..." in unit "..."
This tactic is suggested when the binder has determined that pragma
- ``Elaborate_All``
+ ``Elaborate_All``:
- Prevents a set of units from being elaborated.
remove pragma Elaborate_Body in unit "..."
This tactic is suggested when the binder has determined that pragma
- ``Elaborate_Body``
+ ``Elaborate_Body``:
- Prevents a set of units from being elaborated.
use pragma Restrictions (No_Entry_Calls_In_Elaboration_Code)
This tactic is suggested when the binder has determined that a task
- activation at elaboration time
+ activation at elaboration time:
- Prevents a set of units from being elaborated.
use the dynamic elaboration model (compiler switch -gnatE)
This tactic is suggested when the binder has determined that an invocation at
- elaboration time
+ elaboration time:
- Prevents a set of units from being elaborated.
The programmer should analyze this information to determine which units
should be compiled with the dynamic model.
-* Forced dependency elimination
+* Forced-dependency elimination
::
remove the dependency of unit "..." on unit "..." from the argument of switch -f
This tactic is suggested when the binder has determined that a dependency
- present in the forced delboration order file indicated by binder switch
- :switch:`-f`
+ present in the forced-elaboration-order file indicated by binder switch
+ :switch:`-f`:
- Prevents a set of units from being elaborated.
- The removal of the dependency will enable the successful ordering of the
units.
- The programmer should edit the forced elaboration order file, remove the
+ The programmer should edit the forced-elaboration-order file, remove the
dependency, and rebind the program.
-* All forced dependency elimination
+* All forced-dependency elimination
::
remove switch -f
- This tactic is suggested in case editing the forced elaboration order file is
+ This tactic is suggested in case editing the forced-elaboration-order file is
not an option.
The programmer should remove binder switch :switch:`-f` from the binder
arguments, and rebind.
-* Multiple circularities diagnostic
+* Multiple-circularities diagnostic
::
diagnose all circularities (binder switch -d_C)
- By default, the binder will diagnose only the highest precedence circularity.
+ By default, the binder will diagnose only the highest-precedence circularity.
If the program contains multiple circularities, the binder will suggest the
use of binder switch :switch:`-d_C` in order to obtain the diagnostics of all
circularities.
circularity, the programmer should consider using one of the legacy elaboration
models, in the following order:
-* Use the pre-20.x legacy elaboration order model, with binder switch
+* Use the pre-20.x legacy elaboration-order model, with binder switch
:switch:`-H`.
* Use both pre-18.x and pre-20.x legacy elaboration models, with compiler
switch :switch:`-gnatH` and binder switch :switch:`-H`.
-* Use the relaxed static elaboration model, with compiler switches
+* Use the relaxed static-elaboration model, with compiler switches
:switch:`-gnatH` :switch:`-gnatJ` and binder switch :switch:`-H`.
-* Use the relaxed dynamic elaboration model, with compiler switches
+* Use the relaxed dynamic-elaboration model, with compiler switches
:switch:`-gnatH` :switch:`-gnatJ` :switch:`-gnatE` and binder switch
:switch:`-H`.
* If none of the steps outlined above resolve the circularity, use a more
permissive elaboration model, in the following order:
- - Use the pre-20.x legacy elaboration order model, with binder switch
+ - Use the pre-20.x legacy elaboration-order model, with binder switch
:switch:`-H`.
- Use both pre-18.x and pre-20.x legacy elaboration models, with compiler
-- an attempt to set the attribute on a subtype will raise an assert error.
-- Other attributes are noted as applying to the [implementation base type
--- only]. These are representation attributes which must always apply to a
+-- only]. These are representation attributes which must always apply to a
-- full non-private type, and where the attributes are always on the full
-- type. The attribute can be referenced on a subtype (and automatically
-- retrieves the value from the implementation base type). However, it is an
procedure Convert_To_Assignments (N : Node_Id; Typ : Entity_Id);
-- Transform a record aggregate into a sequence of assignments performed
- -- component by component. N is an N_Aggregate or N_Extension_Aggregate.
+ -- component by component. N is an N_Aggregate or N_Extension_Aggregate.
-- Typ is the type of the record aggregate.
procedure Expand_Record_Aggregate
Val := 0;
Packed_Num := 0;
- -- Account for endianness. See corresponding comment in
+ -- Account for endianness. See corresponding comment in
-- Packed_Array_Aggregate_Handled concerning the following.
if Bytes_Big_Endian
Convert_To (RTE (RE_Size_Type), Expression (N)));
-- If the clause is not generated by an aspect, insert
- -- the assignment here. Freezing rules ensure that this
+ -- the assignment here. Freezing rules ensure that this
-- is safe, or clause will have been rejected already.
if Is_List_Member (N) then
end if;
-- If the record representation clause has no components, then
- -- completely remove it. Note that we also have to remove
+ -- completely remove it. Note that we also have to remove
-- ourself from the Rep Item list.
if Is_Empty_List (Component_Clauses (N)) then
-- Obj1 : Enclosing_Non_UU_Type;
-- Obj2 : Enclosing_Non_UU_Type (1);
- -- ... Obj1 = Obj2 ...
+ -- ... Obj1 = Obj2 ...
-- Generated code:
-- -- Default_Iterator aspect of Vector. This increments Lock,
-- -- disallowing tampering with cursors. Unfortunately, it does not
-- -- increment Busy. The result of Iterate is Limited_Controlled;
- -- -- finalization will decrement Lock. This is a build-in-place
+ -- -- finalization will decrement Lock. This is a build-in-place
-- -- dispatching call to Iterate.
-- Cur : Cursor := First (Iter); -- or Last
-- ???
-- A further case that requires special handling
- -- is the common idiom E.all'access. If E is a
+ -- is the common idiom E.all'access. If E is a
-- formal of the enclosing subprogram, the
-- accessibility of the expression is that of E.
-- The presence of an address clause complicates the build-in-place
-- expansion because the indicated address must be processed before
-- the indirect call is generated (including the definition of a
- -- local pointer to the object). The address clause may come from
+ -- local pointer to the object). The address clause may come from
-- an aspect specification or from an explicit attribute
-- specification appearing after the object declaration. These two
-- cases require different processing.
-- name. Before generating the proper call to one of these operations we
-- check whether Typ is known to be controlled at the point of definition.
-- If it is not then we must retrieve the hidden operation of the parent
- -- and use it instead. This is one case that might be solved more cleanly
+ -- and use it instead. This is one case that might be solved more cleanly
-- once Overriding pragmas or declarations are in place.
function Contains_Subprogram (Blk : Entity_Id) return Boolean;
-- <actualN> := P.<formalN>;
procedure Reset_Scopes_To (Bod : Node_Id; E : Entity_Id);
- -- Reset the scope of declarations and blocks at the top level of Bod
- -- to be E. Bod is either a block or a subprogram body. Used after
- -- expanding various kinds of entry bodies into their corresponding
- -- constructs. This is needed during unnesting to determine whether a
- -- body generated for an entry or an accept alternative includes uplevel
- -- references.
+ -- Reset the scope of declarations and blocks at the top level of Bod to
+ -- be E. Bod is either a block or a subprogram body. Used after expanding
+ -- various kinds of entry bodies into their corresponding constructs. This
+ -- is needed during unnesting to determine whether a body generated for an
+ -- entry or an accept alternative includes uplevel references.
function Trivial_Accept_OK return Boolean;
-- If there is no DO-END block for an accept, or if the DO-END block has
Analyze (N);
- -- Some items in Decls used to be in the N_Block in E_Call that
- -- is constructed in Expand_Entry_Call, and are now in the new
- -- Block into which N has been rewritten. Adjust their scopes
- -- to reflect that.
+ -- Some items in Decls used to be in the N_Block in E_Call that is
+ -- constructed in Expand_Entry_Call, and are now in the new Block
+ -- into which N has been rewritten. Adjust their scopes to reflect that.
if Nkind (E_Call) = N_Block_Statement then
Obj := First_Entity (Entity (Identifier (E_Call)));
-- If we are building the initialization procedure for a packed array,
-- and Initialize_Scalars is enabled, each component assignment is an
- -- out-of-range value by design. Compile this value without checks,
+ -- out-of-range value by design. Compile this value without checks,
-- because a call to the array init_proc must not raise an exception.
-- Condition is not consistent with description above, Within_Init_Proc
Dot : String_Ptr;
Cas : Casing_Type);
-- This is called to process a Source_File_Name pragma whose first
- -- argument is a file name pattern string. Pat is this pattern string,
+ -- argument is a file name pattern string. Pat is this pattern string,
-- which contains an asterisk to correspond to the unit. Typ is one of
-- 'b'/'s'/'u' for body/spec/subunit, Dot is the separator string
-- for child/subunit names, and Cas is one of Lower/Upper/Mixed
preelaborability of units
@item
-presence of elaboration control pragmas
+presence of elaboration-control pragmas
@item
invocations performed in elaboration code
Ada states that a total elaboration order must exist, but it does not define
what this order is. A compiler is thus tasked with choosing a suitable
elaboration order which satisfies the dependencies imposed by @emph{with} clauses,
-unit categorization, elaboration control pragmas, and invocations performed in
+unit categorization, elaboration-control pragmas, and invocations performed in
elaboration code. Ideally an order that avoids ABE problems should be chosen,
however a compiler may not always find such an order due to complications with
respect to control and data flow.
@section Checking the Elaboration Order
-To avoid placing the entire elaboration order burden on the programmer, Ada
+To avoid placing the entire elaboration-order burden on the programmer, Ada
provides three lines of defense:
be elaborated prior to @code{Client}.
Removing pragma @code{Elaborate_All} could result in the following incorrect
-elaboration order
+elaboration order:
@example
spec of Math
code.
@item
-Some of the invocations in elaboration code may not take place at runtime
+Some of the invocations in elaboration code may not take place at run time
due to conditional execution.
@end itemize
all external targets and for all scenarios that may exhibit ABE problems.
The elaboration order is obtained by honoring all @emph{with} clauses, purity and
-preelaborability of units, and elaboration control pragmas. The dynamic model
+preelaborability of units, and elaboration-control pragmas. The dynamic model
attempts to take all invocations in elaboration code into account. If an
invocation leads to a circularity, GNAT ignores the invocation based on the
assumptions stated above. An order obtained using the dynamic model may fail
-an ABE check at runtime when GNAT ignored an invocation.
+an ABE check at run time when GNAT ignored an invocation.
The dynamic model is enabled with compiler switch @code{-gnatE}.
@end itemize
units in a partition is considered to be elaboration code.
@item
-All invocations in elaboration will take place at runtime, regardless of
+All invocations in elaboration will take place at run time, regardless of
conditional execution.
@end itemize
all external targets and for all scenarios that may exhibit ABE problems.
The elaboration order is obtained by honoring all @emph{with} clauses, purity and
-preelaborability of units, presence of elaboration control pragmas, and all
+preelaborability of units, presence of elaboration-control pragmas, and all
invocations in elaboration code. An order obtained using the static model is
guaranteed to be ABE problem-free, excluding dispatching calls and
access-to-subprogram types.
An @strong{elaboration circularity} occurs whenever the elaboration of a set of
units enters a deadlocked state, where each unit is waiting for another unit
to be elaborated. This situation may be the result of improper use of @emph{with}
-clauses, elaboration control pragmas, or invocations in elaboration code.
+clauses, elaboration-control pragmas, or invocations in elaboration code.
-The following example showcases an elaboration circularity.
+The following example exhibits an elaboration circularity.
@quotation
When faced with an elaboration circularity, the programmer should also consider
the tactics given in the suggestions section of the circularity diagnostic.
Depending on the units involved in the circularity, their @emph{with} clauses,
-purity, preelaborability, presence of elaboration control pragmas and
+purity, preelaborability, presence of elaboration-control pragmas and
invocations at elaboration time, the binder may suggest one or more of the
following tactics to eliminate the circularity:
remove pragma Elaborate for unit "..." in unit "..."
@end example
-This tactic is suggested when the binder has determine that pragma
-@code{Elaborate}
+This tactic is suggested when the binder has determined that pragma
+@code{Elaborate}:
@itemize -
@end example
This tactic is suggested when the binder has determined that pragma
-@code{Elaborate_All}
+@code{Elaborate_All}:
@itemize -
@end example
This tactic is suggested when the binder has determined that pragma
-@code{Elaborate_Body}
+@code{Elaborate_Body}:
@itemize -
@end example
This tactic is suggested when the binder has determined that a task
-activation at elaboration time
+activation at elaboration time:
@itemize -
@end example
This tactic is suggested when the binder has determined that an invocation at
-elaboration time
+elaboration time:
@itemize -
should be compiled with the dynamic model.
@item
-Forced dependency elimination
+Forced-dependency elimination
@example
remove the dependency of unit "..." on unit "..." from the argument of switch -f
@end example
This tactic is suggested when the binder has determined that a dependency
-present in the forced delboration order file indicated by binder switch
-@code{-f}
+present in the forced-elaboration-order file indicated by binder switch
+@code{-f}:
@itemize -
units.
@end itemize
-The programmer should edit the forced elaboration order file, remove the
+The programmer should edit the forced-elaboration-order file, remove the
dependency, and rebind the program.
@item
-All forced dependency elimination
+All forced-dependency elimination
@example
remove switch -f
@end example
-This tactic is suggested in case editing the forced elaboration order file is
+This tactic is suggested in case editing the forced-elaboration-order file is
not an option.
The programmer should remove binder switch @code{-f} from the binder
arguments, and rebind.
@item
-Multiple circularities diagnostic
+Multiple-circularities diagnostic
@example
diagnose all circularities (binder switch -d_C)
@end example
-By default, the binder will diagnose only the highest precedence circularity.
+By default, the binder will diagnose only the highest-precedence circularity.
If the program contains multiple circularities, the binder will suggest the
use of binder switch @code{-d_C} in order to obtain the diagnostics of all
circularities.
@itemize *
@item
-Use the pre-20.x legacy elaboration order model, with binder switch
+Use the pre-20.x legacy elaboration-order model, with binder switch
@code{-H}.
@item
switch @code{-gnatH} and binder switch @code{-H}.
@item
-Use the relaxed static elaboration model, with compiler switches
+Use the relaxed static-elaboration model, with compiler switches
@code{-gnatH} @code{-gnatJ} and binder switch @code{-H}.
@item
-Use the relaxed dynamic elaboration model, with compiler switches
+Use the relaxed dynamic-elaboration model, with compiler switches
@code{-gnatH} @code{-gnatJ} @code{-gnatE} and binder switch
@code{-H}.
@end itemize
@itemize -
@item
-Use the pre-20.x legacy elaboration order model, with binder switch
+Use the pre-20.x legacy elaboration-order model, with binder switch
@code{-H}.
@item
when 'v' =>
- -- Support "double" verbose mode. Second -v
+ -- Support "double" verbose mode. Second -v
-- gets sent to the linker and binder phases.
if Verbose_Mode then
end Link_Step;
-- Only keep the binder output file and it's associated object
- -- file if compiling with the -g option. These files are only
+ -- file if compiling with the -g option. These files are only
-- useful if debugging.
if not Debug_Flag_Present then
-- occurrences of pragmas referencing the formals are removed since
-- they have no meaning when the body is inlined and the formals are
-- rewritten (the analysis of the non-inlined body will handle these
- -- pragmas). A new internal name is associated with Body_To_Inline.
+ -- pragmas). A new internal name is associated with Body_To_Inline.
------------------------------
-- Generate_Subprogram_Body --
-- clause. The First entry is the main unit. The second entry, if present
-- is a unit on which the first unit depends, etc. This stack is used to
-- generate error messages showing the dependency chain if a file is not
- -- found, or whether a true circular dependency exists. The Load_Unit
+ -- found, or whether a true circular dependency exists. The Load_Unit
-- function makes an entry in this table when it is called, and removes
-- the entry just before it returns.
-- linker). For the sake of convenience, some program specific switches
-- can be passed directly on the gnatmake command line. This procedure
-- records these switches so that gnatmake can pass them to the right
- -- program. S is the switch to be added at the end of the command line
+ -- program. S is the switch to be added at the end of the command line
-- for Program if Append_Switch is True. If Append_Switch is False S is
-- added at the beginning of the command line.
-- Uhh encoding (hh = hex code), other 16-bit wide character values are
-- stored using the Whhhh (hhhh = hex code) encoding, and other 32-bit wide
-- wide character values are stored using the WWhhhhhhhh (hhhhhhhh = hex
- -- code). Note that this procedure does not fold upper case letters (they
+ -- code). Note that this procedure does not fold upper case letters (they
-- are stored using the Uhh encoding).
procedure Set_Character_Literal_Name
-- set by the command line switches -gnat83/95/2005/2012, and possibly
-- modified by the use of configuration pragmas Ada_*. This switch is used
-- to set the initial value for Ada_Version mode at the start of analysis
- -- of a unit. Note however that the setting of this flag is ignored for
+ -- of a unit. Note however that the setting of this flag is ignored for
-- internal and predefined units (which are always compiled in the most up
-- to date version of Ada).
-- capacity-exceeded error. The purpose of this trick is to avoid
-- creating a deeply nested tree, which would cause deep recursion
-- during semantics, causing stack overflow. This way, we can handle
- -- enormous concatenations in the normal case of predefined "&". We
+ -- enormous concatenations in the normal case of predefined "&". We
-- first build up the normal tree, and then rewrite it if
-- appropriate.
Look_Ahead : loop
-- If we run into a semicolon, then assume that a
- -- colon was missing, e.g. Parms (X Y; ...). Also
+ -- colon was missing, e.g. Parms (X Y; ...). Also
-- assume missing colon on EOF (a real disaster)
-- and on a right paren, e.g. Parms (X Y), and also
-- on an assignment symbol, e.g. Parms (X Y := ..)
-- then we have an error.
-- Note that in the worst case, this is quadratic in the number
- -- of labels. However, labels are not all that common, and this
+ -- of labels. However, labels are not all that common, and this
-- is only called for explicit labels.
-- ???Nonetheless, the efficiency could be improved. For example,
------------------
procedure List_Symbols (Foreword : String) is
- Order : array (0 .. Integer (Symbol_Table.Last (Mapping)))
+ Order : array (0 .. Integer (Symbol_Table.Last (Mapping)))
of Symbol_Id;
-- After alphabetical sorting, this array stores the indexes of the
-- symbols in the order they are displayed.
-- If the aggregate has box-initialized components, its type must be
-- frozen so that initialization procedures can properly be called
- -- in the resolution that follows. The replacement of boxes with
+ -- in the resolution that follows. The replacement of boxes with
-- initialization calls is properly an expansion activity but it must
-- be done during resolution.
begin
-- A representation item is either subtype-specific (Size and Alignment
- -- clauses) or type-related (all others). Subtype-specific aspects may
+ -- clauses) or type-related (all others). Subtype-specific aspects may
-- differ for different subtypes of the same type (RM 13.1.8).
-- A derived type inherits each type-related representation aspect of
function Is_Derived_Type_With_Constraint return Boolean;
-- Check whether T is a derived type with an explicit constraint, in
-- which case the constraint has frozen the type and the item is too
- -- late. This compensates for the fact that for derived scalar types
+ -- late. This compensates for the fact that for derived scalar types
-- we freeze the base type unconditionally on account of a long-standing
-- issue in gigi.
-- If the case expression is a formal object of mode in out, then
-- treat it as having a nonstatic subtype by forcing use of the base
- -- type (which has to get passed to Check_Case_Choices below). Also
+ -- type (which has to get passed to Check_Case_Choices below). Also
-- use base type when the case expression is parenthesized.
if Paren_Count (Expr) > 0
-- In_Parameter, but for now we examine the formal that
-- corresponds to the indexing, and assume that variable
-- indexing is required if some interpretation has an
- -- assignable formal at that position. Still does not
+ -- assignable formal at that position. Still does not
-- cover the most complex cases ???
if Is_Overloaded (Name (Parent (Par))) then
else
-- A quantified expression that appears in a pre/post condition
- -- is preanalyzed several times. If the range is given by an
+ -- is preanalyzed several times. If the range is given by an
-- attribute reference it is rewritten as a range, and this is
-- done even with expansion disabled. If the type is already set
-- do not reanalyze, because a range with static bounds may be
-- If the expander is not active then we want to analyze the loop body
-- now even in the Ada 2012 iterator case, since the rewriting will not
-- be done. Insert the loop variable in the current scope, if not done
- -- when analysing the iteration scheme. Set its kind properly to detect
+ -- when analysing the iteration scheme. Set its kind properly to detect
-- improper uses in the loop body.
-- In GNATprove mode, we do one of the above depending on the kind of
-- Variables referenced within a loop subject to possible OpenACC
-- offloading may be implicitly written to as part of the OpenACC
- -- transaction. Clear flags possibly conveying that they are constant,
+ -- transaction. Clear flags possibly conveying that they are constant,
-- set for example when the code does not explicitly assign them.
if Is_OpenAcc_Environment (Stmt) then
end if;
-- If we failed to find a label, it means the implicit declaration
- -- of the label was hidden. A for-loop parameter can do this to
+ -- of the label was hidden. A for-loop parameter can do this to
-- a label with the same name inside the loop, since the implicit
-- label declaration is in the innermost enclosing body or block
-- statement.
-- Here, S is "function ... return T;" declared in
-- the private part, not overriding some visible
- -- operation. That's illegal in the tagged case
+ -- operation. That's illegal in the tagged case
-- (but not if the private type is untagged).
if ((Present (Partial_View)
Overridden_Subp : Entity_Id;
Is_Primitive : Boolean);
-- Verify the consistency of an overriding_indicator given for subprogram
- -- declaration, body, renaming, or instantiation. Overridden_Subp is set
+ -- declaration, body, renaming, or instantiation. Overridden_Subp is set
-- if the scope where we are introducing the subprogram contains a
-- type-conformant subprogram that becomes hidden by the new subprogram.
-- Is_Primitive indicates whether the subprogram is primitive.
end if;
-- There may be inherited private subprograms that need to be declared,
- -- even in the absence of an explicit private part. If there are any
+ -- even in the absence of an explicit private part. If there are any
-- public declarations in the package and the package is a public child
-- unit, then an implicit private part is assumed.
if Scope_Stack.Last > Scope_Stack.First then
SST.Component_Alignment_Default :=
Scope_Stack.Table
- (Scope_Stack.Last - 1). Component_Alignment_Default;
+ (Scope_Stack.Last - 1).Component_Alignment_Default;
-- Otherwise, this is the first scope being pushed on the scope
-- stack. Inherit the component alignment from the configuration
type Symbol_Array is
array (Dimension_Position range
- Low_Position_Bound .. High_Position_Bound) of String_Id;
+ Low_Position_Bound .. High_Position_Bound) of String_Id;
-- Store the symbols of all units within a system
No_Symbols : constant Symbol_Array := (others => No_String);
type Dimension_Type is
array (Dimension_Position range
- Low_Position_Bound .. High_Position_Bound) of Rational;
+ Low_Position_Bound .. High_Position_Bound) of Rational;
Null_Dimension : constant Dimension_Type := (others => Zero);
New_Aspects := Empty_List;
List_Of_Dims := New_List;
- for Position in Dims_Of_N'First .. System.Count loop
+ for Position in Dims_Of_N'First .. System.Count loop
Dim_Power := Dims_Of_N (Position);
Append_To (List_Of_Dims,
Make_Op_Divide (Loc,
-- System.Dim.Float_IO or System.Dim.Integer_IO, the default string
-- parameter is rewritten to include the unit symbol (or the dimension
-- symbols if not a defined quantity) in the output of a dimensioned
- -- object. If a value is already supplied by the user for the parameter
+ -- object. If a value is already supplied by the user for the parameter
-- Symbol, it is used as is.
-- Case 1. Item is dimensionless
-- We need to determine whether the context of the call
-- provides a tag to make the call dispatching. This requires
-- the call to be the actual in an enclosing call, and that
- -- actual must be controlling. If the call is an operand of
+ -- actual must be controlling. If the call is an operand of
-- equality, the other operand must not ve abstract.
if not Is_Tagged_Type (Typ)
-- Otherwise we have a call to an overridden primitive, and we
-- will create a common class-wide clone for the body of
- -- original operation and its eventual inherited versions. If
+ -- original operation and its eventual inherited versions. If
-- the original operation dispatches on result it is never
-- inherited and there is no need for a clone. There is not
-- need for a clone either in GNATprove mode, as cases that
Typ : Entity_Id;
Is_Comp : Boolean);
-- Internal procedure for Resolve_Op_Concat to resolve one operand of
- -- concatenation operator. The operand is either of the array type or of
+ -- concatenation operator. The operand is either of the array type or of
-- the component type. If the operand is an aggregate, and the component
-- type is composite, this is ambiguous if component type has aggregates.
-- Flag any unused with clauses. For a subunit, check only the units
-- in its context, not those of the parent, which may be needed by other
- -- subunits. We will get the full warnings when we compile the parent,
+ -- subunits. We will get the full warnings when we compile the parent,
-- but the following is helpful when compiling a subunit by itself.
if Nkind (Unit (Cunit (Main_Unit))) = N_Subunit then
-- conversion node is introduced to represent the required check.
-- A special case arises for the arguments of the Pred/Succ attributes.
- -- Here the range check needed is against First + 1 .. Last (Pred) or
+ -- Here the range check needed is against First + 1 .. Last (Pred) or
-- First .. Last - 1 (Succ) of the corresponding base type. Essentially
-- these checks are what would be performed within the implicit body of
-- the functions that correspond to these attributes. In these cases,