Commit dd81163f by Hristian Kirtchev Committed by Pierre-Marie de Rodat

[Ada] Minor reformattings

2018-09-26  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
	opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
	sinfo.ads, snames.ads-tmpl: Minor reformatting.

From-SVN: r264621
parent f8bc3bcb
2018-09-26 Hristian Kirtchev <kirtchev@adacore.com> 2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
* contracts.adb, exp_unst.adb, exp_util.adb, gnat1drv.adb,
opt.ads, par-prag.adb, sem_ch3.adb, sem_ch5.adb, sem_prag.adb,
sinfo.ads, snames.ads-tmpl: Minor reformatting.
2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
* gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of * gcc-interface/Make-lang.in: Add unit GNAT.Sets to the list of
front end sources. front end sources.
* impunit.adb: Add unit GNAT.Sets to the list of predefined * impunit.adb: Add unit GNAT.Sets to the list of predefined
......
...@@ -2858,13 +2858,11 @@ package body Contracts is ...@@ -2858,13 +2858,11 @@ package body Contracts is
------------------------------- -------------------------------
procedure Process_Preconditions_For (Subp_Id : Entity_Id) is procedure Process_Preconditions_For (Subp_Id : Entity_Id) is
Items : constant Node_Id := Contract (Subp_Id); Items : constant Node_Id := Contract (Subp_Id);
Subp_Decl : constant Node_Id := Unit_Declaration_Node (Subp_Id);
Bod : constant Node_Id := Unit_Declaration_Node (Body_Id);
Decl : Node_Id; Decl : Node_Id;
Freeze_T : Boolean; Freeze_T : Boolean;
Prag : Node_Id; Prag : Node_Id;
Subp_Decl : Node_Id;
begin begin
-- Process the contract. If the body is an expression function -- Process the contract. If the body is an expression function
...@@ -2873,12 +2871,13 @@ package body Contracts is ...@@ -2873,12 +2871,13 @@ package body Contracts is
-- its completion by an expression function appear in distinct -- its completion by an expression function appear in distinct
-- declarative lists of the same unit (visible and private). -- declarative lists of the same unit (visible and private).
Freeze_T := Was_Expression_Function (Bod) Freeze_T :=
and then Sloc (Body_Id) /= Sloc (Subp_Id) Was_Expression_Function (Body_Decl)
and then In_Same_Source_Unit (Body_Id, Subp_Id) and then Sloc (Body_Id) /= Sloc (Subp_Id)
and then List_Containing (Bod) /= and then In_Same_Source_Unit (Body_Id, Subp_Id)
List_Containing (Unit_Declaration_Node (Subp_Id)) and then List_Containing (Body_Decl) /=
and then not In_Instance; List_Containing (Subp_Decl)
and then not In_Instance;
if Present (Items) then if Present (Items) then
Prag := Pre_Post_Conditions (Items); Prag := Pre_Post_Conditions (Items);
...@@ -2887,10 +2886,13 @@ package body Contracts is ...@@ -2887,10 +2886,13 @@ package body Contracts is
and then Is_Checked (Prag) and then Is_Checked (Prag)
then then
if Freeze_T if Freeze_T
and then Present (Corresponding_Aspect (Prag)) and then Present (Corresponding_Aspect (Prag))
then then
Freeze_Expr_Types (Subp_Id, Standard_Boolean, Freeze_Expr_Types
Expression (Corresponding_Aspect (Prag)), Bod); (Def_Id => Subp_Id,
Typ => Standard_Boolean,
Expr => Expression (Corresponding_Aspect (Prag)),
N => Body_Decl);
end if; end if;
Prepend_To_Decls_Or_Save (Prag); Prepend_To_Decls_Or_Save (Prag);
...@@ -2905,8 +2907,6 @@ package body Contracts is ...@@ -2905,8 +2907,6 @@ package body Contracts is
-- it must be taken into account. The pragma appears after the -- it must be taken into account. The pragma appears after the
-- stub. -- stub.
Subp_Decl := Unit_Declaration_Node (Subp_Id);
if Nkind (Subp_Decl) = N_Subprogram_Body_Stub then if Nkind (Subp_Decl) = N_Subprogram_Body_Stub then
-- Inspect the declarations following the body stub -- Inspect the declarations following the body stub
......
...@@ -260,8 +260,8 @@ package body Exp_Unst is ...@@ -260,8 +260,8 @@ package body Exp_Unst is
E := Ultimate_Alias (E); E := Ultimate_Alias (E);
-- The body of a protected operation has a different name and -- The body of a protected operation has a different name and
-- has been scanned at this point, and thus has an entry in -- has been scanned at this point, and thus has an entry in the
-- the subprogram table. -- subprogram table.
if E = Sub and then Convention (E) = Convention_Protected then if E = Sub and then Convention (E) = Convention_Protected then
E := Protected_Body_Subprogram (E); E := Protected_Body_Subprogram (E);
...@@ -541,19 +541,17 @@ package body Exp_Unst is ...@@ -541,19 +541,17 @@ package body Exp_Unst is
if Nkind (N) = N_Attribute_Reference then if Nkind (N) = N_Attribute_Reference then
declare declare
Attr : constant Attribute_Id := Attr : constant Attribute_Id :=
Get_Attribute_Id (Attribute_Name (N)); Get_Attribute_Id (Attribute_Name (N));
DT : Boolean := False;
begin begin
if (Attr = Attribute_First if (Attr = Attribute_First
or else Attr = Attribute_Last or else Attr = Attribute_Last
or else Attr = Attribute_Length) or else Attr = Attribute_Length)
and then Is_Constrained (Etype (Prefix (N))) and then Is_Constrained (Etype (Prefix (N)))
then then
declare Check_Static_Type
DT : Boolean := False; (Etype (Prefix (N)), Empty, DT);
begin
Check_Static_Type
(Etype (Prefix (N)), Empty, DT);
end;
end if; end if;
end; end;
end if; end if;
...@@ -2022,21 +2020,23 @@ package body Exp_Unst is ...@@ -2022,21 +2020,23 @@ package body Exp_Unst is
-- N_Loop_Parameter_Specification or to -- N_Loop_Parameter_Specification or to
-- an N_Iterator_Specification. -- an N_Iterator_Specification.
if Nkind_In (Ins, N_Iterator_Specification, if Nkind_In
N_Loop_Parameter_Specification) (Ins, N_Iterator_Specification,
N_Loop_Parameter_Specification)
then then
-- Quantified expression are rewrittne -- Quantified expression are rewritten as
-- as loops during expansion. -- loops during expansion.
if Nkind (Parent (Ins)) = if Nkind (Parent (Ins)) =
N_Quantified_Expression N_Quantified_Expression
then then
null; null;
else else
Ins := Ins :=
First First
(Statements (Parent (Parent (Ins)))); (Statements
(Parent (Parent (Ins))));
Insert_Before (Ins, Asn); Insert_Before (Ins, Asn);
end if; end if;
......
...@@ -9151,10 +9151,10 @@ package body Exp_Util is ...@@ -9151,10 +9151,10 @@ package body Exp_Util is
Aliased_Present => False, Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (Constr_Root, Loc)))); Subtype_Indication => New_Occurrence_Of (Constr_Root, Loc))));
Set_Reverse_Storage_Order (Equiv_Type, Set_Reverse_Storage_Order
Reverse_Storage_Order (Base_Type (Root_Utyp))); (Equiv_Type, Reverse_Storage_Order (Base_Type (Root_Utyp)));
Set_Reverse_Bit_Order (Equiv_Type, Set_Reverse_Bit_Order
Reverse_Bit_Order (Base_Type (Root_Utyp))); (Equiv_Type, Reverse_Bit_Order (Base_Type (Root_Utyp)));
end if; end if;
Append_To (Comp_List, Append_To (Comp_List,
......
...@@ -161,7 +161,7 @@ procedure Gnat1drv is ...@@ -161,7 +161,7 @@ procedure Gnat1drv is
Modify_Tree_For_C := True; Modify_Tree_For_C := True;
end if; end if;
-- -gnatd_A disables generation of ALI files. -- -gnatd_A disables generation of ALI files
if Debug_Flag_Underscore_AA then if Debug_Flag_Underscore_AA then
Disable_ALI_File := True; Disable_ALI_File := True;
......
...@@ -1216,6 +1216,11 @@ package Opt is ...@@ -1216,6 +1216,11 @@ package Opt is
-- cannot be simultaneous compilations with the object files in the same -- cannot be simultaneous compilations with the object files in the same
-- object directory, if project files are used. -- object directory, if project files are used.
OpenAcc_Enabled : Boolean := False;
-- GNAT
-- Indicates whether OpenAcc pragmas should be taken into account. Set to
-- True by the use of -fopenacc.
type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code); type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code);
pragma Ordered (Operating_Mode_Type); pragma Ordered (Operating_Mode_Type);
Operating_Mode : Operating_Mode_Type := Generate_Code; Operating_Mode : Operating_Mode_Type := Generate_Code;
...@@ -2335,21 +2340,11 @@ package Opt is ...@@ -2335,21 +2340,11 @@ package Opt is
-- The only special comment sequence allowed is --! -- The only special comment sequence allowed is --!
-------------
-- OpenAcc --
-------------
OpenAcc_Enabled : Boolean := False;
-- GNAT
-- Indicates whether OpenAcc pragmas should be taken into account.
-- Set True by use of -fopenacc.
-------------------------- --------------------------
-- Private Declarations -- -- Private Declarations --
-------------------------- --------------------------
private private
-- The following type is used to save and restore settings of switches in -- The following type is used to save and restore settings of switches in
-- Opt that represent the configuration (i.e. result of config pragmas). -- Opt that represent the configuration (i.e. result of config pragmas).
......
...@@ -1295,11 +1295,15 @@ begin ...@@ -1295,11 +1295,15 @@ begin
-- All Other Pragmas -- -- All Other Pragmas --
----------------------- -----------------------
-- For all other pragmas, checking and processing is handled -- For all other pragmas, checking and processing is handled entirely in
-- entirely in Sem_Prag, and no further checking is done by Par. -- Sem_Prag, and no further checking is done by Par.
when Pragma_Abort_Defer when Pragma_Abort_Defer
| Pragma_Abstract_State | Pragma_Abstract_State
| Pragma_Acc_Data
| Pragma_Acc_Kernels
| Pragma_Acc_Loop
| Pragma_Acc_Parallel
| Pragma_Async_Readers | Pragma_Async_Readers
| Pragma_Async_Writers | Pragma_Async_Writers
| Pragma_Assertion_Policy | Pragma_Assertion_Policy
...@@ -1516,10 +1520,6 @@ begin ...@@ -1516,10 +1520,6 @@ begin
| Pragma_Warning_As_Error | Pragma_Warning_As_Error
| Pragma_Weak_External | Pragma_Weak_External
| Pragma_Validity_Checks | Pragma_Validity_Checks
| Pragma_Acc_Data
| Pragma_Acc_Kernels
| Pragma_Acc_Loop
| Pragma_Acc_Parallel
=> =>
null; null;
......
...@@ -1919,8 +1919,8 @@ package body Sem_Ch3 is ...@@ -1919,8 +1919,8 @@ package body Sem_Ch3 is
if Is_Limited_Record (Typ) then if Is_Limited_Record (Typ) then
return True; return True;
-- If the root type is limited (and not a limited interface) -- If the root type is limited (and not a limited interface) so is
-- so is the current type -- the current type.
elsif Is_Limited_Record (R) elsif Is_Limited_Record (R)
and then (not Is_Interface (R) or else not Is_Limited_Interface (R)) and then (not Is_Interface (R) or else not Is_Limited_Interface (R))
...@@ -1931,8 +1931,8 @@ package body Sem_Ch3 is ...@@ -1931,8 +1931,8 @@ package body Sem_Ch3 is
-- limited record parent that is not an interface. -- limited record parent that is not an interface.
elsif R /= P elsif R /= P
and then Is_Limited_Record (P) and then Is_Limited_Record (P)
and then not Is_Interface (P) and then not Is_Interface (P)
then then
return True; return True;
......
...@@ -2210,8 +2210,7 @@ package body Sem_Ch5 is ...@@ -2210,8 +2210,7 @@ package body Sem_Ch5 is
if Nkind (Iter_Name) = N_Function_Call if Nkind (Iter_Name) = N_Function_Call
and then Is_Entity_Name (Name (Iter_Name)) and then Is_Entity_Name (Name (Iter_Name))
and then Full_Analysis and then Full_Analysis
and then (In_Assertion_Expr = 0 and then (In_Assertion_Expr = 0 or else Assertions_Enabled)
or else Assertions_Enabled)
then then
Freeze_Before (N, Entity (Name (Iter_Name))); Freeze_Before (N, Entity (Name (Iter_Name)));
end if; end if;
......
...@@ -5134,11 +5134,11 @@ package Sinfo is ...@@ -5134,11 +5134,11 @@ package Sinfo is
-- Iteration_Scheme (Node2) (set to Empty if no iteration scheme) -- Iteration_Scheme (Node2) (set to Empty if no iteration scheme)
-- Statements (List3) -- Statements (List3)
-- End_Label (Node4) -- End_Label (Node4)
-- Is_OpenAcc_Environment (Flag13-Sem)
-- Is_OpenAcc_Loop (Flag14-Sem)
-- Has_Created_Identifier (Flag15) -- Has_Created_Identifier (Flag15)
-- Is_Null_Loop (Flag16) -- Is_Null_Loop (Flag16)
-- Suppress_Loop_Warnings (Flag17) -- Suppress_Loop_Warnings (Flag17)
-- Is_OpenAcc_Environment (Flag13-Sem)
-- Is_OpenAcc_Loop (Flag14-Sem)
-- Note: the parser fills in the Identifier field if there is an -- Note: the parser fills in the Identifier field if there is an
-- explicit loop identifier. Otherwise the parser leaves this field -- explicit loop identifier. Otherwise the parser leaves this field
......
...@@ -864,8 +864,8 @@ package Snames is ...@@ -864,8 +864,8 @@ package Snames is
Name_Warn : constant Name_Id := N + $; Name_Warn : constant Name_Id := N + $;
Name_Working_Storage : constant Name_Id := N + $; Name_Working_Storage : constant Name_Id := N + $;
-- OpenAcc-specific clause names -- OpenAcc-specific clause names for Parallel, Kernels, Data
-- Parallel, Kernels, Data
Name_Acc_If : constant Name_Id := N + $; Name_Acc_If : constant Name_Id := N + $;
Name_Acc_Private : constant Name_Id := N + $; Name_Acc_Private : constant Name_Id := N + $;
Name_Attach : constant Name_Id := N + $; Name_Attach : constant Name_Id := N + $;
...@@ -884,13 +884,15 @@ package Snames is ...@@ -884,13 +884,15 @@ package Snames is
Name_Reduction : constant Name_Id := N + $; Name_Reduction : constant Name_Id := N + $;
Name_Vector_Length : constant Name_Id := N + $; Name_Vector_Length : constant Name_Id := N + $;
Name_Wait : constant Name_Id := N + $; Name_Wait : constant Name_Id := N + $;
-- Loop -- Loop
Name_Auto : constant Name_Id := N + $;
Name_Collapse : constant Name_Id := N + $; Name_Collapse : constant Name_Id := N + $;
Name_Gang : constant Name_Id := N + $; Name_Gang : constant Name_Id := N + $;
Name_Worker : constant Name_Id := N + $;
Name_Seq : constant Name_Id := N + $; Name_Seq : constant Name_Id := N + $;
Name_Auto : constant Name_Id := N + $;
Name_Tile : constant Name_Id := N + $; Name_Tile : constant Name_Id := N + $;
Name_Worker : constant Name_Id := N + $;
-- Names of recognized attributes. The entries with the comment "Ada 83" -- Names of recognized attributes. The entries with the comment "Ada 83"
-- are attributes that are defined in Ada 83, but not in Ada 95. These -- are attributes that are defined in Ada 83, but not in Ada 95. These
......
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