aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-12-17 18:10:22 +0100
committerTristan Gingold <tgingold@free.fr>2016-12-17 18:10:22 +0100
commit680ea916dee2f5aadeeb5f507ea918598803aca8 (patch)
treecf48e8c6e56446e0442735aac1a95d66c4772c6c /src
parent4e7d32ee912d21188cf07fd03cc343869139ba52 (diff)
downloadghdl-680ea916dee2f5aadeeb5f507ea918598803aca8.tar.gz
ghdl-680ea916dee2f5aadeeb5f507ea918598803aca8.tar.bz2
ghdl-680ea916dee2f5aadeeb5f507ea918598803aca8.zip
disp_vhdl: add -do flag to display evaluated expressions.
Diffstat (limited to 'src')
-rw-r--r--src/flags.ads3
-rw-r--r--src/options.adb2
-rw-r--r--src/vhdl/disp_vhdl.adb16
3 files changed, 13 insertions, 8 deletions
diff --git a/src/flags.ads b/src/flags.ads
index dc6dcc96d..1bb59c806 100644
--- a/src/flags.ads
+++ b/src/flags.ads
@@ -61,6 +61,9 @@ package Flags is
-- -da: disp tree after annotation
Dump_Annotate: Boolean := False;
+ -- -do: don't dump origin expression but evaluated expressions.
+ Dump_Origin_Flag : Boolean := True;
+
-- --dall: makes -dX options to apply to all files.
Dump_All: Boolean := False;
diff --git a/src/options.adb b/src/options.adb
index ccc2e534f..adfb605d4 100644
--- a/src/options.adb
+++ b/src/options.adb
@@ -143,6 +143,8 @@ package body Options is
Dump_Canon := True;
elsif Opt = "-da" then
Dump_Annotate := True;
+ elsif Opt = "-do" then
+ Dump_Origin_Flag := False;
elsif Opt = "--dall" then
Dump_All := True;
elsif Opt = "-dstats" then
diff --git a/src/vhdl/disp_vhdl.adb b/src/vhdl/disp_vhdl.adb
index c00565515..64e38eada 100644
--- a/src/vhdl/disp_vhdl.adb
+++ b/src/vhdl/disp_vhdl.adb
@@ -303,7 +303,7 @@ package body Disp_Vhdl is
declare
Origin : constant Iir := Get_Range_Origin (Rng);
begin
- if Origin /= Null_Iir then
+ if Dump_Origin_Flag and then Origin /= Null_Iir then
Disp_Expression (Origin);
else
Disp_Expression (Get_Left_Limit (Rng));
@@ -2649,21 +2649,21 @@ package body Disp_Vhdl is
case Get_Kind (Expr) is
when Iir_Kind_Integer_Literal =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_Int64 (Get_Value (Expr));
end if;
when Iir_Kind_Floating_Point_Literal =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_Fp64 (Get_Fp_Value (Expr));
end if;
when Iir_Kind_String_Literal8 =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_String_Literal
@@ -2677,7 +2677,7 @@ package body Disp_Vhdl is
when Iir_Kind_Physical_Fp_Literal
| Iir_Kind_Physical_Int_Literal =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_Physical_Literal (Expr);
@@ -2688,14 +2688,14 @@ package body Disp_Vhdl is
Disp_Identifier (Expr);
when Iir_Kind_Enumeration_Literal =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_Name_Of (Expr);
end if;
when Iir_Kind_Overflow_Literal =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Put ("*OVERFLOW*");
@@ -2709,7 +2709,7 @@ package body Disp_Vhdl is
Put ("null");
when Iir_Kind_Simple_Aggregate =>
Orig := Get_Literal_Origin (Expr);
- if Orig /= Null_Iir then
+ if Dump_Origin_Flag and then Orig /= Null_Iir then
Disp_Expression (Orig);
else
Disp_Simple_Aggregate (Expr);