From 36c4a24661ab7a9dc8563529d878a40f86b7377e Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 16 Aug 2025 21:03:12 -0400 Subject: [PATCH] Internals: constifyParamsEdit return value was unused. No functional change. --- src/V3Const.cpp | 12 ++++-------- src/V3Const.h | 10 ++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 0f009d2b7..0846a3126 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -3973,8 +3973,7 @@ uint32_t ConstVisitor::s_globalPassNum = 0; // Const class functions //! Force this cell node's parameter list to become a constant -//! @return Pointer to the edited node. -AstNode* V3Const::constifyParamsEdit(AstNode* nodep) { +void V3Const::constifyParamsEdit(AstNode* nodep) { // UINFOTREE(1, nodep, "", "forceConPRE"); // Resize even if the node already has a width, because buried in the tree // we may have a node we just created with signing, etc, that isn't sized yet. @@ -3988,16 +3987,14 @@ AstNode* V3Const::constifyParamsEdit(AstNode* nodep) { // init value because we need widthing above to handle the var's type. if (varp->valuep()) visitor.mainAcceptEdit(varp->valuep()); } else { - nodep = visitor.mainAcceptEdit(nodep); + (void)visitor.mainAcceptEdit(nodep); } // Because we do edits, nodep links may get trashed and core dump if have next line // UINFOTREE(1, nodep, "", "forceConDONE"); - return nodep; } //! Constify this cell node's parameter list if possible -//! @return Pointer to the edited node. -AstNode* V3Const::constifyParamsNoWarnEdit(AstNode* nodep) { +void V3Const::constifyParamsNoWarnEdit(AstNode* nodep) { // UINFOTREE(1, nodep, "", "forceConPRE"); // Resize even if the node already has a width, because buried in the tree // we may have a node we just created with signing, etc, that isn't sized yet. @@ -4011,11 +4008,10 @@ AstNode* V3Const::constifyParamsNoWarnEdit(AstNode* nodep) { // init value because we need widthing above to handle the var's type. if (varp->valuep()) visitor.mainAcceptEdit(varp->valuep()); } else { - nodep = visitor.mainAcceptEdit(nodep); + (void)visitor.mainAcceptEdit(nodep); } // Because we do edits, nodep links may get trashed and core dump this. // UINFOTREE(1, nodep, "", "forceConDONE"); - return nodep; } //! Force this cell node's parameter list to become a constant inside generate. diff --git a/src/V3Const.h b/src/V3Const.h index 1491f7714..c8f1c5e27 100644 --- a/src/V3Const.h +++ b/src/V3Const.h @@ -26,14 +26,8 @@ class V3Const final { public: - static AstNode* constifyParamsEdit(AstNode* nodep) VL_MT_DISABLED; - static AstNodeExpr* constifyParamsEdit(AstNodeExpr* exprp) VL_MT_DISABLED { - return VN_AS(constifyParamsEdit(static_cast(exprp)), NodeExpr); - } - static AstNode* constifyParamsNoWarnEdit(AstNode* nodep) VL_MT_DISABLED; - static AstNodeExpr* constifyParamsNoWarnEdit(AstNodeExpr* exprp) VL_MT_DISABLED { - return VN_AS(constifyParamsNoWarnEdit(static_cast(exprp)), NodeExpr); - } + static void constifyParamsEdit(AstNode* nodep) VL_MT_DISABLED; + static void constifyParamsNoWarnEdit(AstNode* nodep) VL_MT_DISABLED; static AstNode* constifyGenerateParamsEdit(AstNode* nodep) VL_MT_DISABLED; // Only do constant pushing, without removing dead logic static void constifyAllLive(AstNetlist* nodep) VL_MT_DISABLED;