mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add SIDEEFFECT warning on mishandled side effect cases (#487 partial)
This commit is contained in:
@@ -220,16 +220,6 @@ private:
|
||||
}
|
||||
void prepost_stmt_visit(AstNodeTriop* nodep) {
|
||||
iterateChildren(nodep);
|
||||
|
||||
// Currently we can't reference the target, so we just copy the AST both for read and
|
||||
// write, but doing so would double any side-effects, so as a safety measure all
|
||||
// statements which could have side-effects are banned at the moment.
|
||||
if (!nodep->rhsp()->isPure()) {
|
||||
nodep->rhsp()->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: Inc/Dec of expression with side-effects");
|
||||
return;
|
||||
}
|
||||
|
||||
AstConst* const constp = VN_AS(nodep->lhsp(), Const);
|
||||
UASSERT_OBJ(nodep, constp, "Expecting CONST");
|
||||
AstConst* const newconstp = constp->cloneTree(true);
|
||||
@@ -250,16 +240,6 @@ private:
|
||||
}
|
||||
void prepost_expr_visit(AstNodeTriop* nodep) {
|
||||
iterateChildren(nodep);
|
||||
|
||||
// Currently we can't reference the target, so we just copy the AST both for read and
|
||||
// write, but doing so would double any side-effects, so as a safety measure all
|
||||
// statements which could have side-effects are banned at the moment.
|
||||
if (!nodep->rhsp()->isPure()) {
|
||||
nodep->rhsp()->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: Inc/Dec of expression with side-effects");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_unsupportedHere) {
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Incrementation in this context.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user