From 6479e65a8d4c4ed44dad2d7b97758d36f579094b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 11 Jul 2019 19:22:19 +0200 Subject: vhdl-sem_lib: save and restore nbr_errors in --- src/vhdl/vhdl-sem_lib.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vhdl/vhdl-sem_lib.adb') 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; -- cgit v1.2.3