aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-29 11:15:25 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-29 11:15:25 +0100
commit19b544a0b3a1e19dcba07a776c90d176d7dd8f6f (patch)
tree66b4183250b43b7ab96b4c15456a17ebd261be51 /src/synth
parent0d7c41cdc40b994aec616a84d78cf0375d63ad2e (diff)
downloadghdl-19b544a0b3a1e19dcba07a776c90d176d7dd8f6f.tar.gz
ghdl-19b544a0b3a1e19dcba07a776c90d176d7dd8f6f.tar.bz2
ghdl-19b544a0b3a1e19dcba07a776c90d176d7dd8f6f.zip
synth-decls: fix handling of record subtypes.
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-decls.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index f5a65e370..f0c885d0c 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -99,6 +99,19 @@ package body Synth.Decls is
return Typ;
end Synth_Array_Type_Definition;
+ -- Synth subtype of record elements.
+ procedure Synth_Record_Elements_Definition
+ (Syn_Inst : Synth_Instance_Acc; Def : Node)
+ is
+ El_List : constant Node_Flist := Get_Elements_Declaration_List (Def);
+ El : Node;
+ begin
+ for I in Flist_First .. Flist_Last (El_List) loop
+ El := Get_Nth_Element (El_List, I);
+ Synth_Declaration_Type (Syn_Inst, El);
+ end loop;
+ end Synth_Record_Elements_Definition;
+
function Synth_Record_Type_Definition
(Syn_Inst : Synth_Instance_Acc; Def : Node) return Type_Acc
is
@@ -119,7 +132,6 @@ package body Synth.Decls is
Off := 0;
for I in Flist_First .. Flist_Last (El_List) loop
El := Get_Nth_Element (El_List, I);
- Synth_Declaration_Type (Syn_Inst, El);
El_Typ := Get_Value_Type (Syn_Inst, Get_Type (El));
Rec_Els.E (Iir_Index32 (I + 1)) := (Off => Off,
Typ => El_Typ);
@@ -193,6 +205,7 @@ package body Synth.Decls is
when Iir_Kind_File_Type_Definition =>
Typ := Synth_File_Type_Definition (Syn_Inst, Def);
when Iir_Kind_Record_Type_Definition =>
+ Synth_Record_Elements_Definition (Syn_Inst, Def);
Typ := Synth_Record_Type_Definition (Syn_Inst, Def);
when others =>
Vhdl.Errors.Error_Kind ("synth_type_definition", Def);