+2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_attr.adb, exp_ch7.adb, exp_unst.adb, sem_ch3.adb,
+ sem_util.adb, uintp.adb, uintp.ads: Minor reformatting.
+
2019-07-01 Javier Miranda <miranda@adacore.com>
* exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of
when Attribute_Invalid_Value =>
Rewrite (N, Get_Simple_Init_Val (Ptyp, N));
- -- The value produced may be a conversion of a literal, which
- -- must be resolved to establish its proper type.
+ -- The value produced may be a conversion of a literal, which must be
+ -- resolved to establish its proper type.
Analyze_And_Resolve (N);
-- references within these nested subprograms (typically generated
-- subprograms to handle finalization actions).
- function Contains_Subprogram (Blk : Entity_Id) return Boolean;
- -- Check recursively whether a loop or block contains a subprogram that
- -- may need an activation record.
-
procedure Check_Visibly_Controlled
(Prim : Final_Primitives;
Typ : Entity_Id;
-- and use it instead. This is one case that might be solved more cleanly
-- once Overriding pragmas or declarations are in place.
+ function Contains_Subprogram (Blk : Entity_Id) return Boolean;
+ -- Check recursively whether a loop or block contains a subprogram that
+ -- may need an activation record.
+
function Convert_View
(Proc : Entity_Id;
Arg : Node_Id;
Set_Finalizer (Id, Fin_Id);
end if;
+
Check_Unnesting_In_Declarations (Visible_Declarations (Spec));
Check_Unnesting_In_Declarations (Private_Declarations (Spec));
end Expand_N_Package_Declaration;
Typ := Full_View (Typ);
end if;
- return Is_Array_Type (Typ)
- and then not Is_Constrained (Typ);
+ return Is_Array_Type (Typ) and then not Is_Constrained (Typ);
else
return False;
end if;
and then Present (Constant_Value (UPJ.Ent))
and then Is_Static_Expression (Constant_Value (UPJ.Ent))
then
- Rewrite (UPJ.Ref,
- New_Copy_Tree (Constant_Value (UPJ.Ent)));
+ Rewrite (UPJ.Ref, New_Copy_Tree (Constant_Value (UPJ.Ent)));
goto Continue;
end if;
-- build-in-place library function, child unit or not.
if (Nkind (Nod) in N_Entity and then Is_Compilation_Unit (Nod))
- or else
- (Nkind_In (Nod,
- N_Defining_Program_Unit_Name, N_Subprogram_Declaration)
- and then Is_Compilation_Unit (Defining_Entity (Nod)))
+ or else (Nkind_In (Nod, N_Defining_Program_Unit_Name,
+ N_Subprogram_Declaration)
+ and then Is_Compilation_Unit (Defining_Entity (Nod)))
then
Add_Global_Declaration (IR);
else
Next_Entity (Func);
end loop;
- -- If not found, no way to resolve remaining primitives.
+ -- If not found, no way to resolve remaining primitives
if Cursor = Any_Type then
Error_Msg_N
- ("primitive operation for Iterable type must appear "
- & "in the same list of declarations as the type", Aspect);
+ ("primitive operation for Iterable type must appear in the same "
+ & "list of declarations as the type", Aspect);
end if;
return Cursor;
end;
end UI_From_Int;
+ ----------------------
+ -- UI_From_Integral --
+ ----------------------
+
+ function UI_From_Integral (Input : In_T) return Uint is
+ begin
+ -- If in range of our normal conversion function, use it so we can use
+ -- direct access and our cache.
+
+ if In_T'Size <= Int'Size
+ or else Input in In_T (Int'First) .. In_T (Int'Last)
+ then
+ return UI_From_Int (Int (Input));
+
+ else
+ -- For values of larger magnitude, compute digits into a vector and
+ -- call Vector_To_Uint.
+
+ declare
+ Max_For_In_T : constant Int := 3 * In_T'Size / Int'Size;
+ Our_Base : constant In_T := In_T (Base);
+ Temp_Integer : In_T := Input;
+ -- Base is defined so that 3 Uint digits is sufficient to hold the
+ -- largest possible Int value.
+
+ U : Uint;
+ V : UI_Vector (1 .. Max_For_In_T);
+
+ begin
+ for J in reverse V'Range loop
+ V (J) := Int (abs (Temp_Integer rem Our_Base));
+ Temp_Integer := Temp_Integer / Our_Base;
+ end loop;
+
+ U := Vector_To_Uint (V, Input < 0);
+ Uints_Min := Uints.Last;
+ Udigits_Min := Udigits.Last;
+
+ return U;
+ end;
+ end if;
+ end UI_From_Integral;
+
------------
-- UI_GCD --
------------
return Uint_0;
end Vector_To_Uint;
- ----------------------
- -- UI_From_Integral --
- ----------------------
-
- function UI_From_Integral (Input : In_T) return Uint is
- U : Uint;
-
- begin
- -- If in range of our normal conversion function, use it so we can
- -- use direct access and our cache.
-
- if In_T'Size <= Int'Size
- or else Input in In_T (Int'First) .. In_T (Int'Last)
- then
- return UI_From_Int (Int (Input));
-
- else
- -- pragma Warnings (Off);
-
- -- For values of larger magnitude, compute digits into a vector
- -- and call Vector_To_Uint.
-
- declare
- Max_For_In_T : constant Int := 3 * In_T'Size / Int'Size;
- Our_Base : constant In_T := In_T (Base);
- Temp_Integer : In_T := Input;
- -- Base is defined so that 3 Uint digits is sufficient to hold the
- -- largest possible Int value.
-
- V : UI_Vector (1 .. Max_For_In_T);
-
- begin
- for J in reverse V'Range loop
- V (J) := Int (abs (Temp_Integer rem Our_Base));
- Temp_Integer := Temp_Integer / Our_Base;
- end loop;
-
- U := Vector_To_Uint (V, Input < 0);
- Uints_Min := Uints.Last;
- Udigits_Min := Udigits.Last;
- return U;
- end;
-
- -- pragma Warnings (On);
- end if;
- end UI_From_Integral;
end Uintp;
generic
type In_T is range <>;
function UI_From_Integral (Input : In_T) return Uint;
- -- Likewise, but converts from any integer type.
- -- Must not be applied to biased types (instantiation will provide
- -- a warning if actual is a biased type).
+ -- Likewise, but converts from any integer type. Must not be applied to
+ -- biased types (instantiation will provide a warning if actual is a biased
+ -- type).
function UI_From_CC (Input : Char_Code) return Uint;
-- Converts Char_Code value to universal integer form