From 4c11930d2e09a1efb0af65af8c14b1ad16a1f884 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 23 Nov 2020 23:27:21 +0100 Subject: [PATCH] [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. --- gcc/ada/sem_attr.adb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) 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 -- -- 2.30.2