diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-11-23 16:54:58 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-15 06:41:50 -0500 |
commit | 82b4bbb7a4b4fdd285ccb8494ea3ef51494a57da (patch) | |
tree | e3cf77b3a2fc9eebac283c9c6ff0e56eb2df9612 | |
parent | e5f53db770e33d78e415be1766f9ebf36e5152e6 (diff) | |
download | gcc-82b4bbb7a4b4fdd285ccb8494ea3ef51494a57da.zip gcc-82b4bbb7a4b4fdd285ccb8494ea3ef51494a57da.tar.gz gcc-82b4bbb7a4b4fdd285ccb8494ea3ef51494a57da.tar.bz2 |
[Ada] Refactor repeated code for floating point attributes returning ints
gcc/ada/
* sem_attr.adb (Analyze_Attribute): Merge identical code for
Emax, Machine_Emax, Machine_Emin, Machine_Mantissa, Model_Emin,
Model_Mantissa and Safe_Emax attributes.
-rw-r--r-- | gcc/ada/sem_attr.adb | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 4ec22ae..d2eb62f 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3904,7 +3904,14 @@ package body Sem_Attr is -- Emax -- ---------- - when Attribute_Emax => + when Attribute_Emax + | Attribute_Machine_Emax + | Attribute_Machine_Emin + | Attribute_Machine_Mantissa + | Attribute_Model_Emin + | Attribute_Model_Mantissa + | Attribute_Safe_Emax + => Check_Floating_Point_Type_0; Set_Etype (N, Universal_Integer); @@ -4699,25 +4706,19 @@ package body Sem_Attr is -- Machine_Emax -- ------------------ - when Attribute_Machine_Emax => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ------------------ -- Machine_Emin -- ------------------ - when Attribute_Machine_Emin => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ---------------------- -- Machine_Mantissa -- ---------------------- - when Attribute_Machine_Mantissa => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ----------------------- -- Machine_Overflows -- @@ -4869,9 +4870,7 @@ package body Sem_Attr is -- Model_Emin -- ---------------- - when Attribute_Model_Emin => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ------------------- -- Model_Epsilon -- @@ -4885,9 +4884,7 @@ package body Sem_Attr is -- Model_Mantissa -- -------------------- - when Attribute_Model_Mantissa => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ----------------- -- Model_Small -- @@ -5840,9 +5837,7 @@ package body Sem_Attr is -- Safe_Emax -- --------------- - when Attribute_Safe_Emax => - Check_Floating_Point_Type_0; - Set_Etype (N, Universal_Integer); + -- Shares processing with Emax attribute ---------------- -- Safe_First -- |