aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-03-14 18:22:42 +0100
committerTristan Gingold <tgingold@free.fr>2021-03-14 18:22:42 +0100
commit009f0b955b5084594b6912d261405fd1936750f9 (patch)
tree621e4af1a152a3254aa094eb59ad1b7123312472
parentb1092b0a72fe66cf426e48e7c72806049767a0fc (diff)
downloadghdl-009f0b955b5084594b6912d261405fd1936750f9.tar.gz
ghdl-009f0b955b5084594b6912d261405fd1936750f9.tar.bz2
ghdl-009f0b955b5084594b6912d261405fd1936750f9.zip
synth-expr.adb: add comments
-rw-r--r--src/synth/synth-expr.adb5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index a2ceb6e15..15b9914f0 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -2168,17 +2168,20 @@ package body Synth.Expr is
Left := Synth_Expression_With_Type (Syn_Inst, Left_Expr, Typ);
if Left = No_Valtyp then
+ -- Propagate error.
return No_Valtyp;
end if;
if Is_Static_Val (Left.Val)
and then Get_Static_Discrete (Left) = Val
then
+ -- Short-circuit when the left operand determines the result.
return Create_Value_Discrete (Val, Boolean_Type);
end if;
Strip_Const (Left);
Right := Synth_Expression_With_Type (Syn_Inst, Right_Expr, Typ);
if Right = No_Valtyp then
+ -- Propagate error.
return No_Valtyp;
end if;
Strip_Const (Right);
@@ -2186,6 +2189,7 @@ package body Synth.Expr is
if Is_Static_Val (Right.Val)
and then Get_Static_Discrete (Right) = Val
then
+ -- If the right operand can determine the result, return it.
return Create_Value_Discrete (Val, Boolean_Type);
end if;
@@ -2196,6 +2200,7 @@ package body Synth.Expr is
return Create_Value_Discrete (Val, Boolean_Type);
end if;
+ -- Non-static result.
N := Build_Dyadic (Ctxt, Id,
Get_Net (Ctxt, Left), Get_Net (Ctxt, Right));
Set_Location (N, Expr);