diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-11-23 15:39:32 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-12-15 06:41:49 -0500 |
commit | a8ecf5ec3288acf2c6578de794050764189bf12d (patch) | |
tree | 54a8ab2c2ab8ce16bd63cbb145019b3f6c55e42a /gcc | |
parent | 69bd5d473d22157d0737fc20e98eb3347cbd6ab5 (diff) | |
download | gcc-a8ecf5ec3288acf2c6578de794050764189bf12d.zip gcc-a8ecf5ec3288acf2c6578de794050764189bf12d.tar.gz gcc-a8ecf5ec3288acf2c6578de794050764189bf12d.tar.bz2 |
[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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_attr.adb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 1a574c6..3a05565 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 -- |