From bcc65a1b73b1ca088100e71f60bf82f6e06bb54e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 30 Jul 2016 07:17:59 +0200 Subject: Fix translation of leftof/rightof. --- src/vhdl/translate/trans-chap14.adb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vhdl/translate') diff --git a/src/vhdl/translate/trans-chap14.adb b/src/vhdl/translate/trans-chap14.adb index 3072b5955..190953058 100644 --- a/src/vhdl/translate/trans-chap14.adb +++ b/src/vhdl/translate/trans-chap14.adb @@ -290,6 +290,8 @@ package body Trans.Chap14 is is Expr_Type : constant Iir := Get_Type (Attr); Tinfo : constant Type_Info_Acc := Get_Info (Expr_Type); + Prefix_Type : constant Iir := + Get_Type (Get_Named_Entity (Get_Prefix (Attr))); Ttype : O_Tnode; Expr : O_Enode; Is_Inc : Boolean; @@ -305,10 +307,10 @@ package body Trans.Chap14 is Is_Inc := False; when Iir_Kind_Leftof_Attribute => Is_Inc := - Get_Direction (Get_Range_Constraint (Expr_Type)) = Iir_Downto; + Get_Direction (Get_Range_Constraint (Prefix_Type)) = Iir_Downto; when Iir_Kind_Rightof_Attribute => Is_Inc := - Get_Direction (Get_Range_Constraint (Expr_Type)) = Iir_To; + Get_Direction (Get_Range_Constraint (Prefix_Type)) = Iir_To; when others => Error_Kind ("translate_succ_pred_attribute", Attr); end case; -- cgit v1.2.3