summaryrefslogtreecommitdiff
path: root/translate/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold2014-09-25 07:38:09 +0200
committerTristan Gingold2014-09-25 07:38:09 +0200
commit68d26922e31aad3cb34dd3b7689bcec75ad70fcb (patch)
treeed7d40115bd74b0c4216a94bfc21d5af0837ce4f /translate/ghdldrv
parent5edf93b87e8f3528d9063df08bf70bf538d72545 (diff)
downloadghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.tar.gz
ghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.tar.bz2
ghdl-68d26922e31aad3cb34dd3b7689bcec75ad70fcb.zip
Add a python script to automatically generate disp_tree.
Diffstat (limited to 'translate/ghdldrv')
-rw-r--r--translate/ghdldrv/ghdlcomp.adb14
-rw-r--r--translate/ghdldrv/ghdldrv.adb3
2 files changed, 17 insertions, 0 deletions
diff --git a/translate/ghdldrv/ghdlcomp.adb b/translate/ghdldrv/ghdlcomp.adb
index 1d72394..ba755af 100644
--- a/translate/ghdldrv/ghdlcomp.adb
+++ b/translate/ghdldrv/ghdlcomp.adb
@@ -24,6 +24,7 @@ with Ada.Text_IO;
with Types;
with Iirs; use Iirs;
+with Nodes_GC;
with Flags;
with Back_End;
with Sem;
@@ -39,6 +40,9 @@ package body Ghdlcomp is
Flag_Expect_Failure : Boolean := False;
+ Flag_Debug_Nodes_Leak : Boolean := False;
+ -- If True, detect unreferenced nodes at the end of analysis.
+
-- Commands which use the mcode compiler.
type Command_Comp is abstract new Command_Lib with null record;
procedure Decode_Option (Cmd : in out Command_Comp;
@@ -56,6 +60,9 @@ package body Ghdlcomp is
if Option = "--expect-failure" then
Flag_Expect_Failure := True;
Res := Option_Ok;
+ elsif Option = "--debug-nodes-leak" then
+ Flag_Debug_Nodes_Leak := True;
+ Res := Option_Ok;
elsif Hooks.Decode_Option.all (Option) then
Res := Option_Ok;
else
@@ -318,6 +325,8 @@ package body Ghdlcomp is
raise Compilation_Error;
end if;
+ Free_Iir (Design_File);
+
-- Do late analysis checks.
Unit := Get_First_Design_Unit (New_Design_File);
while Unit /= Null_Iir loop
@@ -335,7 +344,12 @@ package body Ghdlcomp is
raise Compilation_Error;
end if;
+ if Flag_Debug_Nodes_Leak then
+ Nodes_GC.Report_Unreferenced;
+ end if;
+
Libraries.Save_Work_Library;
+
exception
when Compilation_Error =>
if Flag_Expect_Failure and Errorout.Nbr_Errors /= 0 then
diff --git a/translate/ghdldrv/ghdldrv.adb b/translate/ghdldrv/ghdldrv.adb
index 72500ef..50fd6d7 100644
--- a/translate/ghdldrv/ghdldrv.adb
+++ b/translate/ghdldrv/ghdldrv.adb
@@ -113,6 +113,9 @@ package body Ghdldrv is
elsif Status = 1 then
Error ("compilation error");
raise Compile_Error;
+ elsif Status > 127 then
+ Error ("executable killed by a signal");
+ raise Exec_Error;
else
Error ("exec error");
raise Exec_Error;