diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-05 08:38:13 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-05 08:38:13 +0100 |
commit | ab5e10334eb99b96f221d9c54474557b496ea841 (patch) | |
tree | 82f59ca316a07850d96373268df2a91c2964c634 | |
parent | eb461d9a6f010d9cb77a0cee6e9850b1aee0dcf7 (diff) | |
download | ghdl-ab5e10334eb99b96f221d9c54474557b496ea841.tar.gz ghdl-ab5e10334eb99b96f221d9c54474557b496ea841.tar.bz2 ghdl-ab5e10334eb99b96f221d9c54474557b496ea841.zip |
Fix duplicate owner in conversion, fix early reference in attribute spec.
-rw-r--r-- | src/vhdl/sem_assocs.adb | 5 | ||||
-rw-r--r-- | src/vhdl/sem_specs.adb | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/vhdl/sem_assocs.adb b/src/vhdl/sem_assocs.adb index a4eee2081..5be583945 100644 --- a/src/vhdl/sem_assocs.adb +++ b/src/vhdl/sem_assocs.adb @@ -1896,6 +1896,9 @@ package body Sem_Assocs is Formal : Iir; Conv_Assoc : Iir; begin + -- Extract formal from the conversion (and unlink it from the + -- conversion, as the owner of the formal is the association, not + -- the conversion). Formal := Finish_Sem_Name (Get_Formal (Assoc)); case Get_Kind (Formal) is when Iir_Kind_Function_Call => @@ -1908,8 +1911,10 @@ package body Sem_Assocs is -- Name_To_Method_Object (Func, Conv); when Iir_Kind_Type_Conversion => pragma Assert (Formal_Conv /= Null_Iir); + Conv_Assoc := Formal; Set_Formal_Conversion (Assoc, Formal); Formal := Get_Expression (Formal); + Set_Expression (Conv_Assoc, Null_Iir); when others => pragma Assert (Formal_Conv = Null_Iir); null; diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb index 8d0eb03a8..8c9cd2391 100644 --- a/src/vhdl/sem_specs.adb +++ b/src/vhdl/sem_specs.adb @@ -379,14 +379,23 @@ package body Sem_Specs is -- Note: ENT and DECL are different for aliases. function Sem_Named_Entity1 (Ent : Iir; Decl : Iir) return Boolean is + use Tokens; Ent_Id : constant Name_Id := Get_Identifier (Ent); begin if (not Is_Designator or else Ent_Id = Get_Identifier (Name)) and then Ent_Id /= Null_Identifier then if Is_Designator then + -- The designator is neither ALL nor OTHERS. Set_Named_Entity (Name, Ent); Xref_Ref (Name, Ent); + + if Get_Entity_Class (Attr) = Tok_Label then + -- Concurrent or sequential statements appear later in the + -- AST, but their label are considered to appear before + -- other items in the declarative part. + Set_Is_Forward_Ref (Name, True); + end if; end if; if Get_Visible_Flag (Ent) = False then Error_Msg_Sem (+Attr, "%n is not yet visible", +Ent); |