From ebd058ec722554f1809de7cdc6e4d1ed951acbe1 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 15 Jan 2022 16:31:58 +0100 Subject: vhdl: add comments --- src/vhdl/vhdl-annotations.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb index 43477c1d2..71d43dfe1 100644 --- a/src/vhdl/vhdl-annotations.adb +++ b/src/vhdl/vhdl-annotations.adb @@ -512,7 +512,9 @@ package body Vhdl.Annotations is Annotate_Interface_Package_Declaration (Block_Info, Decl); when Iir_Kind_Interface_Type_Declaration => if Flag_Synthesis then - -- Create an info on the interface_type_definition + -- Create an info on the interface_type_definition. + -- This is needed for a generic type in an entity, as the + -- nodes are not instantiated. Create_Object_Info (Block_Info, Get_Type (Decl)); end if; when Iir_Kinds_Interface_Subprogram_Declaration => @@ -609,6 +611,8 @@ package body Vhdl.Annotations is and then Is_Uninstantiated_Package (Decl) and then Get_Macro_Expanded_Flag (Decl) then + -- Macro-expanded packages are ignored. Only their instances are + -- annotated. return; end if; @@ -618,6 +622,7 @@ package body Vhdl.Annotations is Nbr_Objects => 0, Pkg_Slot => Invalid_Object_Slot, Pkg_Parent => null); + if Is_Inst or else not Is_Uninstantiated_Package (Decl) then Block_Info.Nbr_Objects := Block_Info.Nbr_Objects + 1; Package_Info.Pkg_Slot := Block_Info.Nbr_Objects; -- cgit v1.2.3