From d9cb3f5313b4dd6a39fab9dc72fa2cf336dd6b08 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 3 Nov 2019 21:14:24 +0100 Subject: synth-oper: use build2_uresize --- src/synth/synth-oper.adb | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/synth') diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index d2d4e5cb9..6634a2b2b 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -45,23 +45,9 @@ package body Synth.Oper is procedure Set_Location (N : Net; Loc : Node) renames Synth.Source.Set_Location; - function Synth_Uresize (N : Net; W : Width; Loc : Node) return Net - is - Wn : constant Width := Get_Width (N); - Res : Net; + function Synth_Uresize (N : Net; W : Width; Loc : Node) return Net is begin - if Wn = W then - return N; - else - if Wn > W then - Res := Build_Trunc (Build_Context, Id_Utrunc, N, W); - else - pragma Assert (Wn < W); - Res := Build_Extend (Build_Context, Id_Uextend, N, W); - end if; - Set_Location (Res, Loc); - return Res; - end if; + return Build2_Uresize (Build_Context, N, W, Get_Location (Loc)); end Synth_Uresize; function Synth_Sresize (N : Net; W : Width; Loc : Node) return Net -- cgit v1.2.3