aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2015-12-30 08:22:17 +0100
committerTristan Gingold <gingold@adacore.com>2015-12-30 08:22:17 +0100
commit73f999bf34ee4bfc0d88e8a22c2b2a40f3ffc3e3 (patch)
tree8821e11c2dc3af4a283250da7ed7ded26ab6a1da /src/vhdl
parent8f2a3196503cc53a8b84a00ed5c6ea5574e5c6d1 (diff)
downloadghdl-73f999bf34ee4bfc0d88e8a22c2b2a40f3ffc3e3.tar.gz
ghdl-73f999bf34ee4bfc0d88e8a22c2b2a40f3ffc3e3.tar.bz2
ghdl-73f999bf34ee4bfc0d88e8a22c2b2a40f3ffc3e3.zip
Use WORK location for loading the elaborated unit.
This sets a real location for error messages.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/configuration.adb3
-rw-r--r--src/vhdl/errorout.adb8
2 files changed, 9 insertions, 2 deletions
diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb
index a72a2540a..0d11da37b 100644
--- a/src/vhdl/configuration.adb
+++ b/src/vhdl/configuration.adb
@@ -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);
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb
index 67969bec8..0bf2b7f2c 100644
--- a/src/vhdl/errorout.adb
+++ b/src/vhdl/errorout.adb
@@ -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