Apply autofix suggestions from code review

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Bartłomiej Chmiel 2025-11-05 08:25:10 -05:00 committed by GitHub
parent 61a1dd9531
commit 37f0bd87d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View File

@ -108,9 +108,8 @@ class AssertPropertiesParser final : public VNVisitorConst {
// STATE // STATE
std::unique_ptr<V3Graph> m_graphp = std::make_unique<V3Graph>(); // Property tree std::unique_ptr<V3Graph> m_graphp = std::make_unique<V3Graph>(); // Property tree
DfaVertex* m_lastp = nullptr; // Last encountered vertex DfaVertex* m_lastp = nullptr; // Last encountered vertex
bool m_underSExpr bool m_underSExpr = false; // Is under sequence expression, for creating a start node
= false; // Whether it is under sequence expression for creating a start node size_t m_underLogNots = 0; // Number of 'not' operators before sequence
size_t m_underLogNots = 0; // Number of not operators before sequence
// VISITORS // VISITORS
void visit(AstNodeCoverOrAssert* nodep) override { iterateChildrenConst(nodep); } void visit(AstNodeCoverOrAssert* nodep) override { iterateChildrenConst(nodep); }

View File

@ -7015,7 +7015,7 @@ class WidthVisitor final : public VNVisitor {
iterateCheckBool(nodep, "LHS", nodep->op1p(), BOTH); iterateCheckBool(nodep, "LHS", nodep->op1p(), BOTH);
nodep->dtypeSetBit(); nodep->dtypeSetBit();
if (m_underSExpr) { if (m_underSExpr) {
nodep->v3error("Unexpected not in sequence expression context"); nodep->v3error("Unexpected 'not' in sequence expression context");
AstConst* const newp = new AstConst{nodep->fileline(), 0}; AstConst* const newp = new AstConst{nodep->fileline(), 0};
newp->dtypeFrom(nodep); newp->dtypeFrom(nodep);
nodep->replaceWith(newp); nodep->replaceWith(newp);

View File

@ -6534,7 +6534,8 @@ pexpr<nodeExprp>: // IEEE: property_expr (The name pexpr is important as regex
// // IEEE: '(' pexpr ')' // // IEEE: '(' pexpr ')'
// // Expanded below // // Expanded below
// //
yNOT pexpr { $$ = new AstLogNot{$1, $2}; } yNOT pexpr
{ $$ = new AstLogNot{$1, $2}; }
| ySTRONG '(' sexpr ')' | ySTRONG '(' sexpr ')'
{ $$ = $3; BBUNSUP($2, "Unsupported: strong (in property expression)"); } { $$ = $3; BBUNSUP($2, "Unsupported: strong (in property expression)"); }
| yWEAK '(' sexpr ')' | yWEAK '(' sexpr ')'
@ -6628,9 +6629,7 @@ sexpr<nodeExprp>: // ==IEEE: sequence_expr (The name sexpr is important as reg
} }
} }
| ~p~sexpr cycle_delay_range sexpr %prec prPOUNDPOUND_MULTI | ~p~sexpr cycle_delay_range sexpr %prec prPOUNDPOUND_MULTI
{ { $$ = new AstSExpr{$<fl>2, $1, $2, $3}; }
$$ = new AstSExpr{$<fl>2, $1, $2, $3};
}
// //
// // IEEE: expression_or_dist [ boolean_abbrev ] // // IEEE: expression_or_dist [ boolean_abbrev ]
// // Note expression_or_dist includes "expr"! // // Note expression_or_dist includes "expr"!