From e00d31baa0e7190b959cfb03df03b260e402da05 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 22 Oct 2014 13:15:33 +0200 Subject: Rework for support of generic packages. --- evaluation.adb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'evaluation.adb') 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. -- cgit v1.2.3