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