Remove unnecessary AstNode::clearIter()

This commit is contained in:
Geza Lore 2022-07-13 12:20:30 +01:00
parent 178e1789b5
commit e0a38ce2c2
2 changed files with 1 additions and 6 deletions

View File

@ -1787,7 +1787,6 @@ public:
void deleteTree(); // Always deletes the next link
void checkTree(); // User Interface version
void checkIter() const;
void clearIter() { m_iterpp = nullptr; }
void dumpPtrs(std::ostream& os = std::cout) const;
void dumpTree(std::ostream& os = std::cout, const string& indent = " ",
int maxDepth = 0) const;

View File

@ -73,11 +73,7 @@ void V3LinkLevel::modSortByLevel() {
// Reorder the netlist's modules to have modules in level sorted order
stable_sort(mods.begin(), mods.end(), CmpLevel()); // Sort the vector
UINFO(9, "modSortByLevel() sorted\n"); // Comment required for gcc4.6.3 / bug666
for (AstNodeModule* nodep : mods) {
nodep->clearIter(); // Because we didn't iterate to find the node
// pointers, may have a stale m_iterp() needing cleanup
nodep->unlinkFrBack();
}
for (AstNodeModule* nodep : mods) nodep->unlinkFrBack();
UASSERT_OBJ(!v3Global.rootp()->modulesp(), v3Global.rootp(), "Unlink didn't work");
for (AstNodeModule* nodep : mods) v3Global.rootp()->addModulep(nodep);
UINFO(9, "modSortByLevel() done\n"); // Comment required for gcc4.6.3 / bug666