From ee8fdad2bd5d1c18958a89f2f16ebce22f4b858b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 16 Jan 2020 18:31:00 +0100 Subject: synth: handle deferred constants. Fix #1096 --- src/synth/synth-decls.adb | 2 +- src/vhdl/vhdl-annotations.adb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 2e6426ed5..1f252bd1f 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -447,12 +447,12 @@ package body Synth.Decls is Cst : Value_Acc; Obj_Type : Type_Acc; begin + Synth_Declaration_Type (Syn_Inst, Decl); if Deferred_Decl = Null_Node or else Get_Deferred_Declaration_Flag (Decl) then -- Create the object (except for full declaration of a -- deferred constant). - Synth_Declaration_Type (Syn_Inst, Decl); Create_Object (Syn_Inst, Decl, null); end if; -- Initialize the value (except for a deferred declaration). diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb index 6a4591430..cf7659a22 100644 --- a/src/vhdl/vhdl-annotations.adb +++ b/src/vhdl/vhdl-annotations.adb @@ -756,6 +756,9 @@ package body Vhdl.Annotations is -- declaration. Annotate_Declaration_Type (Block_Info, Decl); Create_Object_Info (Block_Info, Decl); + elsif Flag_Synthesis then + -- Always create the slot for the subtype. + Annotate_Declaration_Type (Block_Info, Decl); end if; when Iir_Kind_File_Declaration => -- cgit v1.2.3