aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-02-10 18:58:01 +0100
committerTristan Gingold <tgingold@free.fr>2021-02-10 18:58:01 +0100
commit27835ccebbd3248dac7ed683ff242fe2a3f62af8 (patch)
treee19d56f6f650937513d1930d5220172e60bbcb78
parent7a8a3743fe7e29a44ccf9068c0af7cfc68869aa7 (diff)
downloadghdl-27835ccebbd3248dac7ed683ff242fe2a3f62af8.tar.gz
ghdl-27835ccebbd3248dac7ed683ff242fe2a3f62af8.tar.bz2
ghdl-27835ccebbd3248dac7ed683ff242fe2a3f62af8.zip
vhdl-evaluation: minor simplification
-rw-r--r--src/vhdl/vhdl-evaluation.adb4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-evaluation.adb b/src/vhdl/vhdl-evaluation.adb
index 9cce658c6..cd597462c 100644
--- a/src/vhdl/vhdl-evaluation.adb
+++ b/src/vhdl/vhdl-evaluation.adb
@@ -55,13 +55,11 @@ package body Vhdl.Evaluation is
Unit := Get_Physical_Literal
(Get_Named_Entity (Get_Unit_Name (Expr)));
pragma Assert (Get_Kind (Unit) = Iir_Kind_Integer_Literal);
- case Kind is
+ case Iir_Kinds_Physical_Literal (Kind) is
when Iir_Kind_Physical_Int_Literal =>
return Get_Value (Expr) * Get_Value (Unit);
when Iir_Kind_Physical_Fp_Literal =>
return Int64 (Get_Fp_Value (Expr) * Fp64 (Get_Value (Unit)));
- when others =>
- raise Program_Error;
end case;
when Iir_Kind_Integer_Literal =>
return Get_Value (Expr);