diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-06 07:32:14 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-07-07 19:26:44 +0200 |
commit | f218907306bb64565ceecae98b1515f979b96737 (patch) | |
tree | 55e7ca3f5698513df1e8d5b00e8bde2e2286b111 | |
parent | 6228aa37e86a693f85cdf97c9f5f0b333cab7c3a (diff) | |
download | ghdl-f218907306bb64565ceecae98b1515f979b96737.tar.gz ghdl-f218907306bb64565ceecae98b1515f979b96737.tar.bz2 ghdl-f218907306bb64565ceecae98b1515f979b96737.zip |
Adjust xrefs for case-generate and context declaration.
-rw-r--r-- | src/vhdl/parse.adb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 4f07c3e59..eaab1351f 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -6878,6 +6878,7 @@ package body Parse is is Loc : Location_Type; Alt_Label : Name_Id; + Bod : Iir; Assoc : Iir; Expr : Iir; begin @@ -6925,8 +6926,12 @@ package body Parse is Expect (Tok_Double_Arrow); Scan; - Set_Associated_Block - (Assoc, Parse_Generate_Statement_Body (Parent, Alt_Label)); + Bod := Parse_Generate_Statement_Body (Parent, Alt_Label); + Set_Associated_Block (Assoc, Bod); + if Alt_Label /= Null_Identifier then + -- Set location on the label, for xrefs. + Set_Location (Bod, Loc); + end if; return Assoc; end Parse_Case_Generate_Alternative; @@ -8252,10 +8257,11 @@ package body Parse is if Current_Token = Tok_Is then Res := Create_Iir (Iir_Kind_Context_Declaration); - Set_Location (Res, Loc); if Get_Kind (Name) = Iir_Kind_Simple_Name then + Location_Copy (Res, Name); Set_Identifier (Res, Get_Identifier (Name)); else + Set_Location (Res, Loc); Error_Msg_Parse ("identifier for context expected", Name); end if; Free_Iir (Name); |