mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Internals: Optimize empty 'if' into StmtExpr
This commit is contained in:
+2
-1
@@ -1510,7 +1510,8 @@ class TaskVisitor final : public VNVisitor {
|
||||
VIsCached::clearCacheTree();
|
||||
} else { // VN_IS(nodep->backp(), StmtExpr)
|
||||
insertBeforeStmt(nodep, beginp);
|
||||
if (nodep->taskp()->isFunction()) {
|
||||
if (nodep->taskp()->isFunction()
|
||||
&& !nodep->backp()->fileline()->warnIsOff(V3ErrorCode::IGNOREDRETURN)) {
|
||||
nodep->v3warn(
|
||||
IGNOREDRETURN,
|
||||
"Ignoring return value of non-void function (IEEE 1800-2023 13.4.1)");
|
||||
|
||||
Reference in New Issue
Block a user