diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-01-14 06:24:33 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-01-14 06:24:33 +0100 |
commit | 1b3915222c3755692ae1693ef1bb8f9d3dc52172 (patch) | |
tree | 799779b4f9b35d9f4faa4046786ee7dec5f91b58 /src/vhdl | |
parent | 4b97bbb1830f10ec17e07c5d312e35a83019a9ce (diff) | |
download | ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.tar.gz ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.tar.bz2 ghdl-1b3915222c3755692ae1693ef1bb8f9d3dc52172.zip |
synth: handle macro-expanded package body. Fix #1948
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-annotations.adb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb index ec6efd46a..43477c1d2 100644 --- a/src/vhdl/vhdl-annotations.adb +++ b/src/vhdl/vhdl-annotations.adb @@ -665,15 +665,23 @@ package body Vhdl.Annotations is end if; end Annotate_Package_Declaration; - procedure Annotate_Package_Body (Decl: Iir) + procedure Annotate_Package_Body (Bod: Iir) is - Package_Info : constant Sim_Info_Acc := Get_Info (Get_Package (Decl)); + Pkg : constant Node := Get_Package (Bod); + Package_Info : constant Sim_Info_Acc := Get_Info (Pkg); begin + if Is_Uninstantiated_Package (Pkg) + and then Get_Macro_Expanded_Flag (Pkg) + then + -- The body of a macro-expanded flag. + return; + end if; + -- Set info field of package body declaration. - Set_Info (Decl, Package_Info); + Set_Info (Bod, Package_Info); -- declarations - Annotate_Declaration_List (Package_Info, Get_Declaration_Chain (Decl)); + Annotate_Declaration_List (Package_Info, Get_Declaration_Chain (Bod)); end Annotate_Package_Body; procedure Annotate_Declaration_Type (Block_Info: Sim_Info_Acc; Decl: Iir) |