From: Piotr Trojanek Date: Mon, 23 Nov 2020 22:27:21 +0000 (+0100) Subject: [Ada] Refactor repeated code for real type attributes returning reals X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c11930d2e09a1efb0af65af8c14b1ad16a1f884;p=gcc.git [Ada] Refactor repeated code for real type attributes returning reals gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Large, Small, Safe_Large and Safe_Small attributes. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 2e19bf69b41..1eb4b81bcb5 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4308,7 +4308,11 @@ package body Sem_Attr is -- Large -- ----------- - when Attribute_Large => + when Attribute_Large + | Attribute_Small + | Attribute_Safe_Large + | Attribute_Safe_Small + => Check_E0; Check_Real_Type; Set_Etype (N, Universal_Real); @@ -5850,10 +5854,7 @@ package body Sem_Attr is -- Safe_Large -- ---------------- - when Attribute_Safe_Large => - Check_E0; - Check_Real_Type; - Set_Etype (N, Universal_Real); + -- Shares processing with Large attribute --------------- -- Safe_Last -- @@ -5865,10 +5866,7 @@ package body Sem_Attr is -- Safe_Small -- ---------------- - when Attribute_Safe_Small => - Check_E0; - Check_Real_Type; - Set_Etype (N, Universal_Real); + -- Shares processing with Large attribute -------------------------- -- Scalar_Storage_Order -- @@ -6033,10 +6031,7 @@ package body Sem_Attr is -- Small -- ----------- - when Attribute_Small => - Check_E0; - Check_Real_Type; - Set_Etype (N, Universal_Real); + -- Shares processing with Large attribute --------------------------------------- -- Small_Denominator/Small_Numerator --