Fix -Wunused-but-set-variable clang warning (#5331)

Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
This commit is contained in:
Bartłomiej Chmiel 2024-08-06 14:48:12 +02:00 committed by GitHub
parent 6abd556f5a
commit 3b81654c72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 8 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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, []() {});

View File

@ -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());

View File

@ -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<SplitLogicVertex>()) {
if (vertex.is<SplitLogicVertex>()) {
for (V3GraphEdge& edge : vertex.inEdges()) {
SplitEdge& oedge = static_cast<SplitEdge&>(edge);
oedge.setIgnoreThisStep();