Internals: Add UASSERT_OBJ macro to replace hand-done ifs. No functional change intended.

This makes it easier to filter out correctly zero code-coverage lines.
This commit is contained in:
Wilson Snyder
2019-07-06 12:57:50 -04:00
parent 7e54ff1b37
commit 8548ecfdac
66 changed files with 626 additions and 653 deletions
+3 -4
View File
@@ -161,9 +161,8 @@ class SliceVisitor : public AstNVisitor {
}
virtual void visit(AstInitArray* nodep) {
if (VL_UNCOVERABLE(m_assignp)) {
nodep->v3fatalSrc("Array initialization should have been removed earlier");
}
UASSERT_OBJ(!m_assignp, nodep,
"Array initialization should have been removed earlier");
}
void expandBiOp(AstNodeBiop* nodep) {
@@ -202,7 +201,7 @@ class SliceVisitor : public AstNVisitor {
}
}
}
if (!logp) nodep->v3fatalSrc("Unpacked array with empty indices range");
UASSERT_OBJ(logp, nodep, "Unpacked array with empty indices range");
nodep->replaceWith(logp);
pushDeletep(nodep); VL_DANGLING(nodep);
nodep = logp;