aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-28 20:44:40 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-28 20:44:40 +0200
commit2068fb5a9eba5da625d2dd73fdcb47755487d9f3 (patch)
tree4e0d0be6b65e6e5f73b6db3243f802e137cab6f2 /src/synth/synth-expr.adb
parent81e426a6d34e71c9f171673d33fcf16c250f060e (diff)
downloadghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.tar.gz
ghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.tar.bz2
ghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.zip
synth: remove extract_bound (trivial).
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r--src/synth/synth-expr.adb10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 21511e615..37e9a8a44 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1120,9 +1120,8 @@ package body Synth.Expr is
function Index_To_Offset (Pfx : Value_Acc; Idx : Int64; Loc : Node)
return Uns32
is
- Rng : Type_Acc;
+ Rng : constant Type_Acc := Pfx.Typ;
begin
- Rng := Extract_Bound (Pfx);
if not In_Bounds (Rng.Vbound, Int32 (Idx)) then
Error_Msg_Synth (+Loc, "index not within bounds");
return 0;
@@ -1140,12 +1139,10 @@ package body Synth.Expr is
function Dyn_Index_To_Offset (Pfx : Value_Acc; Idx : Net; Loc : Node)
return Net
is
- Bnd : Type_Acc;
+ Bnd : constant Type_Acc := Pfx.Typ;
Off : Net;
Right : Net;
begin
- Bnd := Extract_Bound (Pfx);
-
-- TODO: handle width.
Right := Build_Const_UB32
(Build_Context, To_Uns32 (Bnd.Vbound.Right), 32);
@@ -1444,7 +1441,7 @@ package body Synth.Expr is
is
Pfx_Node : constant Node := Get_Prefix (Name);
Pfx : constant Value_Acc := Synth_Expression (Syn_Inst, Pfx_Node);
- Bnd : Type_Acc;
+ Bnd : constant Type_Acc := Pfx.Typ;
Res_Bnd : Type_Acc;
Inp : Net;
Step : Uns32;
@@ -1452,7 +1449,6 @@ package body Synth.Expr is
Wd : Uns32;
N : Net;
begin
- Bnd := Extract_Bound (Pfx);
Synth_Slice_Suffix (Syn_Inst, Name, Bnd, Res_Bnd, Inp, Step, Off, Wd);
if Inp /= No_Net then
N := Build_Dyn_Extract (Build_Context, Get_Net (Pfx),