Internals: Fix cppcheck warnings; add VL_DANGLING. No functional change.

This commit is contained in:
Wilson Snyder
2015-10-04 13:16:35 -04:00
parent 5de83c9805
commit 4fc9a906f6
52 changed files with 410 additions and 413 deletions
+4 -4
View File
@@ -163,7 +163,7 @@ public:
}
void deleteAssign (AstNodeAssign* nodep) {
UINFO(5, "Delete "<<nodep<<endl);
nodep->unlinkFrBack()->deleteTree(); nodep=NULL;
nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep);
}
void deleteUnusedAssign() {
// If there are unused assignments in this var, kill them
@@ -310,7 +310,7 @@ private:
}
if (debug()>5) newp->dumpTree(cout," w_new: ");
nodep->replaceWith(newp);
pushDeletep(nodep); nodep=NULL;
pushDeletep(nodep); VL_DANGLING(nodep);
++m_statSubsts;
}
virtual void visit(AstWordSel* nodep, AstNUser*) {
@@ -329,7 +329,7 @@ private:
// Check that the RHS hasn't changed value since we recorded it.
SubstUseVisitor visitor (substp, entryp->getWordStep(word));
if (visitor.ok()) {
replaceSubstEtc(nodep, substp); nodep=NULL;
replaceSubstEtc(nodep, substp); VL_DANGLING(nodep);
} else {
entryp->consumeWord(word);
}
@@ -357,7 +357,7 @@ private:
SubstUseVisitor visitor (substp, entryp->getWholeStep());
if (visitor.ok()) {
UINFO(8," USEwhole "<<nodep<<endl);
replaceSubstEtc(nodep, substp); nodep=NULL;
replaceSubstEtc(nodep, substp); VL_DANGLING(nodep);
} else {
UINFO(8," USEwholeButChg "<<nodep<<endl);
entryp->consumeWhole();