aboutsummaryrefslogtreecommitdiffstats
path: root/evaluation.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2013-12-27 04:16:19 +0100
committerTristan Gingold <tgingold@free.fr>2013-12-27 04:16:19 +0100
commitd19ad6fd2e14e8c3cb8b43a7eaed747031e9316d (patch)
treef9fcf11972a63a077e6de44b0cbce134a8e17c75 /evaluation.adb
parent9eb9f4f2023d4d968c0cbc4a103ad47332b288ae (diff)
downloadghdl-d19ad6fd2e14e8c3cb8b43a7eaed747031e9316d.tar.gz
ghdl-d19ad6fd2e14e8c3cb8b43a7eaed747031e9316d.tar.bz2
ghdl-d19ad6fd2e14e8c3cb8b43a7eaed747031e9316d.zip
Fix 'range'left & co.
Diffstat (limited to 'evaluation.adb')
-rw-r--r--evaluation.adb14
1 files changed, 9 insertions, 5 deletions
diff --git a/evaluation.adb b/evaluation.adb
index 5e47e8664..d81903b77 100644
--- a/evaluation.adb
+++ b/evaluation.adb
@@ -1780,19 +1780,19 @@ package body Evaluation is
when Iir_Kind_Left_Type_Attribute =>
return Build_Constant
- (Get_Left_Limit (Eval_Range (Get_Type (Expr))), Expr);
+ (Get_Left_Limit (Eval_Range (Get_Prefix (Expr))), Expr);
when Iir_Kind_Right_Type_Attribute =>
return Build_Constant
- (Get_Right_Limit (Eval_Range (Get_Type (Expr))), Expr);
+ (Get_Right_Limit (Eval_Range (Get_Prefix (Expr))), Expr);
when Iir_Kind_High_Type_Attribute =>
return Build_Constant
- (Get_High_Limit (Eval_Range (Get_Type (Expr))), Expr);
+ (Get_High_Limit (Eval_Range (Get_Prefix (Expr))), Expr);
when Iir_Kind_Low_Type_Attribute =>
return Build_Constant
- (Get_Low_Limit (Eval_Range (Get_Type (Expr))), Expr);
+ (Get_Low_Limit (Eval_Range (Get_Prefix (Expr))), Expr);
when Iir_Kind_Ascending_Type_Attribute =>
return Build_Boolean
- (Get_Direction (Eval_Range (Get_Type (Expr))) = Iir_To, Expr);
+ (Get_Direction (Eval_Range (Get_Prefix (Expr))) = Iir_To, Expr);
when Iir_Kind_Range_Array_Attribute =>
declare
@@ -2317,6 +2317,10 @@ package body Evaluation is
(Get_Index_Subtype_List (Prefix),
Natural (Eval_Pos (Get_Parameter (Expr))) - 1);
end;
+ when Iir_Kind_Subtype_Declaration
+ | Iir_Kind_Type_Declaration
+ | Iir_Kind_Base_Attribute =>
+ return Eval_Range (Get_Type (Expr));
when others =>
Error_Kind ("eval_range", Expr);
end case;