From e815d37c2545086be0a64159f0e543d43ad5b916 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 22 Mar 2022 08:59:02 +0100 Subject: [PATCH] pform_make_var_init(): Remove unnecessary signal look-up by name `pform_make_var_init()` calls `pform_get_wire_in_scope()` but never uses the result other than checking that the signal exists. But we already know that the signal exists since we only call `pform_make_var_init()` for a freshly created signal. Remove the unnecessary signal look-up by name. Signed-off-by: Lars-Peter Clausen --- pform.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pform.cc b/pform.cc index 3b2b0a1f1..a1136ab4f 100644 --- a/pform.cc +++ b/pform.cc @@ -2536,13 +2536,6 @@ void pform_make_var_init(const struct vlltype&li, return; } - PWire*cur = pform_get_wire_in_scope(name); - if (cur == 0) { - VLerror(li, "internal error: var_init to non-register?"); - delete expr; - return; - } - PEIdent*lval = new PEIdent(name); FILE_NAME(lval, li); PAssign*ass = new PAssign(lval, expr, !gn_system_verilog());