Commit 29c64a0f by Hristian Kirtchev Committed by Pierre-Marie de Rodat

[Ada] Minor reformatting

2019-07-11  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* checks.adb, exp_ch6.adb, gnat1drv.adb, sem_aux.adb,
	sem_ch2.adb, sem_ch8.adb, sem_res.adb: Minor reformatting.

From-SVN: r273388
parent bce6accb
2019-07-11 Hristian Kirtchev <kirtchev@adacore.com> 2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb, exp_ch6.adb, gnat1drv.adb, sem_aux.adb,
sem_ch2.adb, sem_ch8.adb, sem_res.adb: Minor reformatting.
2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch8.adb (Analyze_Object_Renaming): Obtain the object being * sem_ch8.adb (Analyze_Object_Renaming): Obtain the object being
renamed using routine Get_Object_Name which takes care of renamed using routine Get_Object_Name which takes care of
various name forms. various name forms.
......
...@@ -577,8 +577,9 @@ package body Checks is ...@@ -577,8 +577,9 @@ package body Checks is
Typ : Entity_Id; Typ : Entity_Id;
Insert_Node : Node_Id) Insert_Node : Node_Id)
is is
Check_Cond : Node_Id;
Loc : constant Source_Ptr := Sloc (N); Loc : constant Source_Ptr := Sloc (N);
Check_Cond : Node_Id;
Param_Ent : Entity_Id := Param_Entity (N); Param_Ent : Entity_Id := Param_Entity (N);
Param_Level : Node_Id; Param_Level : Node_Id;
Type_Level : Node_Id; Type_Level : Node_Id;
...@@ -639,7 +640,8 @@ package body Checks is ...@@ -639,7 +640,8 @@ package body Checks is
-- Raise Program_Error if the accessibility level of the access -- Raise Program_Error if the accessibility level of the access
-- parameter is deeper than the level of the target access type. -- parameter is deeper than the level of the target access type.
Check_Cond := Make_Op_Gt (Loc, Check_Cond :=
Make_Op_Gt (Loc,
Left_Opnd => Param_Level, Left_Opnd => Param_Level,
Right_Opnd => Type_Level); Right_Opnd => Type_Level);
...@@ -657,10 +659,8 @@ package body Checks is ...@@ -657,10 +659,8 @@ package body Checks is
and then Entity (Check_Cond) = Standard_True and then Entity (Check_Cond) = Standard_True
then then
Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_Warn := SPARK_Mode /= On;
Error_Msg_N Error_Msg_N ("accessibility check fails<<", N);
("accessibility check fails<<", N); Error_Msg_N ("\Program_Error [<<", N);
Error_Msg_N
("\Program_Error [<<", N);
end if; end if;
end if; end if;
end Apply_Accessibility_Check; end Apply_Accessibility_Check;
......
...@@ -2481,8 +2481,6 @@ package body Exp_Ch6 is ...@@ -2481,8 +2481,6 @@ package body Exp_Ch6 is
function Can_Fold_Predicate_Call (P : Entity_Id) return Boolean is function Can_Fold_Predicate_Call (P : Entity_Id) return Boolean is
Actual : constant Node_Id := Actual : constant Node_Id :=
First (Parameter_Associations (Call_Node)); First (Parameter_Associations (Call_Node));
Subt : constant Entity_Id := Etype (First_Entity (P));
Pred : Node_Id;
function May_Fold (N : Node_Id) return Traverse_Result; function May_Fold (N : Node_Id) return Traverse_Result;
-- The predicate expression is foldable if it only contains operators -- The predicate expression is foldable if it only contains operators
...@@ -2491,13 +2489,21 @@ package body Exp_Ch6 is ...@@ -2491,13 +2489,21 @@ package body Exp_Ch6 is
-- value of the actual. This is done on a copy of the analyzed -- value of the actual. This is done on a copy of the analyzed
-- expression for the predicate. -- expression for the predicate.
--------------
-- May_Fold --
--------------
function May_Fold (N : Node_Id) return Traverse_Result is function May_Fold (N : Node_Id) return Traverse_Result is
begin begin
case Nkind (N) is case Nkind (N) is
when N_Binary_Op | N_Unary_Op => when N_Binary_Op
| N_Unary_Op
=>
return OK; return OK;
when N_Identifier | N_Expanded_Name => when N_Expanded_Name
| N_Identifier
=>
if Ekind (Entity (N)) = E_In_Parameter if Ekind (Entity (N)) = E_In_Parameter
and then Entity (N) = First_Entity (P) and then Entity (N) = First_Entity (P)
then then
...@@ -2512,7 +2518,9 @@ package body Exp_Ch6 is ...@@ -2512,7 +2518,9 @@ package body Exp_Ch6 is
return Abandon; return Abandon;
end if; end if;
when N_If_Expression | N_Case_Expression => when N_Case_Expression
| N_If_Expression
=>
return OK; return OK;
when N_Integer_Literal => when N_Integer_Literal =>
...@@ -2525,6 +2533,11 @@ package body Exp_Ch6 is ...@@ -2525,6 +2533,11 @@ package body Exp_Ch6 is
function Try_Fold is new Traverse_Func (May_Fold); function Try_Fold is new Traverse_Func (May_Fold);
-- Local variables
Subt : constant Entity_Id := Etype (First_Entity (P));
Pred : Node_Id;
-- Start of processing for Can_Fold_Predicate_Call -- Start of processing for Can_Fold_Predicate_Call
begin begin
...@@ -2550,9 +2563,9 @@ package body Exp_Ch6 is ...@@ -2550,9 +2563,9 @@ package body Exp_Ch6 is
Analyze_And_Resolve (Call_Node, Standard_Boolean); Analyze_And_Resolve (Call_Node, Standard_Boolean);
return True; return True;
else -- Otherwise continue the expansion of the function call
-- Continue expansion of function call
else
return False; return False;
end if; end if;
end Can_Fold_Predicate_Call; end Can_Fold_Predicate_Call;
......
...@@ -1057,7 +1057,8 @@ procedure Gnat1drv is ...@@ -1057,7 +1057,8 @@ procedure Gnat1drv is
if In_Extended_Main_Source_Unit (Cunit_Entity (U)) then if In_Extended_Main_Source_Unit (Cunit_Entity (U)) then
declare declare
Nam : constant String := Nam : constant String :=
Get_Name_String (File_Name (Source_Index (U))) & ".json"; Get_Name_String
(File_Name (Source_Index (U))) & ".json";
Namid : constant File_Name_Type := Name_Enter (Nam); Namid : constant File_Name_Type := Name_Enter (Nam);
Index : constant Source_File_Index := Load_Config_File (Namid); Index : constant Source_File_Index := Load_Config_File (Namid);
......
...@@ -1330,7 +1330,8 @@ package body Sem_Aux is ...@@ -1330,7 +1330,8 @@ package body Sem_Aux is
function Is_Protected_Operation (E : Entity_Id) return Boolean is function Is_Protected_Operation (E : Entity_Id) return Boolean is
begin begin
return Is_Entry (E) return
Is_Entry (E)
or else (Is_Subprogram (E) or else (Is_Subprogram (E)
and then Nkind (Parent (Unit_Declaration_Node (E))) = and then Nkind (Parent (Unit_Declaration_Node (E))) =
N_Protected_Definition); N_Protected_Definition);
......
...@@ -31,7 +31,6 @@ with Restrict; use Restrict; ...@@ -31,7 +31,6 @@ with Restrict; use Restrict;
with Rident; use Rident; with Rident; use Rident;
with Sem_Ch8; use Sem_Ch8; with Sem_Ch8; use Sem_Ch8;
with Sem_Dim; use Sem_Dim; with Sem_Dim; use Sem_Dim;
-- with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
with Stand; use Stand; with Stand; use Stand;
with Uintp; use Uintp; with Uintp; use Uintp;
...@@ -97,9 +96,7 @@ package body Sem_Ch2 is ...@@ -97,9 +96,7 @@ package body Sem_Ch2 is
-- prior analysis (or construction) of the literal, and after type -- prior analysis (or construction) of the literal, and after type
-- checking and resolution. -- checking and resolution.
if No (Etype (N)) if No (Etype (N)) or else not Is_Modular_Integer_Type (Etype (N)) then
or else not Is_Modular_Integer_Type (Etype (N))
then
Set_Etype (N, Universal_Integer); Set_Etype (N, Universal_Integer);
end if; end if;
......
...@@ -815,8 +815,7 @@ package body Sem_Ch8 is ...@@ -815,8 +815,7 @@ package body Sem_Ch8 is
-- it does not apply to records with limited components, for which -- it does not apply to records with limited components, for which
-- this syntactic flag is not set, but whose size is also fixed. -- this syntactic flag is not set, but whose size is also fixed.
elsif (Is_Record_Type (Typ) elsif (Is_Record_Type (Typ) and then Is_Limited_Type (Typ))
and then Is_Limited_Type (Typ))
or else or else
(Ekind (Typ) = E_Limited_Private_Type (Ekind (Typ) = E_Limited_Private_Type
and then Has_Discriminants (Typ) and then Has_Discriminants (Typ)
......
...@@ -3467,8 +3467,8 @@ package body Sem_Res is ...@@ -3467,8 +3467,8 @@ package body Sem_Res is
or else Nkind (Original_Node (N)) not in N_Subprogram_Call or else Nkind (Original_Node (N)) not in N_Subprogram_Call
or else (Nkind (Name (N)) = N_Identifier or else (Nkind (Name (N)) = N_Identifier
and then Present (Entity (Name (N))) and then Present (Entity (Name (N)))
and then Nkind (Entity (Name (N))) and then Nkind (Entity (Name (N))) =
= N_Defining_Operator_Symbol) N_Defining_Operator_Symbol)
or else not Comes_From_Source (N) or else not Comes_From_Source (N)
then then
return; return;
......
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