From 17eb60a9c7d2207b44b02145d9ee8b5d56562372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Th=C3=A9venoux?= Date: Tue, 30 Jul 2024 15:01:55 +0200 Subject: [PATCH] Add support for the Scale attribute --- ada/nodes.lkt | 5 ++++- .../name_resolution/unint_attrs/test.out | 22 ++++++++++++++++++- .../unint_attrs/test_unint_attrs.adb | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ada/nodes.lkt b/ada/nodes.lkt index b00f7e39c..dfd00e469 100644 --- a/ada/nodes.lkt +++ b/ada/nodes.lkt @@ -12783,7 +12783,10 @@ class AttributeRef: Name { # Attributes that simply return subprograms elif rel_name in s"Succ" | s"Pred" | s"Min" | s"Max" | s"Ceiling" | s"Floor" | s"Rounding" | s"Unbiased_Rounding" | s"Leading_Part" | s"Truncation" | s"Exponent" | s"Fraction" | s"Copy_Sign" | s"Remainder" | s"Adjacent" | s"Machine" | s"Machine_Rounding" | s"Scaling" | s"Compose" | s"Mod" | s"Value" | s"Wide_Value" | s"Wide_Wide_Value" | s"Fixed_Value" | s"Integer_Value" | s"Pos" | s"Val" | s"Enum_Val" | s"Write" | s"Read" | s"Output" | s"Input" | s"Put_Image" | s"Asm_Input" | s"Asm_Output" | s"Model" | s"Round" then self.attribute_subprogram_equation() elif rel_name in s"Size" | s"VADS_Size" then self.size_equation() - elif rel_name in s"Max_Size_In_Storage_Elements" | s"Aft" | s"Object_Size" | s"Value_Size" | s"Storage_Size" then self.subtype_attr_equation() + elif rel_name in s"Max_Size_In_Storage_Elements" + | s"Aft" | s"Object_Size" | s"Value_Size" | s"Storage_Size" + | s"Scale" + then self.subtype_attr_equation() elif rel_name in s"Access" | s"Unchecked_Access" | s"Unrestricted_Access" then self.access_equation() elif rel_name == s"Image" then self.image_equation(node.std_string_type()) elif rel_name == s"Wide_Image" then self.image_equation(node.std_wide_string_type()) diff --git a/testsuite/tests/name_resolution/unint_attrs/test.out b/testsuite/tests/name_resolution/unint_attrs/test.out index c94c02f1a..e3929a87f 100644 --- a/testsuite/tests/name_resolution/unint_attrs/test.out +++ b/testsuite/tests/name_resolution/unint_attrs/test.out @@ -545,7 +545,27 @@ Expr: type: None expected type: None -Resolving xrefs for node +Resolving xrefs for node +*************************************************************************** + +Expr: + references: + type: None + expected type: None +Expr: + references: None + type: + expected type: +Expr: + references: + type: None + expected type: None +Expr: + references: None + type: None + expected type: None + +Resolving xrefs for node ******************************************************************* diff --git a/testsuite/tests/name_resolution/unint_attrs/test_unint_attrs.adb b/testsuite/tests/name_resolution/unint_attrs/test_unint_attrs.adb index 612b8aec4..caeaf9fea 100644 --- a/testsuite/tests/name_resolution/unint_attrs/test_unint_attrs.adb +++ b/testsuite/tests/name_resolution/unint_attrs/test_unint_attrs.adb @@ -39,6 +39,7 @@ begin V : constant Natural := Standard'Storage_Unit; W : constant Natural := Standard'Wchar_T_Size; X : constant Natural := Natural'Stream_Size; + Y : constant Integer := Volt'Scale; begin null; end;