aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-04-08 21:54:05 +0200
committerTristan Gingold <tgingold@free.fr>2023-04-08 21:54:05 +0200
commita8e9e6c316d66ba9cc3a879ba2323f8a83d052dc (patch)
tree023087556507a489bdc616aa96ea5e15f367a71e /src
parenta352a7d0e3e06a3453065f30e976a83a8269beea (diff)
downloadghdl-a8e9e6c316d66ba9cc3a879ba2323f8a83d052dc.tar.gz
ghdl-a8e9e6c316d66ba9cc3a879ba2323f8a83d052dc.tar.bz2
ghdl-a8e9e6c316d66ba9cc3a879ba2323f8a83d052dc.zip
trans-chap2: add comments
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/translate/trans-chap2.adb5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb
index e2a2cc398..4593b0be8 100644
--- a/src/vhdl/translate/trans-chap2.adb
+++ b/src/vhdl/translate/trans-chap2.adb
@@ -1057,6 +1057,7 @@ package body Trans.Chap2 is
procedure Elab_Package_Body (Spec : Iir_Package_Declaration; Bod : Iir)
is
+ -- SPEC can be a package declaration or a package instantiation.
Is_Spec_Decl : constant Boolean :=
Get_Kind (Spec) = Iir_Kind_Package_Declaration;
@@ -1066,14 +1067,18 @@ package body Trans.Chap2 is
Final : Boolean;
begin
if Is_Spec_Decl and then Get_Macro_Expanded_Flag (Spec) then
+ -- Macro-expanded packages are skipped.
return;
end if;
if not Flag_Elaboration and not Is_Nested_Package (Spec) then
+ -- No elaboration code generated, except for nested packages
+ -- (could be within a subprogram).
return;
end if;
if Is_Spec_Decl and then Is_Uninstantiated_Package (Spec) then
+ -- Make spec reachable.
Set_Scope_Via_Field (Info.Package_Spec_Scope,
Info.Package_Spec_Field,
Info.Package_Body_Scope'Access);