aboutsummaryrefslogtreecommitdiffstats
path: root/sem_types.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-10-29 20:36:29 +0100
committerTristan Gingold <tgingold@free.fr>2014-10-29 20:36:29 +0100
commite5071f1a02f16a369c504944934042fbfb09e5dc (patch)
tree1b891a41c024a308274c380c8189e3213085a7e8 /sem_types.adb
parent236a876a8448b89061bb71869c36a68aea0199c3 (diff)
downloadghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.tar.gz
ghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.tar.bz2
ghdl-e5071f1a02f16a369c504944934042fbfb09e5dc.zip
Add support for package interface.
Diffstat (limited to 'sem_types.adb')
-rw-r--r--sem_types.adb22
1 files changed, 17 insertions, 5 deletions
diff --git a/sem_types.adb b/sem_types.adb
index 27eee590a..12f276be1 100644
--- a/sem_types.adb
+++ b/sem_types.adb
@@ -776,8 +776,6 @@ package body Sem_Types is
Set_Type_Staticness (Def, Locally);
Set_Signal_Type_Flag (Def, True);
- Create_Range_Constraint_For_Enumeration_Type (Def);
-
-- Makes all literal visible.
declare
El: Iir;
@@ -806,6 +804,8 @@ package body Sem_Types is
end;
Set_Resolved_Flag (Def, False);
+ Create_Range_Constraint_For_Enumeration_Type (Def);
+
-- Identifier IEEE.Std_Logic_1164.Std_Ulogic.
if Get_Identifier (Decl) = Std_Names.Name_Std_Ulogic
and then
@@ -1245,7 +1245,7 @@ package body Sem_Types is
if Decl = Null_Iir or else Get_Chain (Decl) /= Null_Iir then
return False;
end if;
- if Get_Kind (Decl) /= Iir_Kind_Constant_Interface_Declaration then
+ if Get_Kind (Decl) /= Iir_Kind_Interface_Constant_Declaration then
return False;
end if;
-- LRM93 2.4
@@ -1370,6 +1370,7 @@ package body Sem_Types is
Subtype_Index_List : Iir_List;
Resolv_Func : Iir := Null_Iir;
Resolv_El : Iir := Null_Iir;
+ Resolv_Ind : Iir;
begin
if Resolution /= Null_Iir then
-- A resolution indication is present.
@@ -1545,8 +1546,19 @@ package body Sem_Types is
-- FIXME: may a resolution indication for a record be incomplete ?
Set_Resolved_Flag (Res, Get_Resolved_Flag (El_Def));
elsif Get_Kind (Type_Mark) = Iir_Kind_Array_Subtype_Definition then
- Set_Resolution_Indication
- (Res, Get_Resolution_Indication (Type_Mark));
+ Resolv_Ind := Get_Resolution_Indication (Type_Mark);
+ if Resolv_Ind /= Null_Iir then
+ case Get_Kind (Resolv_Ind) is
+ when Iir_Kinds_Denoting_Name =>
+ Error_Kind ("sem_array_constraint(resolution)", Resolv_Ind);
+ when Iir_Kind_Array_Element_Resolution =>
+ -- Already applied to the element.
+ Resolv_Ind := Null_Iir;
+ when others =>
+ Error_Kind ("sem_array_constraint(resolution2)", Resolv_Ind);
+ end case;
+ Set_Resolution_Indication (Res, Resolv_Ind);
+ end if;
Set_Resolved_Flag (Res, Get_Resolved_Flag (Type_Mark));
end if;