From: Piotr Trojanek Date: Mon, 23 Nov 2020 14:39:32 +0000 (+0100) Subject: [Ada] Refactor duplicated code for Compose, Leading_Part and Scaling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8ecf5ec3288acf2c6578de794050764189bf12d;p=gcc.git [Ada] Refactor duplicated code for Compose, Leading_Part and Scaling gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Compose, Leading_Part and Scaling attributes. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 1a574c67b99..3a055659934 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3496,7 +3496,10 @@ package body Sem_Attr is -- Compose -- ------------- - when Attribute_Compose => + when Attribute_Compose + | Attribute_Leading_Part + | Attribute_Scaling + => Check_Floating_Point_Type_2; Set_Etype (N, P_Base_Type); Resolve (E1, P_Base_Type); @@ -4319,11 +4322,7 @@ package body Sem_Attr is -- Leading_Part -- ------------------ - when Attribute_Leading_Part => - Check_Floating_Point_Type_2; - Set_Etype (N, P_Base_Type); - Resolve (E1, P_Base_Type); - Resolve (E2, Any_Integer); + -- Shares processing with Compose attribute ------------ -- Length -- @@ -5949,11 +5948,7 @@ package body Sem_Attr is -- Scaling -- ------------- - when Attribute_Scaling => - Check_Floating_Point_Type_2; - Set_Etype (N, P_Base_Type); - Resolve (E1, P_Base_Type); - Resolve (E2, Any_Integer); + -- Shares processing with Compose attribute ------------------ -- Signed_Zeros --