diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-04-05 09:20:04 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-04-05 10:47:39 +0200 |
commit | 3c9c6023c38ed1272634a7d2aed5dbe1c318842a (patch) | |
tree | 9b0c80f87645a14fbcea51e05ecccaeb02ca6aeb /src/vhdl/vhdl-utils.adb | |
parent | f3e936f0ca532fb57f2700a46ba1ff84557f7305 (diff) | |
download | ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.tar.gz ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.tar.bz2 ghdl-3c9c6023c38ed1272634a7d2aed5dbe1c318842a.zip |
vhdl and libraries: add support for binding to a foreign module
Diffstat (limited to 'src/vhdl/vhdl-utils.adb')
-rw-r--r-- | src/vhdl/vhdl-utils.adb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb index 70596c929..578576e1e 100644 --- a/src/vhdl/vhdl-utils.adb +++ b/src/vhdl/vhdl-utils.adb @@ -712,6 +712,7 @@ package body Vhdl.Utils is end if; pragma Assert (Kind_In (Unit, Iir_Kind_Design_Unit, + Iir_Kind_Foreign_Module, Iir_Kind_Entity_Aspect_Entity)); Add_Element (Get_Dependence_List (Target), Unit); @@ -1503,13 +1504,17 @@ package body Vhdl.Utils is Name : constant Iir := Get_Entity_Name (Decl); Res : constant Iir := Get_Named_Entity (Name); begin - if Res = Vhdl.Std_Package.Error_Mark then + if Res = Null_Iir or else Res = Vhdl.Std_Package.Error_Mark then return Null_Iir; end if; - pragma Assert (Res = Null_Iir - or else Get_Kind (Res) = Iir_Kind_Entity_Declaration); - return Res; + case Get_Kind (Res) is + when Iir_Kind_Entity_Declaration + | Iir_Kind_Foreign_Module => + return Res; + when others => + raise Internal_Error; + end case; end Get_Entity; function Get_Configuration (Aspect : Iir) return Iir |