mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user