mirror of
https://github.com/verilator/verilator.git
synced 2026-10-08 02:53:12 +02:00
Add UNUSEDLOOP when unused loop is removed (#4926)
This commit is contained in:
@@ -3300,6 +3300,9 @@ class ConstVisitor final : public VNVisitor {
|
||||
if (nodep->precondsp()) {
|
||||
nodep->replaceWith(nodep->precondsp());
|
||||
} else {
|
||||
nodep->v3warn(UNUSEDLOOP,
|
||||
"Loop condition is always false; body will never execute");
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDLOOP, true);
|
||||
nodep->unlinkFrBack();
|
||||
}
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
|
||||
Reference in New Issue
Block a user