diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-10-22 13:15:33 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-10-22 13:15:33 +0200 |
commit | e00d31baa0e7190b959cfb03df03b260e402da05 (patch) | |
tree | 9ed433cdd9d38d6432e3dc016d1b942fbf97519c /evaluation.adb | |
parent | 0e199cbea1070c016d29348cd659b9e6ca688afb (diff) | |
download | ghdl-e00d31baa0e7190b959cfb03df03b260e402da05.tar.gz ghdl-e00d31baa0e7190b959cfb03df03b260e402da05.tar.bz2 ghdl-e00d31baa0e7190b959cfb03df03b260e402da05.zip |
Rework for support of generic packages.
Diffstat (limited to 'evaluation.adb')
-rw-r--r-- | evaluation.adb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/evaluation.adb b/evaluation.adb index a20d2c68f..dd16b2276 100644 --- a/evaluation.adb +++ b/evaluation.adb @@ -288,6 +288,22 @@ package body Evaluation is return Res; end Build_Constant_Range; + function Build_Extreme_Value (Is_Pos : Boolean; Origin : Iir) return Iir + is + Orig_Type : constant Iir := Get_Base_Type (Get_Type (Origin)); + begin + case Get_Kind (Orig_Type) is + when Iir_Kind_Integer_Type_Definition => + if Is_Pos then + return Build_Integer (Iir_Int64'Last, Origin); + else + return Build_Integer (Iir_Int64'First, Origin); + end if; + when others => + Error_Kind ("build_extreme_value", Orig_Type); + end case; + end Build_Extreme_Value; + -- A_RANGE is a range expression, whose type, location, expr_staticness, -- left_limit and direction are set. -- Type of A_RANGE must have a range_constraint. |