From 68f27c97bff2d21c107ca90e1b597fed45b52ba5 Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Mon, 1 Jul 2019 13:34:49 +0000 Subject: [PATCH] [Ada] Minor reformatting 2019-07-01 Hristian Kirtchev gcc/ada/ * exp_attr.adb, exp_ch7.adb, exp_unst.adb, sem_ch3.adb, sem_util.adb, uintp.adb, uintp.ads: Minor reformatting. From-SVN: r272859 --- gcc/ada/ChangeLog | 5 +++ gcc/ada/exp_attr.adb | 4 +- gcc/ada/exp_ch7.adb | 9 +++-- gcc/ada/exp_unst.adb | 6 +-- gcc/ada/sem_ch3.adb | 7 ++-- gcc/ada/sem_util.adb | 6 +-- gcc/ada/uintp.adb | 89 +++++++++++++++++++++----------------------- gcc/ada/uintp.ads | 6 +-- 8 files changed, 66 insertions(+), 66 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7bb2605bf63..95b52b6ac6d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-01 Hristian Kirtchev + + * 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 * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 7d3a6c44586..bd8fdf46149 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -4248,8 +4248,8 @@ package body Exp_Attr is 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); diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 96742e57011..4209785c2fa 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -379,10 +379,6 @@ package body Exp_Ch7 is -- 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; @@ -400,6 +396,10 @@ package body Exp_Ch7 is -- 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; @@ -5187,6 +5187,7 @@ package body Exp_Ch7 is 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; diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 3d533ba4a96..5aa1fa6494d 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -254,8 +254,7 @@ package body Exp_Unst is 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; @@ -2188,8 +2187,7 @@ package body Exp_Unst is 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; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 8b062232c68..bc5e73d9308 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -10376,10 +10376,9 @@ package body Sem_Ch3 is -- 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 diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 16c671111e4..13a06ccf5ab 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -9201,12 +9201,12 @@ package body Sem_Util is 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; diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index a1d0a2e7432..61e9f3d1be4 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -1492,6 +1492,49 @@ package body Uintp is 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 -- ------------ @@ -2324,50 +2367,4 @@ package body Uintp is 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; diff --git a/gcc/ada/uintp.ads b/gcc/ada/uintp.ads index a09f326c235..d8342baa52f 100644 --- a/gcc/ada/uintp.ads +++ b/gcc/ada/uintp.ads @@ -251,9 +251,9 @@ package Uintp is 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 -- 2.30.2