diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-11-23 23:27:21 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-15 06:41:51 -0500 |
commit | 4c11930d2e09a1efb0af65af8c14b1ad16a1f884 (patch) | |
tree | 734f1c0896cbea34f0edeeb865c30f8e68807e2e /gcc | |
parent | 156f9796d5050730ab45d99162ab4309c0bdc6ee (diff) | |
download | gcc-4c11930d2e09a1efb0af65af8c14b1ad16a1f884.zip gcc-4c11930d2e09a1efb0af65af8c14b1ad16a1f884.tar.gz gcc-4c11930d2e09a1efb0af65af8c14b1ad16a1f884.tar.bz2 |
[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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_attr.adb | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 2e19bf6..1eb4b81b 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 -- |