+2018-05-24 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch7.adb, sem_ch3.adb, sem_res.adb: Minor reformatting.
+
2018-05-24 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Flatten): Add a warning on an others clause in an array
if Present (Mark_Id) then
declare
- Release : Node_Id :=
- Build_SS_Release_Call (Loc, Mark_Id);
+ Release : Node_Id := Build_SS_Release_Call (Loc, Mark_Id);
+
begin
- -- If this is a build-in-place function, then we need to
- -- release the secondary stack, unless we are returning on the
- -- secondary stack. We wrap the release call in:
- -- if BIP_Alloc_Form /= Secondary_Stack then ...
- -- If we are returning on the secondary stack, then releasing
- -- is the caller's responsibility (or caller's caller, or ...).
+ -- If the context is a build-in-place function, the secondary
+ -- stack must be released, unless the build-in-place function
+ -- itself is returning on the secondary stack. Generate:
+ --
+ -- if BIP_Alloc_Form /= Secondary_Stack then
+ -- SS_Release (Mark_Id);
+ -- end if;
+ --
+ -- Note that if the function returns on the secondary stack,
+ -- then the responsibility of reclaiming the space is always
+ -- left to the caller (recursively if needed).
if Nkind (N) = N_Subprogram_Body then
declare
if BIP_SS then
Release :=
Make_If_Statement (Loc,
- Condition =>
+ Condition =>
Make_Op_Ne (Loc,
Left_Opnd =>
New_Occurrence_Of
(Spec_Id, BIP_Alloc_Form), Loc),
Right_Opnd =>
Make_Integer_Literal (Loc,
- UI_From_Int (BIP_Allocation_Form'Pos
- (Secondary_Stack)))),
+ UI_From_Int
+ (BIP_Allocation_Form'Pos
+ (Secondary_Stack)))),
Then_Statements => New_List (Release));
end if;
if Present (Full_View (Parent_Type))
and then not Is_Itype (Derived_Type)
- and then not (Is_Concurrent_Type (Full_View (Parent_Type)))
+ and then not Is_Concurrent_Type (Full_View (Parent_Type))
then
declare
Der_Base : constant Entity_Id := Base_Type (Derived_Type);
if Is_Itype (Def_Id) and then Has_Predicates (T) then
Inherit_Predicate_Flags (Def_Id, T);
- -- Indicate where the predicate function may be found.
+ -- Indicate where the predicate function may be found
if Is_Itype (T) then
if Present (Predicate_Function (Def_Id)) then
if Has_Predicates (Subtype_Mark_Id) then
Inherit_Predicate_Flags (Def_Id, Subtype_Mark_Id);
- -- Indicate where the predicate function may be found.
+ -- Indicate where the predicate function may be found
if No (Predicate_Function (Def_Id)) then
Set_Predicated_Parent (Def_Id, Subtype_Mark_Id);
end if;
end if;
- -- We may be resolving an entity within expanded code, so a reference
- -- to an entity should be ignored when calculating effective use clauses
- -- to avoid inappropriate marking.
+ -- We may be resolving an entity within expanded code, so a reference to
+ -- an entity should be ignored when calculating effective use clauses to
+ -- avoid inappropriate marking.
if Comes_From_Source (N) then
Mark_Use_Clauses (E);