diff options
author | Tristan Gingold | 2015-01-14 03:50:46 +0100 |
---|---|---|
committer | Tristan Gingold | 2015-01-14 03:50:46 +0100 |
commit | 221bd46f4dd1bcb3496c7e6a9c728ed33b9616dd (patch) | |
tree | 6668df6d6f2a82d20bbba8e4e3c1b8469cc30a25 | |
parent | 2bc30247415e3165ec17d667bb028f23538bc2ea (diff) | |
download | ghdl-221bd46f4dd1bcb3496c7e6a9c728ed33b9616dd.tar.gz ghdl-221bd46f4dd1bcb3496c7e6a9c728ed33b9616dd.tar.bz2 ghdl-221bd46f4dd1bcb3496c7e6a9c728ed33b9616dd.zip |
xrefs: adjust for vhdl08.
-rw-r--r-- | src/vhdl/parse.adb | 23 | ||||
-rw-r--r-- | src/vhdl/sem.adb | 1 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 5430e05..fef7347 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -6298,8 +6298,10 @@ package body Parse is is Res : Iir_Generate_Statement; Alt_Label : Name_Id; + Alt_Loc : Location_Type; Cond : Iir; Clause : Iir; + Bod : Iir; Last : Iir; begin if Label = Null_Identifier then @@ -6327,6 +6329,7 @@ package body Parse is -- In fact the parsed condition was an alternate label. Alt_Label := Get_Identifier (Cond); + Alt_Loc := Get_Location (Cond); Free_Iir (Cond); else Error_Msg_Parse ("alternative label must be an identifier"); @@ -6345,8 +6348,14 @@ package body Parse is Expect (Tok_Generate); Scan; - Set_Generate_Statement_Body - (Clause, Parse_Generate_Statement_Body (Res, Alt_Label)); + Bod := Parse_Generate_Statement_Body (Res, Alt_Label); + + if Alt_Label /= Null_Identifier then + -- Set location on the label, for xrefs. + Set_Location (Bod, Alt_Loc); + end if; + + Set_Generate_Statement_Body (Clause, Bod); if Last /= Null_Iir then Set_Generate_Else_Clause (Last, Clause); @@ -6369,6 +6378,7 @@ package body Parse is if Current_Token = Tok_Identifier then Alt_Label := Current_Identifier; + Alt_Loc := Get_Token_Location; -- Skip identifier Scan; @@ -6385,8 +6395,13 @@ package body Parse is Expect (Tok_Generate); Scan; - Set_Generate_Statement_Body - (Clause, Parse_Generate_Statement_Body (Res, Alt_Label)); + Bod := Parse_Generate_Statement_Body (Res, Alt_Label); + if Alt_Label /= Null_Identifier then + -- Set location on the label, for xrefs. + Set_Location (Bod, Alt_Loc); + end if; + + Set_Generate_Statement_Body (Clause, Bod); Set_Generate_Else_Clause (Last, Clause); end if; diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index 1380568..608bfc8 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -795,6 +795,7 @@ package body Sem is return Null_Iir; end if; Set_Named_Entity (Block_Spec, Res); + Xref_Ref (Gen_Spec, Res); Set_Prefix (Block_Spec, Block_Name); Set_Block_Specification (Block_Conf, Block_Spec); when others => |