Skip to content

Commit

Permalink
Use WORK location for loading the elaborated unit.
Browse files Browse the repository at this point in the history
This sets a real location for error messages.
  • Loading branch information
gingold-adacore committed Dec 30, 2015
1 parent 8f2a319 commit 73f999b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/vhdl/configuration.adb
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ package body Configuration is
Lib_Unit := Get_Library_Unit (Unit);
case Get_Kind (Lib_Unit) is
when Iir_Kind_Entity_Declaration =>
Load_Design_Unit (Unit, Null_Iir);
-- Use WORK as location (should use a command line location ?)
Load_Design_Unit (Unit, Work_Library);
Lib_Unit := Get_Library_Unit (Unit);
if Secondary_Id /= Null_Identifier then
Unit := Find_Secondary_Unit (Unit, Secondary_Id);
Expand Down
8 changes: 7 additions & 1 deletion src/vhdl/errorout.adb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ package body Errorout is
Location_To_Position (Loc, File, Line, Col);
end if;
when Semantic =>
Location_To_Position (Loc, File, Line, Col);
if Loc = No_Location then
File := No_Source_File_Entry;
Line := 0;
Col := 0;
else
Location_To_Position (Loc, File, Line, Col);
end if;
end case;

if Progname then
Expand Down

0 comments on commit 73f999b

Please sign in to comment.