aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-evaluation.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/vhdl-evaluation.adb')
-rw-r--r--src/vhdl/vhdl-evaluation.adb14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-evaluation.adb b/src/vhdl/vhdl-evaluation.adb
index 65d099a42..6363411aa 100644
--- a/src/vhdl/vhdl-evaluation.adb
+++ b/src/vhdl/vhdl-evaluation.adb
@@ -3487,6 +3487,20 @@ package body Vhdl.Evaluation is
end case;
end Eval_Discrete_Type_Length;
+ function Eval_Is_Null_Discrete_Range (Rng : Iir) return Boolean
+ is
+ Left, Right : Iir_Int64;
+ begin
+ Left := Eval_Pos (Get_Left_Limit (Rng));
+ Right := Eval_Pos (Get_Right_Limit (Rng));
+ case Get_Direction (Rng) is
+ when Iir_To =>
+ return Right < Left;
+ when Iir_Downto =>
+ return Left < Right;
+ end case;
+ end Eval_Is_Null_Discrete_Range;
+
function Eval_Pos (Expr : Iir) return Iir_Int64 is
begin
case Get_Kind (Expr) is