aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-01-11 06:48:24 +0100
committerTristan Gingold <tgingold@free.fr>2019-01-11 06:48:24 +0100
commit345d783813d79c1431ae5a70bf85dcf775ffe3b5 (patch)
tree76c6c025db9e9604bfcf3f6b7ba09742ef54c4b1 /src
parent94c9804c990fd3a76a2dd1385e14a8c8d76f3e77 (diff)
downloadghdl-345d783813d79c1431ae5a70bf85dcf775ffe3b5.tar.gz
ghdl-345d783813d79c1431ae5a70bf85dcf775ffe3b5.tar.bz2
ghdl-345d783813d79c1431ae5a70bf85dcf775ffe3b5.zip
trans-chap6: minor refactoring.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/translate/trans-chap6.adb10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vhdl/translate/trans-chap6.adb b/src/vhdl/translate/trans-chap6.adb
index 6e449725f..a1c8fa658 100644
--- a/src/vhdl/translate/trans-chap6.adb
+++ b/src/vhdl/translate/trans-chap6.adb
@@ -554,17 +554,15 @@ package body Trans.Chap6 is
-- Both prefix and result are constrained array.
declare
+ Index_Range : constant Iir := Get_Range_Constraint (Index_Type);
+ Slice_Index_Type : constant Iir := Get_Index_Type (Slice_Type, 0);
+ Slice_Range : constant Iir :=
+ Get_Range_Constraint (Slice_Index_Type);
Prefix_Left, Slice_Left : Iir_Int64;
Off : Iir_Int64;
- Slice_Index_Type : Iir;
- Slice_Range : Iir;
Slice_Length : Iir_Int64;
- Index_Range : Iir;
begin
- Index_Range := Get_Range_Constraint (Index_Type);
Prefix_Left := Eval_Pos (Get_Left_Limit (Index_Range));
- Slice_Index_Type := Get_Index_Type (Slice_Type, 0);
- Slice_Range := Get_Range_Constraint (Slice_Index_Type);
Slice_Left := Eval_Pos (Get_Left_Limit (Slice_Range));
Slice_Length := Eval_Discrete_Range_Length (Slice_Range);
if Slice_Length = 0 then