Commit 7c2a44ae by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] Minor refactorings/reformattings

2019-08-21  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* einfo.adb (Is_Discriminal): Remove extra parens.
	(Is_Constant_Object): Simplify by reusing Ekind_In.
	(Is_Prival): Remove extra parens.
	* checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor
	reformattings.

From-SVN: r274790
parent 07284779
2019-08-21 Piotr Trojanek <trojanek@adacore.com>
* einfo.adb (Is_Discriminal): Remove extra parens.
(Is_Constant_Object): Simplify by reusing Ekind_In.
(Is_Prival): Remove extra parens.
* checks.adb, exp_ch4.adb, sem_ch3.adb, sem_spark.adb: Minor
reformattings.
2019-08-21 Claire Dross <dross@adacore.com> 2019-08-21 Claire Dross <dross@adacore.com>
* libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow * libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow
......
...@@ -6994,7 +6994,7 @@ package body Checks is ...@@ -6994,7 +6994,7 @@ package body Checks is
-- Next test for the case where the target type is within the bounds -- Next test for the case where the target type is within the bounds
-- of the base type of the source type, since in this case we can -- of the base type of the source type, since in this case we can
-- simply convert the bounds of the target type to this base bype -- simply convert the bounds of the target type to this base type
-- to do the test. -- to do the test.
-- [constraint_error when N not in -- [constraint_error when N not in
......
...@@ -8032,10 +8032,8 @@ package body Einfo is ...@@ -8032,10 +8032,8 @@ package body Einfo is
------------------------ ------------------------
function Is_Constant_Object (Id : E) return B is function Is_Constant_Object (Id : E) return B is
K : constant Entity_Kind := Ekind (Id);
begin begin
return return Ekind_In (Id, E_Constant, E_In_Parameter, E_Loop_Parameter);
K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter;
end Is_Constant_Object; end Is_Constant_Object;
------------------- -------------------
...@@ -8053,8 +8051,8 @@ package body Einfo is ...@@ -8053,8 +8051,8 @@ package body Einfo is
function Is_Discriminal (Id : E) return B is function Is_Discriminal (Id : E) return B is
begin begin
return (Ekind_In (Id, E_Constant, E_In_Parameter) return Ekind_In (Id, E_Constant, E_In_Parameter)
and then Present (Discriminal_Link (Id))); and then Present (Discriminal_Link (Id));
end Is_Discriminal; end Is_Discriminal;
---------------------- ----------------------
...@@ -8181,8 +8179,8 @@ package body Einfo is ...@@ -8181,8 +8179,8 @@ package body Einfo is
function Is_Prival (Id : E) return B is function Is_Prival (Id : E) return B is
begin begin
return (Ekind_In (Id, E_Constant, E_Variable) return Ekind_In (Id, E_Constant, E_Variable)
and then Present (Prival_Link (Id))); and then Present (Prival_Link (Id));
end Is_Prival; end Is_Prival;
---------------------------- ----------------------------
......
...@@ -2014,7 +2014,7 @@ package body Exp_Ch4 is ...@@ -2014,7 +2014,7 @@ package body Exp_Ch4 is
-- If the array type is distinct from the type of the arguments, it -- If the array type is distinct from the type of the arguments, it
-- is the full view of a private type. Apply an unchecked conversion -- is the full view of a private type. Apply an unchecked conversion
-- to insure that analysis of the call succeeds. -- to ensure that analysis of the call succeeds.
declare declare
L, R : Node_Id; L, R : Node_Id;
...@@ -4254,7 +4254,7 @@ package body Exp_Ch4 is ...@@ -4254,7 +4254,7 @@ package body Exp_Ch4 is
-- 'Last - First (instead of 'Length) because for large arrays computing -- 'Last - First (instead of 'Length) because for large arrays computing
-- 'Last -'First + 1 causes overflow. This is done without using the -- 'Last -'First + 1 causes overflow. This is done without using the
-- attribute 'Size_In_Storage_Elements (which malfunctions for large -- attribute 'Size_In_Storage_Elements (which malfunctions for large
-- sizes ???) -- sizes ???).
------------------------- -------------------------
-- Rewrite_Coextension -- -- Rewrite_Coextension --
...@@ -4333,7 +4333,7 @@ package body Exp_Ch4 is ...@@ -4333,7 +4333,7 @@ package body Exp_Ch4 is
-- to compute 'Length since for large arrays 'Last -'First + 1 -- to compute 'Length since for large arrays 'Last -'First + 1
-- causes overflow; therefore we compute 'Last - 'First (which -- causes overflow; therefore we compute 'Last - 'First (which
-- is not the exact number of components but it is valid for -- is not the exact number of components but it is valid for
-- the purpose of this runtime check on 32-bit targets) -- the purpose of this runtime check on 32-bit targets).
else else
declare declare
...@@ -4371,7 +4371,7 @@ package body Exp_Ch4 is ...@@ -4371,7 +4371,7 @@ package body Exp_Ch4 is
(Make_Integer_Literal (Loc, J))))); (Make_Integer_Literal (Loc, J)))));
-- Handle superflat arrays, i.e. arrays with such bounds -- Handle superflat arrays, i.e. arrays with such bounds
-- as 4 .. 2, to insure that the result is correct. -- as 4 .. 2, to ensure that the result is correct.
-- Generate: -- Generate:
-- (if X'Last > X'First then X'Last - X'First else 0) -- (if X'Last > X'First then X'Last - X'First else 0)
...@@ -4643,7 +4643,7 @@ package body Exp_Ch4 is ...@@ -4643,7 +4643,7 @@ package body Exp_Ch4 is
-- The check on No_Initialization is used here to prevent generating -- The check on No_Initialization is used here to prevent generating
-- this runtime check twice when the allocator is locally replaced by -- this runtime check twice when the allocator is locally replaced by
-- the expander by another one. -- the expander with another one.
if Is_Array_Type (Etyp) and then not No_Initialization (N) then if Is_Array_Type (Etyp) and then not No_Initialization (N) then
declare declare
...@@ -4683,11 +4683,11 @@ package body Exp_Ch4 is ...@@ -4683,11 +4683,11 @@ package body Exp_Ch4 is
if Is_Constrained (Siz_Typ) if Is_Constrained (Siz_Typ)
and then Ekind (Siz_Typ) /= E_String_Literal_Subtype and then Ekind (Siz_Typ) /= E_String_Literal_Subtype
then then
-- For CCG targets the largest array may have up to 2**31-1 -- For CCG targets, the largest array may have up to 2**31-1
-- components (i.e. 2 Gigabytes if each array component is -- components (i.e. 2 gigabytes if each array component is
-- 1-byte). This insures that fat pointer fields do not -- one byte). This ensures that fat pointer fields do not
-- overflow, since they are 32-bit integer types, and also -- overflow, since they are 32-bit integer types, and also
-- insures that 'Length can be computed at run time. -- ensures that 'Length can be computed at run time.
if Modify_Tree_For_C then if Modify_Tree_For_C then
Cond := Cond :=
......
...@@ -8818,7 +8818,7 @@ package body Sem_Ch3 is ...@@ -8818,7 +8818,7 @@ package body Sem_Ch3 is
-- Indic can either be an N_Identifier if the subtype indication -- Indic can either be an N_Identifier if the subtype indication
-- contains no constraint or an N_Subtype_Indication if the subtype -- contains no constraint or an N_Subtype_Indication if the subtype
-- indecation has a constraint. In either case it can include an -- indication has a constraint. In either case it can include an
-- interface list. -- interface list.
Indic := Subtype_Indication (Type_Def); Indic := Subtype_Indication (Type_Def);
......
...@@ -3092,7 +3092,7 @@ package body Sem_SPARK is ...@@ -3092,7 +3092,7 @@ package body Sem_SPARK is
-- Postconditions are checked for correct use of 'Old, but starting -- Postconditions are checked for correct use of 'Old, but starting
-- from the corresponding declaration, in order to avoid dealing with -- from the corresponding declaration, in order to avoid dealing with
-- with contracts on generic subprograms, which are not handled in -- with contracts on generic subprograms which are not handled in
-- GNATprove. -- GNATprove.
when Pragma_Precondition when Pragma_Precondition
......
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