aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_lib.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-11-09 20:54:19 +0100
committerTristan Gingold <tgingold@free.fr>2021-11-09 20:54:19 +0100
commit96245c0a4df7a6bc07cd8b7c15268c78c459f3b7 (patch)
tree8c9aacd46303689492872db13bb71cb2a61ba44a /src/vhdl/vhdl-sem_lib.adb
parent144cedec159574df474579fa2cc7fde7e61eadbc (diff)
downloadghdl-96245c0a4df7a6bc07cd8b7c15268c78c459f3b7.tar.gz
ghdl-96245c0a4df7a6bc07cd8b7c15268c78c459f3b7.tar.bz2
ghdl-96245c0a4df7a6bc07cd8b7c15268c78c459f3b7.zip
vhdl: Iir_Kind_Foreign_Module is now a library unit
(instead of a design unit). Also, add Iir_Kind_Foreign_Vector_Type_Definition
Diffstat (limited to 'src/vhdl/vhdl-sem_lib.adb')
-rw-r--r--src/vhdl/vhdl-sem_lib.adb17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-sem_lib.adb b/src/vhdl/vhdl-sem_lib.adb
index aeb737272..c4e26ee70 100644
--- a/src/vhdl/vhdl-sem_lib.adb
+++ b/src/vhdl/vhdl-sem_lib.adb
@@ -339,6 +339,7 @@ package body Vhdl.Sem_Lib is
Prev_Nbr_Errors : Natural;
Warnings : Warnings_Setting;
Error : Boolean;
+ Lib_Unit : Iir;
begin
if Get_Date (Design_Unit) = Date_Replacing then
Error_Msg_Sem (+Loc, "circular reference of %n", +Design_Unit);
@@ -374,7 +375,21 @@ package body Vhdl.Sem_Lib is
Set_Date_State (Design_Unit, Date_Analyze);
-- Analyze unit.
- Finish_Compilation (Design_Unit);
+ Lib_Unit := Get_Library_Unit (Design_Unit);
+ if Get_Kind (Lib_Unit) /= Iir_Kind_Foreign_Module then
+ Finish_Compilation (Design_Unit);
+ else
+ if Convert_Foreign_Unit = null then
+ Error_Msg_Sem (Loc, "cannot handle %n", +Design_Unit);
+ Error := True;
+ else
+ -- Try to import the foreign unit.
+ if not Convert_Foreign_Unit (Lib_Unit) then
+ Error := True;
+ end if;
+ end if;
+ Set_Date (Design_Unit, Date_Analyzed);
+ end if;
-- Check if one of its dependency makes this unit obsolete.
-- FIXME: to do when the dependency is added ?