From f6fde5424ad9585ef61149403cd695b465addd8b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 15 Jul 2019 18:40:04 +0200 Subject: ghdlsynth: quit early in case of error. --- src/ghdldrv/ghdlsynth.adb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index 429d1ab55..861a9eb66 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -139,6 +139,10 @@ package body Ghdlsynth is end if; Errorout.Report_Msg (Msgid_Note, Option, No_Source_Coord, "top entity is %i", (1 => +Top)); + if Nbr_Errors > 0 then + -- No need to configure if there are missing units. + return No_Module; + end if; Prim_Id := Get_Identifier (Top); Sec_Id := Null_Identifier; else @@ -152,6 +156,11 @@ package body Ghdlsynth is Config := Vhdl.Configuration.Configure (Prim_Id, Sec_Id); + if Nbr_Errors > 0 then + -- No need to configure if there are missing units. + return No_Module; + end if; + -- Check (and possibly abandon) if entity can be at the top of the -- hierarchy. declare @@ -162,7 +171,7 @@ package body Ghdlsynth is begin Vhdl.Configuration.Check_Entity_Declaration_Top (Entity, False); if Nbr_Errors > 0 then - raise Compilation_Error; + return No_Module; end if; end; -- cgit v1.2.3