aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-03-23 07:25:15 +0100
committerTristan Gingold <tgingold@free.fr>2023-03-23 07:25:15 +0100
commitb9bd50be737ff13967edf442717673fd9100941f (patch)
treef874c2b76751c7408591f5c8fae4e8d0cfad69f7 /src
parent863df0ba75e7bd883b53a47e600955c249015462 (diff)
downloadghdl-b9bd50be737ff13967edf442717673fd9100941f.tar.gz
ghdl-b9bd50be737ff13967edf442717673fd9100941f.tar.bz2
ghdl-b9bd50be737ff13967edf442717673fd9100941f.zip
vhdl: make instance_package_body forward_ref, adjust
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-configuration.adb1
-rw-r--r--src/vhdl/vhdl-nodes.ads2
-rw-r--r--src/vhdl/vhdl-nodes_meta.adb2
-rw-r--r--src/vhdl/vhdl-sem_inst.adb4
4 files changed, 5 insertions, 4 deletions
diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb
index a05009c7a..b17a5d2c5 100644
--- a/src/vhdl/vhdl-configuration.adb
+++ b/src/vhdl/vhdl-configuration.adb
@@ -195,7 +195,6 @@ package body Vhdl.Configuration is
end if;
end if;
if Bod /= Null_Iir then
- Set_Package (Get_Library_Unit (Bod), Lib_Unit);
Add_Design_Unit (Bod, Loc);
end if;
end;
diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads
index 8601159db..7b1f476e1 100644
--- a/src/vhdl/vhdl-nodes.ads
+++ b/src/vhdl/vhdl-nodes.ads
@@ -8149,7 +8149,7 @@ package Vhdl.Nodes is
procedure Set_Package_Body (Pkg : Iir; Decl : Iir);
-- The package body corresponding to the package declaration.
- -- Field: Field4
+ -- Field: Field4 Forward_Ref
function Get_Instance_Package_Body (Pkg : Iir) return Iir;
procedure Set_Instance_Package_Body (Pkg : Iir; Decl : Iir);
diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb
index d3187b7cc..61b9cff37 100644
--- a/src/vhdl/vhdl-nodes_meta.adb
+++ b/src/vhdl/vhdl-nodes_meta.adb
@@ -2012,7 +2012,7 @@ package body Vhdl.Nodes_Meta is
when Field_Package_Body =>
return Attr_Forward_Ref;
when Field_Instance_Package_Body =>
- return Attr_None;
+ return Attr_Forward_Ref;
when Field_Need_Body =>
return Attr_None;
when Field_Immediate_Body_Flag =>
diff --git a/src/vhdl/vhdl-sem_inst.adb b/src/vhdl/vhdl-sem_inst.adb
index 66754d91d..02e63836d 100644
--- a/src/vhdl/vhdl-sem_inst.adb
+++ b/src/vhdl/vhdl-sem_inst.adb
@@ -614,7 +614,9 @@ package body Vhdl.Sem_Inst is
-- Do not instantiate the body of a package while
-- instantiating a shared package.
if not Is_Within_Shared_Instance then
- Instantiate_Iir_Field (Res, N, F);
+ Set_Instance_Package_Body
+ (Res, Instantiate_Iir (Get_Instance_Package_Body (N),
+ False));
end if;
when Field_Subtype_Definition =>