Commit 2cc7967f by Arnaud Charlet

[multiple changes]

2016-04-21  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
	reformatting.

2016-04-21  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.adb (Denotes_Iterator): Use root type to determine
	whether the ultimate ancestor is the predefined iterator
	interface pakage.
	* exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
	and avoid reuse of Pack local variable.

2016-04-21  Olivier Hainque  <hainque@adacore.com>

	* system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
	system-vxworks-ppc.ads, system-vxworks-m68k.ads,
	system-vxworks-mips.ads, system-vxworks-x86.ads: Define
	Executable_Extension to ".out".

From-SVN: r235304
parent 29a56f61
2016-04-21 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb, exp_util.adb, sem_ch13.adb, exp_unst.adb: Minor
reformatting.
2016-04-21 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Denotes_Iterator): Use root type to determine
whether the ultimate ancestor is the predefined iterator
interface pakage.
* exp_ch5.adb (Expand_Iterator_Over_Container): simplify code
and avoid reuse of Pack local variable.
2016-04-21 Olivier Hainque <hainque@adacore.com>
* system-vxworks-arm.ads, system-vxworks-sparcv9.ads,
system-vxworks-ppc.ads, system-vxworks-m68k.ads,
system-vxworks-mips.ads, system-vxworks-x86.ads: Define
Executable_Extension to ".out".
2016-04-21 Javier Miranda <miranda@adacore.com> 2016-04-21 Javier Miranda <miranda@adacore.com>
* frontend.adb: Update call to Unnest_Subprograms. * frontend.adb: Update call to Unnest_Subprograms.
......
...@@ -1721,7 +1721,6 @@ package body Exp_Unst is ...@@ -1721,7 +1721,6 @@ package body Exp_Unst is
------------------------ ------------------------
procedure Unnest_Subprograms (N : Node_Id) is procedure Unnest_Subprograms (N : Node_Id) is
function Search_Subprograms (N : Node_Id) return Traverse_Result; function Search_Subprograms (N : Node_Id) return Traverse_Result;
-- Tree visitor that search for outer level procedures with nested -- Tree visitor that search for outer level procedures with nested
-- subprograms and invokes Unnest_Subprogram() -- subprograms and invokes Unnest_Subprogram()
...@@ -1732,9 +1731,7 @@ package body Exp_Unst is ...@@ -1732,9 +1731,7 @@ package body Exp_Unst is
function Search_Subprograms (N : Node_Id) return Traverse_Result is function Search_Subprograms (N : Node_Id) return Traverse_Result is
begin begin
if Nkind_In (N, N_Subprogram_Body, if Nkind_In (N, N_Subprogram_Body, N_Subprogram_Body_Stub) then
N_Subprogram_Body_Stub)
then
declare declare
Spec_Id : constant Entity_Id := Unique_Defining_Entity (N); Spec_Id : constant Entity_Id := Unique_Defining_Entity (N);
......
...@@ -1728,11 +1728,12 @@ package body Exp_Util is ...@@ -1728,11 +1728,12 @@ package body Exp_Util is
---------------------------------------- ----------------------------------------
function Containing_Package_With_Ext_Axioms function Containing_Package_With_Ext_Axioms
(E : Entity_Id) return Entity_Id is (E : Entity_Id) return Entity_Id
is
begin begin
-- E is the package or generic package which is externally axiomatized -- E is the package or generic package which is externally axiomatized
if Ekind_In (E, E_Package, E_Generic_Package) if Ekind_In (E, E_Generic_Package, E_Package)
and then Has_Annotate_Pragma_For_External_Axiomatization (E) and then Has_Annotate_Pragma_For_External_Axiomatization (E)
then then
return E; return E;
...@@ -1758,6 +1759,7 @@ package body Exp_Util is ...@@ -1758,6 +1759,7 @@ package body Exp_Util is
declare declare
Par : constant Node_Id := Parent (E); Par : constant Node_Id := Parent (E);
Decl : Node_Id; Decl : Node_Id;
begin begin
if Nkind (Par) = N_Defining_Program_Unit_Name then if Nkind (Par) = N_Defining_Program_Unit_Name then
Decl := Parent (Par); Decl := Parent (Par);
......
...@@ -8438,11 +8438,11 @@ package body Sem_Ch13 is ...@@ -8438,11 +8438,11 @@ package body Sem_Ch13 is
-- Entity for argument of separate Predicate procedure when exceptions -- Entity for argument of separate Predicate procedure when exceptions
-- are present in expression. -- are present in expression.
FDecl : Node_Id; FDecl : Node_Id;
-- The function declaration. -- The function declaration
SId : Entity_Id; SId : Entity_Id;
-- Its entity. -- Its entity
Raise_Expression_Present : Boolean := False; Raise_Expression_Present : Boolean := False;
-- Set True if Expr has at least one Raise_Expression -- Set True if Expr has at least one Raise_Expression
...@@ -8725,6 +8725,7 @@ package body Sem_Ch13 is ...@@ -8725,6 +8725,7 @@ package body Sem_Ch13 is
Add_Call (Atyp); Add_Call (Atyp);
end if; end if;
end; end;
-- Add Predicates for the current type -- Add Predicates for the current type
Add_Predicates; Add_Predicates;
...@@ -8842,7 +8843,7 @@ package body Sem_Ch13 is ...@@ -8842,7 +8843,7 @@ package body Sem_Ch13 is
Insert_Before_And_Analyze (N, FDecl); Insert_Before_And_Analyze (N, FDecl);
end if; end if;
Insert_After_And_Analyze (N, FBody); Insert_After_And_Analyze (N, FBody);
-- Static predicate functions are always side-effect free, and -- Static predicate functions are always side-effect free, and
-- in most cases dynamic predicate functions are as well. Mark -- in most cases dynamic predicate functions are as well. Mark
...@@ -9065,7 +9066,8 @@ package body Sem_Ch13 is ...@@ -9065,7 +9066,8 @@ package body Sem_Ch13 is
Loc : constant Source_Ptr := Sloc (Typ); Loc : constant Source_Ptr := Sloc (Typ);
Object_Entity : constant Entity_Id := Object_Entity : constant Entity_Id :=
Make_Defining_Identifier (Loc, Chars => New_Internal_Name ('I')); Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('I'));
-- The formal parameter of the function -- The formal parameter of the function
...@@ -12613,9 +12615,10 @@ package body Sem_Ch13 is ...@@ -12613,9 +12615,10 @@ package body Sem_Ch13 is
then then
Find_Selected_Component (Parent (N)); Find_Selected_Component (Parent (N));
end if; end if;
return Skip; return Skip;
elsif Nkind (N) = N_Identifier and then Chars (N) /= Chars (E) then elsif Nkind (N) = N_Identifier and then Chars (N) /= Chars (E) then
Find_Direct_Name (N); Find_Direct_Name (N);
Set_Entity (N, Empty); Set_Entity (N, Empty);
end if; end if;
...@@ -12625,6 +12628,8 @@ package body Sem_Ch13 is ...@@ -12625,6 +12628,8 @@ package body Sem_Ch13 is
procedure Resolve_Aspect_Expression is new Traverse_Proc (Resolve_Name); procedure Resolve_Aspect_Expression is new Traverse_Proc (Resolve_Name);
-- Start of processing for Resolve_Aspect_Expressions
begin begin
ASN := First_Rep_Item (E); ASN := First_Rep_Item (E);
while Present (ASN) loop while Present (ASN) loop
...@@ -12637,7 +12642,7 @@ package body Sem_Ch13 is ...@@ -12637,7 +12642,7 @@ package body Sem_Ch13 is
-- subprograms, or that may mention current instances of -- subprograms, or that may mention current instances of
-- types. These will require special handling (???TBD). -- types. These will require special handling (???TBD).
when Aspect_Predicate | when Aspect_Predicate |
Aspect_Predicate_Failure | Aspect_Predicate_Failure |
Aspect_Invariant => Aspect_Invariant =>
null; null;
...@@ -12645,13 +12650,13 @@ package body Sem_Ch13 is ...@@ -12645,13 +12650,13 @@ package body Sem_Ch13 is
when Aspect_Static_Predicate | when Aspect_Static_Predicate |
Aspect_Dynamic_Predicate => Aspect_Dynamic_Predicate =>
-- build predicate function specification and preanalyze -- Build predicate function specification and preanalyze
-- expression after type replacement. -- expression after type replacement.
if No (Predicate_Function (E)) then if No (Predicate_Function (E)) then
declare declare
FDecl : constant Node_Id := FDecl : constant Node_Id :=
Build_Predicate_Function_Declaration (E); Build_Predicate_Function_Declaration (E);
pragma Unreferenced (FDecl); pragma Unreferenced (FDecl);
begin begin
Resolve_Aspect_Expression (Expr); Resolve_Aspect_Expression (Expr);
......
...@@ -11826,8 +11826,9 @@ package body Sem_Ch3 is ...@@ -11826,8 +11826,9 @@ package body Sem_Ch3 is
if Has_Predicates (Priv) then if Has_Predicates (Priv) then
Set_Has_Predicates (Full); Set_Has_Predicates (Full);
if Present (Predicate_Function (Priv)) if Present (Predicate_Function (Priv))
and then No (Predicate_Function (Full)) and then No (Predicate_Function (Full))
then then
Set_Predicate_Function (Full, Predicate_Function (Priv)); Set_Predicate_Function (Full, Predicate_Function (Priv));
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -12650,11 +12650,14 @@ package body Sem_Util is ...@@ -12650,11 +12650,14 @@ package body Sem_Util is
function Denotes_Iterator (Iter_Typ : Entity_Id) return Boolean is function Denotes_Iterator (Iter_Typ : Entity_Id) return Boolean is
begin begin
-- Check that the name matches, and that the ultimate ancestor is in
-- a predefined unit, i.e the one that declares iterator interfaces.
return return
Nam_In (Chars (Iter_Typ), Name_Forward_Iterator, Nam_In (Chars (Iter_Typ), Name_Forward_Iterator,
Name_Reversible_Iterator) Name_Reversible_Iterator)
and then Is_Predefined_File_Name and then Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (Iter_Typ))); (Unit_File_Name (Get_Source_Unit (Root_Type (Iter_Typ))));
end Denotes_Iterator; end Denotes_Iterator;
-- Local variables -- Local variables
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- S p e c -- -- S p e c --
-- (VxWorks Version ARM) -- -- (VxWorks Version ARM) --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -161,4 +161,6 @@ private ...@@ -161,4 +161,6 @@ private
Frontend_Exceptions : constant Boolean := False; Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True; ZCX_By_Default : constant Boolean := True;
Executable_Extension : constant String := ".out";
end System; end System;
...@@ -157,4 +157,6 @@ private ...@@ -157,4 +157,6 @@ private
Frontend_Exceptions : constant Boolean := True; Frontend_Exceptions : constant Boolean := True;
ZCX_By_Default : constant Boolean := False; ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System; end System;
...@@ -157,4 +157,6 @@ private ...@@ -157,4 +157,6 @@ private
Frontend_Exceptions : constant Boolean := True; Frontend_Exceptions : constant Boolean := True;
ZCX_By_Default : constant Boolean := False; ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System; end System;
...@@ -164,4 +164,6 @@ private ...@@ -164,4 +164,6 @@ private
Frontend_Exceptions : constant Boolean := True; Frontend_Exceptions : constant Boolean := True;
ZCX_By_Default : constant Boolean := False; ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System; end System;
...@@ -159,4 +159,6 @@ private ...@@ -159,4 +159,6 @@ private
Frontend_Exceptions : constant Boolean := True; Frontend_Exceptions : constant Boolean := True;
ZCX_By_Default : constant Boolean := False; ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System; end System;
...@@ -161,4 +161,6 @@ private ...@@ -161,4 +161,6 @@ private
Frontend_Exceptions : constant Boolean := True; Frontend_Exceptions : constant Boolean := True;
ZCX_By_Default : constant Boolean := False; ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System; end System;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment