[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
This commit is contained in:
Piotr Trojanek 2019-08-21 08:31:16 +00:00 committed by Pierre-Marie de Rodat
parent 0728477991
commit 7c2a44aebb
6 changed files with 25 additions and 19 deletions

View File

@ -1,3 +1,11 @@
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>
* libgnat/a-cofove.ads (Vector): Add an Iterable aspect to allow

View File

@ -6994,7 +6994,7 @@ package body Checks is
-- 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
-- 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.
-- [constraint_error when N not in

View File

@ -8032,10 +8032,8 @@ package body Einfo is
------------------------
function Is_Constant_Object (Id : E) return B is
K : constant Entity_Kind := Ekind (Id);
begin
return
K = E_Constant or else K = E_In_Parameter or else K = E_Loop_Parameter;
return Ekind_In (Id, E_Constant, E_In_Parameter, E_Loop_Parameter);
end Is_Constant_Object;
-------------------
@ -8053,8 +8051,8 @@ package body Einfo is
function Is_Discriminal (Id : E) return B is
begin
return (Ekind_In (Id, E_Constant, E_In_Parameter)
and then Present (Discriminal_Link (Id)));
return Ekind_In (Id, E_Constant, E_In_Parameter)
and then Present (Discriminal_Link (Id));
end Is_Discriminal;
----------------------
@ -8181,8 +8179,8 @@ package body Einfo is
function Is_Prival (Id : E) return B is
begin
return (Ekind_In (Id, E_Constant, E_Variable)
and then Present (Prival_Link (Id)));
return Ekind_In (Id, E_Constant, E_Variable)
and then Present (Prival_Link (Id));
end Is_Prival;
----------------------------

View File

@ -2014,7 +2014,7 @@ package body Exp_Ch4 is
-- 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
-- to insure that analysis of the call succeeds.
-- to ensure that analysis of the call succeeds.
declare
L, R : Node_Id;
@ -4254,7 +4254,7 @@ package body Exp_Ch4 is
-- 'Last - First (instead of 'Length) because for large arrays computing
-- 'Last -'First + 1 causes overflow. This is done without using the
-- attribute 'Size_In_Storage_Elements (which malfunctions for large
-- sizes ???)
-- sizes ???).
-------------------------
-- Rewrite_Coextension --
@ -4333,7 +4333,7 @@ package body Exp_Ch4 is
-- to compute 'Length since for large arrays 'Last -'First + 1
-- causes overflow; therefore we compute 'Last - 'First (which
-- 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
declare
@ -4371,7 +4371,7 @@ package body Exp_Ch4 is
(Make_Integer_Literal (Loc, J)))));
-- 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:
-- (if X'Last > X'First then X'Last - X'First else 0)
@ -4643,7 +4643,7 @@ package body Exp_Ch4 is
-- The check on No_Initialization is used here to prevent generating
-- 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
declare
@ -4683,11 +4683,11 @@ package body Exp_Ch4 is
if Is_Constrained (Siz_Typ)
and then Ekind (Siz_Typ) /= E_String_Literal_Subtype
then
-- For CCG targets the largest array may have up to 2**31-1
-- components (i.e. 2 Gigabytes if each array component is
-- 1-byte). This insures that fat pointer fields do not
-- For CCG targets, the largest array may have up to 2**31-1
-- components (i.e. 2 gigabytes if each array component is
-- one byte). This ensures that fat pointer fields do not
-- 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
Cond :=

View File

@ -8818,7 +8818,7 @@ package body Sem_Ch3 is
-- Indic can either be an N_Identifier if the subtype indication
-- 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.
Indic := Subtype_Indication (Type_Def);

View File

@ -3092,7 +3092,7 @@ package body Sem_SPARK is
-- Postconditions are checked for correct use of 'Old, but starting
-- 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.
when Pragma_Precondition