diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-08 07:08:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-11 20:24:36 +0100 |
commit | 7f23209c22450787fc428aecbc434d93c2cd0c69 (patch) | |
tree | 026a24dba60586d60b48693cba5d4dc2de3696ec /src/synth/synth-decls.adb | |
parent | 8599d9ddd15b15afdeced6059b1e1b7a972f4db1 (diff) | |
download | ghdl-7f23209c22450787fc428aecbc434d93c2cd0c69.tar.gz ghdl-7f23209c22450787fc428aecbc434d93c2cd0c69.tar.bz2 ghdl-7f23209c22450787fc428aecbc434d93c2cd0c69.zip |
synth: initial support of access type. For #1004
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r-- | src/synth/synth-decls.adb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 33daa4079..aceb4954d 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -127,6 +127,20 @@ package body Synth.Decls is return Typ; end Synth_Record_Type_Definition; + function Synth_Access_Type_Definition + (Syn_Inst : Synth_Instance_Acc; Def : Node) return Type_Acc + is + Des_Type : constant Node := Get_Designated_Type (Def); + Des_Typ : Type_Acc; + Typ : Type_Acc; + begin + Synth_Subtype_Indication_If_Anonymous (Syn_Inst, Des_Type); + Des_Typ := Get_Value_Type (Syn_Inst, Des_Type); + + Typ := Create_Access_Type (Des_Typ); + return Typ; + end Synth_Access_Type_Definition; + procedure Synth_Type_Definition (Syn_Inst : Synth_Instance_Acc; Def : Node) is Typ : Type_Acc; @@ -158,8 +172,9 @@ package body Synth.Decls is end if; when Iir_Kind_Array_Type_Definition => Typ := Synth_Array_Type_Definition (Syn_Inst, Def); - when Iir_Kind_Access_Type_Definition - | Iir_Kind_File_Type_Definition => + when Iir_Kind_Access_Type_Definition => + Typ := Synth_Access_Type_Definition (Syn_Inst, Def); + when Iir_Kind_File_Type_Definition => Typ := null; when Iir_Kind_Record_Type_Definition => Typ := Synth_Record_Type_Definition (Syn_Inst, Def); |