Add static assertions for unnecessary VN_IS/VN_AS/VN_CAST

Fail at compile time if the result of these macros can be statically
determined (i.e.: they aways succeed or always fail). Remove unnecessary
casts discovered. No functional change.
This commit is contained in:
Geza Lore
2021-10-22 19:39:24 +01:00
parent 7cb6dc664e
commit 70603bb752
18 changed files with 83 additions and 59 deletions
+4 -4
View File
@@ -1262,11 +1262,11 @@ static bool domainsExclusive(const AstSenTree* fromp, const AstSenTree* top) {
const bool fromInitial = fromp->hasInitial() || fromp->hasSettle();
if (toInitial != fromInitial) return true;
const AstSenItem* fromSenListp = VN_AS(fromp->sensesp(), SenItem);
const AstSenItem* toSenListp = VN_AS(top->sensesp(), SenItem);
const AstSenItem* fromSenListp = fromp->sensesp();
const AstSenItem* toSenListp = top->sensesp();
UASSERT_OBJ(fromSenListp, fromp, "sensitivity list item is not an AstSenItem");
UASSERT_OBJ(toSenListp, top, "sensitivity list item is not an AstSenItem");
UASSERT_OBJ(fromSenListp, fromp, "sensitivity list empty");
UASSERT_OBJ(toSenListp, top, "sensitivity list empty");
if (fromSenListp->nextp()) return false;
if (toSenListp->nextp()) return false;