-- transient scope, which leads to premature finalization.
-- This in-place expansion is not performed for limited transient
- -- objects because the initialization is already done in-place.
+ -- objects, because the initialization is already done in place.
if In_Place_Expansion then
- -- Suppress the removal of side effects by general analysis
+ -- Suppress the removal of side effects by general analysis,
-- because this behavior is emulated here. This avoids the
-- generation of a transient scope, which leads to out-of-order
-- adjustment and finalization.
return False;
end if;
- -- If association has a box, no way to determine yet
- -- whether default can be assigned in place.
+ -- If association has a box, no way to determine yet whether
+ -- default can be assigned in place.
elsif Box_Present (Expr) then
return False;
and then Is_Array
and then Check_Component (Prefix (Comp)))
- or else (Nkind_In (Comp, N_Unchecked_Type_Conversion,
- N_Type_Conversion)
+ or else (Nkind_In (Comp, N_Type_Conversion,
+ N_Unchecked_Type_Conversion)
and then Check_Component (Expression (Comp)));
end Check_Component;
return False;
- elsif Nkind (Parent (Expr)) =
- N_Iterated_Component_Association
- then
- -- Ditto for iterated component associations, which in
- -- general require an enclosing loop and involve nonstatic
- -- expressions.
+ elsif Nkind (Parent (Expr)) = N_Iterated_Component_Association then
+
+ -- Ditto for iterated component associations, which in general
+ -- require an enclosing loop and involve nonstatic expressions.
return False;
end if;
Establish_Transient_Scope (N, Manage_Sec_Stack => False);
end if;
- -- If the aggregate is nonlimited, create a temporary since aggregates
- -- have "by copy" semantic. If it is limited and context is an
+ -- If the aggregate is nonlimited, create a temporary, since aggregates
+ -- have "by copy" semantics. If it is limited and context is an
-- assignment, this is a subaggregate for an enclosing aggregate being
-- expanded. It must be built in place, so use target of the current
-- assignment.
Rewrite (Parent (N), Make_Null_Statement (Loc));
-- Do not declare a temporary to initialize an aggregate assigned to an
- -- identifier when in place assignment is possible preserving the
+ -- identifier when in-place assignment is possible, preserving the
-- by-copy semantic of aggregates. This avoids large stack usage and
-- generates more efficient code.
-- case pass it as is to Gigi. Note that a necessary condition for
-- static processing is that the aggregate be fully positional.
- -- 5. If in place aggregate expansion is possible (i.e. no need to create
+ -- 5. If in-place aggregate expansion is possible (i.e. no need to create
-- a temporary) then mark the aggregate as such and return. Otherwise
-- create a new temporary and generate the appropriate initialization
-- code.
-- The type of each index
In_Place_Assign_OK_For_Declaration : Boolean := False;
- -- True if we are to generate an in place assignment for a declaration
+ -- True if we are to generate an in-place assignment for a declaration
Maybe_In_Place_OK : Boolean;
-- If the type is neither controlled nor packed and the aggregate
-- STEP 4
- -- Look if in place aggregate expansion is possible
+ -- Check whether in-place aggregate expansion is possible
-- For object declarations we build the aggregate in place, unless
-- the array is bit-packed.
-- Step 5
- -- In place aggregate expansion is not possible
+ -- In-place aggregate expansion is not possible
else
Maybe_In_Place_OK := False;
Target := New_Copy (Tmp);
end if;
- -- If we are to generate an in place assignment for a declaration or
+ -- If we are to generate an in-place assignment for a declaration or
-- an assignment statement, and the assignment can be done directly
-- by the back end, then do not expand further.
- -- ??? We can also do that if in place expansion is not possible but
+ -- ??? We can also do that if in-place expansion is not possible but
-- then we could go into an infinite recursion.
if (In_Place_Assign_OK_For_Declaration or else Maybe_In_Place_OK)
P : Node_Id := Parent (N);
begin
- -- Aggregates are not supported for non standard rep clauses since
- -- they may lead to extra padding fields in CCG.
+ -- Aggregates are not supported for nonstandard rep clauses, since they
+ -- may lead to extra padding fields in CCG.
if Ekind (Etype (N)) in Record_Kind
and then Has_Non_Standard_Rep (Etype (N))
-- thunk generated for it. Replace a return statement with an assignment
-- to the target of the call, with appropriate conversions if needed.
- function Process_Formals_In_Aspects (N : Node_Id)
- return Traverse_Result;
+ function Process_Formals_In_Aspects (N : Node_Id) return Traverse_Result;
-- Because aspects are linked indirectly to the rest of the tree,
-- replacement of formals appearing in aspect specifications must
-- be performed in a separate pass, using an instantiation of the
-- Process_Formals_In_Aspects --
--------------------------------
- function Process_Formals_In_Aspects (N : Node_Id)
- return Traverse_Result
+ function Process_Formals_In_Aspects
+ (N : Node_Id) return Traverse_Result
is
A : Node_Id;
+
begin
if Has_Aspects (N) then
A := First (Aspect_Specifications (N));
end Process_Formals_In_Aspects;
procedure Replace_Formals_In_Aspects is
- new Traverse_Proc (Process_Formals_In_Aspects);
+ new Traverse_Proc (Process_Formals_In_Aspects);
------------------
-- Process_Sloc --