aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-11 19:22:19 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-11 19:22:19 +0200
commit6479e65a8d4c4ed44dad2d7b97758d36f579094b (patch)
tree45b1cbc81b0cb67682c22fe5f3128cc904e8e3e1
parentf44d7c3466dc1b4013ef2bbeab524b28a166ef96 (diff)
downloadghdl-6479e65a8d4c4ed44dad2d7b97758d36f579094b.tar.gz
ghdl-6479e65a8d4c4ed44dad2d7b97758d36f579094b.tar.bz2
ghdl-6479e65a8d4c4ed44dad2d7b97758d36f579094b.zip
vhdl-sem_lib: save and restore nbr_errors in
-rw-r--r--src/vhdl/vhdl-sem_lib.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_lib.adb b/src/vhdl/vhdl-sem_lib.adb
index 95a4a4ae8..35e92f93d 100644
--- a/src/vhdl/vhdl-sem_lib.adb
+++ b/src/vhdl/vhdl-sem_lib.adb
@@ -335,6 +335,7 @@ package body Vhdl.Sem_Lib is
-- Load, parse, analyze, back-end a design_unit if necessary.
procedure Load_Design_Unit (Design_Unit : Iir_Design_Unit; Loc : Iir)
is
+ Prev_Nbr_Errors : Natural;
Warnings : Warnings_Setting;
begin
if Get_Date (Design_Unit) = Date_Replacing then
@@ -342,6 +343,11 @@ package body Vhdl.Sem_Lib is
return;
end if;
+ -- Save and clear Nbr_Errors so that the unit is fully analyzed even
+ -- if there were errors.
+ Prev_Nbr_Errors := Errorout.Nbr_Errors;
+ Errorout.Nbr_Errors := 0;
+
if Get_Date_State (Design_Unit) = Date_Disk then
Load_Parse_Design_Unit (Design_Unit, Loc);
end if;
@@ -375,10 +381,14 @@ package body Vhdl.Sem_Lib is
and then Check_Obsolete_Dependence (Design_Unit, Loc)
then
Set_Date (Design_Unit, Date_Obsolete);
+ Errorout.Nbr_Errors := Prev_Nbr_Errors + Errorout.Nbr_Errors;
return;
end if;
end if;
+ -- Restore nbr_errors (accumulate).
+ Errorout.Nbr_Errors := Prev_Nbr_Errors + Errorout.Nbr_Errors;
+
case Get_Date (Design_Unit) is
when Date_Parsed =>
raise Internal_Error;