Rework Ast hashing to be stable (#2974)

Rework Ast hashing to be stable

Eliminated reliance on pointer values in AstNode hashes in order to make
them stable. This requires moving the sameHash functions into a visitor,
as nodes pointed to via members (and not child nodes) need to be hashed
themselves.

The hashes are now stable (as far as I could test them), and the impact
on verilation time is small enough not to be reliably measurable.
This commit is contained in:
Geza Lore
2021-05-21 14:34:27 +01:00
committed by GitHub
parent fd35492226
commit 8814111724
16 changed files with 559 additions and 268 deletions
+2 -2
View File
@@ -88,8 +88,8 @@ private:
iterateChildren(nodep);
V3Hash hash = V3Hasher::uncachedHash(m_cfilep);
m_hashValuep->addText(fl, cvtToStr(hash.fullValue()) + ";\n");
m_cHashValuep->addText(fl, cvtToStr(hash.fullValue()) + "U;\n");
m_hashValuep->addText(fl, cvtToStr(hash.value()) + ";\n");
m_cHashValuep->addText(fl, cvtToStr(hash.value()) + "U;\n");
m_foundTop = true;
}