diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-01 06:55:48 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-07-03 14:16:17 +0200 |
commit | 03eee572b097c50696268d9cb8186b7ba01fdc82 (patch) | |
tree | db99d6a0506d7f121d0087f1b61b2630c20c5ab0 | |
parent | bae9b806b461ce9a2231b683a4ff8b4ed487359b (diff) | |
download | ghdl-03eee572b097c50696268d9cb8186b7ba01fdc82.tar.gz ghdl-03eee572b097c50696268d9cb8186b7ba01fdc82.tar.bz2 ghdl-03eee572b097c50696268d9cb8186b7ba01fdc82.zip |
A package instantiation does not depend on the body if it is not required.
Tentative fix for issue #107.
-rw-r--r-- | src/vhdl/sem.adb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index cd238c475..aefb13900 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -2670,10 +2670,12 @@ package body Sem is -- FIXME: unless the parent is a package declaration library unit, the -- design unit depends on the body. - Bod := Libraries.Load_Secondary_Unit - (Get_Design_Unit (Pkg), Null_Identifier, Decl); - if Bod /= Null_Iir then - Add_Dependence (Bod); + if Get_Need_Body (Pkg) then + Bod := Libraries.Load_Secondary_Unit + (Get_Design_Unit (Pkg), Null_Identifier, Decl); + if Bod /= Null_Iir then + Add_Dependence (Bod); + end if; end if; end Sem_Package_Instantiation_Declaration; |