From: Piotr Trojanek Date: Mon, 23 Nov 2020 15:40:06 +0000 (+0100) Subject: [Ada] Refactor duplicated code for Adjacent, Copy_Sign and Remainder X-Git-Tag: upstream/12.2.0~10911 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e30609bf042cbc937bece4ae00347a37f76af87f;p=platform%2Fupstream%2Fgcc.git [Ada] Refactor duplicated code for Adjacent, Copy_Sign and Remainder gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Adjacent, Copy_Sign and Remainder attributes. (Check_Floating_Point_Type_2): Fix style in comment. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 3a05565..8f118af 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -348,7 +348,7 @@ package body Sem_Attr is procedure Check_Floating_Point_Type_2; -- Verify that prefix of attribute N is a float type and that - -- two attribute expressions are present + -- two attribute expressions are present. procedure Check_Integer_Type; -- Verify that prefix of attribute N is an integer type @@ -3159,7 +3159,10 @@ package body Sem_Attr is -- Adjacent -- -------------- - when Attribute_Adjacent => + when Attribute_Adjacent + | Attribute_Copy_Sign + | Attribute_Remainder + => Check_Floating_Point_Type_2; Set_Etype (N, P_Base_Type); Resolve (E1, P_Base_Type); @@ -3617,11 +3620,7 @@ package body Sem_Attr is -- Copy_Sign -- --------------- - when Attribute_Copy_Sign => - Check_Floating_Point_Type_2; - Set_Etype (N, P_Base_Type); - Resolve (E1, P_Base_Type); - Resolve (E2, P_Base_Type); + -- Shares processing with Adjacent attribute ----------- -- Count -- @@ -5710,11 +5709,7 @@ package body Sem_Attr is -- Remainder -- --------------- - when Attribute_Remainder => - Check_Floating_Point_Type_2; - Set_Etype (N, P_Base_Type); - Resolve (E1, P_Base_Type); - Resolve (E2, P_Base_Type); + -- Shares processing with Adjacent attribute --------------------- -- Restriction_Set --