+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
-- 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
------------------------
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;
-------------------
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;
----------------------
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;
----------------------------
-- 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;
-- '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 --
-- 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
(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)
-- 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
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 :=
-- 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);
-- 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