From: Piotr Trojanek Date: Mon, 23 Nov 2020 22:21:19 +0000 (+0100) Subject: [Ada] Refactor repeated code for floating point attributes returning reals X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=156f9796d5050730ab45d99162ab4309c0bdc6ee;p=gcc.git [Ada] Refactor repeated code for floating point attributes returning reals gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Epsilon, Model_Epsilon, Model_Small, Safe_First and Safe_Las attributes. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index d2eb62fed17..2e19bf69b41 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4002,7 +4002,12 @@ package body Sem_Attr is -- Epsilon -- ------------- - when Attribute_Epsilon => + when Attribute_Epsilon + | Attribute_Model_Epsilon + | Attribute_Model_Small + | Attribute_Safe_First + | Attribute_Safe_Last + => Check_Floating_Point_Type_0; Set_Etype (N, Universal_Real); @@ -4876,9 +4881,7 @@ package body Sem_Attr is -- Model_Epsilon -- ------------------- - when Attribute_Model_Epsilon => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Real); + -- Shares processing with Epsilon attribute -------------------- -- Model_Mantissa -- @@ -4890,9 +4893,7 @@ package body Sem_Attr is -- Model_Small -- ----------------- - when Attribute_Model_Small => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Real); + -- Shares processing with Epsilon attribute ------------- -- Modulus -- @@ -5843,9 +5844,7 @@ package body Sem_Attr is -- Safe_First -- ---------------- - when Attribute_Safe_First => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Real); + -- Shares processing with Epsilon attribute ---------------- -- Safe_Large -- @@ -5860,9 +5859,7 @@ package body Sem_Attr is -- Safe_Last -- --------------- - when Attribute_Safe_Last => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Real); + -- Shares processing with Epsilon attribute ---------------- -- Safe_Small --