From d19ad6fd2e14e8c3cb8b43a7eaed747031e9316d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 27 Dec 2013 04:16:19 +0100 Subject: Fix 'range'left & co. --- sem_names.adb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sem_names.adb') diff --git a/sem_names.adb b/sem_names.adb index 8928a89..ef68aa1 100644 --- a/sem_names.adb +++ b/sem_names.adb @@ -2205,7 +2205,6 @@ package body Sem_Names is & "anonymous object", Attr); return Error_Mark; when Iir_Kinds_Object_Declaration - | Iir_Kind_Design_Unit | Iir_Kind_Type_Declaration | Iir_Kind_Subtype_Declaration | Iir_Kinds_Function_Declaration @@ -2216,6 +2215,8 @@ package body Sem_Names is | Iir_Kinds_Concurrent_Statement => -- FIXME: to complete null; + when Iir_Kind_Design_Unit => + Sem.Add_Dependence (Prefix); when others => Error_Kind ("sem_user_attribute", Prefix); end case; @@ -2400,7 +2401,13 @@ package body Sem_Names is -- Result Type: Same type as T. Set_Type (Res, Prefix_Type); end case; - Set_Expr_Staticness (Res, Get_Type_Staticness (Prefix_Type)); + case Get_Kind (Prefix) is + when Iir_Kind_Range_Array_Attribute + | Iir_Kind_Reverse_Range_Array_Attribute => + Set_Expr_Staticness (Res, Get_Expr_Staticness (Prefix)); + when others => + Set_Expr_Staticness (Res, Get_Type_Staticness (Prefix_Type)); + end case; return Res; end Sem_Predefined_Type_Attribute; -- cgit