[Ada] Refactor duplicated code for Denorm and Signed_Zeros attributes
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 23 Nov 2020 15:50:17 +0000 (16:50 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 15 Dec 2020 11:41:50 +0000 (06:41 -0500)
gcc/ada/

* sem_attr.adb (Analyze_Attribute): Merge identical code for
Denorm and Signed_Zeros attributes.

gcc/ada/sem_attr.adb

index 8f118afe25a96bd89e7086a401592f2cb6abf342..4ec22ae8fe7c2fbc940e3d896744dcf2191eb075 100644 (file)
@@ -3819,7 +3819,9 @@ package body Sem_Attr is
       -- Denorm --
       ------------
 
-      when Attribute_Denorm =>
+      when Attribute_Denorm
+         | Attribute_Signed_Zeros
+      =>
          Check_Floating_Point_Type_0;
          Set_Etype (N, Standard_Boolean);
 
@@ -5949,9 +5951,7 @@ package body Sem_Attr is
       -- Signed_Zeros --
       ------------------
 
-      when Attribute_Signed_Zeros =>
-         Check_Floating_Point_Type_0;
-         Set_Etype (N, Standard_Boolean);
+      --  Shares processing with Denorm attribute
 
       ----------
       -- Size --