diff options
Diffstat (limited to 'src/vhdl/vhdl-sem_lib.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_lib.adb | 10 |
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; |