From f9c82ff43169fe5b1a192b71cbc50fd93b6e6a9c Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 23 Nov 2020 23:28:46 +0100 Subject: [PATCH] [Ada] Refactor repeated code for real type attributes returning booleans gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Machine_Overflows and Machine_Rounds attributes. --- gcc/ada/sem_attr.adb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 1eb4b81b..7b6c66c 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4733,7 +4733,9 @@ package body Sem_Attr is -- Machine_Overflows -- ----------------------- - when Attribute_Machine_Overflows => + when Attribute_Machine_Overflows + | Attribute_Machine_Rounds + => Check_Real_Type; Check_E0; Set_Etype (N, Standard_Boolean); @@ -4757,10 +4759,7 @@ package body Sem_Attr is -- Machine_Rounds -- -------------------- - when Attribute_Machine_Rounds => - Check_Real_Type; - Check_E0; - Set_Etype (N, Standard_Boolean); + -- Shares processing with Machine_Overflows attribute ------------------ -- Machine_Size -- -- 2.7.4