From 3b81654c728289aba2fa21bc955289bb9a9c40bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Chmiel?= Date: Tue, 6 Aug 2024 14:48:12 +0200 Subject: [PATCH] Fix -Wunused-but-set-variable clang warning (#5331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bartłomiej Chmiel --- src/V3Begin.cpp | 3 +-- src/V3EmitCConstInit.h | 3 +-- src/V3Hasher.cpp | 2 +- src/V3SenExprBuilder.h | 3 +-- src/V3Split.cpp | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index 8d97efb8f..5a9ced53c 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -462,8 +462,7 @@ AstNode* V3Begin::convertToWhile(AstForeach* nodep) { rightp->dtypeSetSigned32(); rightp->protect(false); loopp = createForeachLoop(nodep, bodyPointp, varp, leftp, rightp, VNType::atLt); - } else if (const AstAssocArrayDType* const adtypep - = VN_CAST(fromDtp, AssocArrayDType)) { + } else if (VN_IS(fromDtp, AssocArrayDType)) { // Make this: var KEY_TYPE index; // bit index__Vfirst; // index__Vfirst = 0; diff --git a/src/V3EmitCConstInit.h b/src/V3EmitCConstInit.h index 5905ffc9d..3950efb7a 100644 --- a/src/V3EmitCConstInit.h +++ b/src/V3EmitCConstInit.h @@ -48,8 +48,7 @@ protected: VL_RESTORER(m_inUnpacked); VL_RESTORER(m_unpackedWord); m_inUnpacked = true; - if (const AstAssocArrayDType* const dtypep - = VN_CAST(nodep->dtypep()->skipRefp(), AssocArrayDType)) { + if (VN_IS(nodep->dtypep()->skipRefp(), AssocArrayDType)) { // Note the double {{ initializer. The first { starts the initializer of the // VlUnpacked, and the second starts the initializer of m_storage within the // VlUnpacked. diff --git a/src/V3Hasher.cpp b/src/V3Hasher.cpp index 03de04810..a74b75419 100644 --- a/src/V3Hasher.cpp +++ b/src/V3Hasher.cpp @@ -368,7 +368,7 @@ class HasherVisitor final : public VNVisitorConst { m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {}); } void visit(AstInitArray* nodep) override { - if (const AstAssocArrayDType* const dtypep = VN_CAST(nodep->dtypep(), AssocArrayDType)) { + if (VN_IS(nodep->dtypep(), AssocArrayDType)) { if (nodep->defaultp()) { m_hash += hashNodeAndIterate(nodep->defaultp(), HASH_DTYPE, HASH_CHILDREN, []() {}); diff --git a/src/V3SenExprBuilder.h b/src/V3SenExprBuilder.h index d72fc157b..5e57bcdc6 100644 --- a/src/V3SenExprBuilder.h +++ b/src/V3SenExprBuilder.h @@ -139,8 +139,7 @@ class SenExprBuilder final { return prevp; } - if (AstUnpackArrayDType* const dtypep - = VN_CAST(exprp->dtypep()->skipRefp(), UnpackArrayDType)) { + if (VN_IS(exprp->dtypep()->skipRefp(), UnpackArrayDType)) { AstCMethodHard* const cmhp = new AstCMethodHard{flp, wrPrev(), "assign", rdCurr()}; cmhp->dtypeSetVoid(); m_postUpdates.push_back(cmhp->makeStmt()); diff --git a/src/V3Split.cpp b/src/V3Split.cpp index 587a057fb..76c531644 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -476,7 +476,7 @@ protected: // vertexes not involved with this step as unimportant for (V3GraphVertex& vertex : m_graph.vertices()) { if (!vertex.user()) { - if (const SplitLogicVertex* const vvertexp = vertex.cast()) { + if (vertex.is()) { for (V3GraphEdge& edge : vertex.inEdges()) { SplitEdge& oedge = static_cast(edge); oedge.setIgnoreThisStep();