From cb84595d3f406fb466c68e5ff6661dd8ee4a4e9c Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 23 Nov 2020 23:30:32 +0100 Subject: [PATCH] [Ada] Refactor repeated code for real type attributes returning integers gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Machine_Radix and Mantissa 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 7b6c66c4b4a..30fdfb8c55d 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4744,7 +4744,9 @@ package body Sem_Attr is -- Machine_Radix -- ------------------- - when Attribute_Machine_Radix => + when Attribute_Machine_Radix + | Attribute_Mantissa + => Check_Real_Type; Check_E0; Set_Etype (N, Universal_Integer); @@ -4775,10 +4777,7 @@ package body Sem_Attr is -- Mantissa -- -------------- - when Attribute_Mantissa => - Check_E0; - Check_Real_Type; - Set_Etype (N, Universal_Integer); + -- Shares processing with Machine_Radix attribute --------- -- Max -- -- 2.30.2