Internals: Fix marking AstVars as class members (#7070)

This commit is contained in:
Pawel Kojma
2026-02-13 07:45:13 -05:00
committed by GitHub
parent 3dd2b762e7
commit 64511d30b6
4 changed files with 15 additions and 4 deletions
+5 -1
View File
@@ -73,6 +73,11 @@ class LinkResolveVisitor final : public VNVisitor {
void visit(AstClass* nodep) override {
VL_RESTORER(m_classp);
m_classp = nodep;
for (AstNode* stmtp = nodep->stmtsp(); stmtp; stmtp = stmtp->nextp()) {
if (AstVar* const varp = VN_CAST(stmtp, Var)) {
if (!varp->isParam()) varp->varType(VVarType::MEMBER);
}
}
iterateChildren(nodep);
}
void visit(AstConstraint* nodep) override {
@@ -120,7 +125,6 @@ class LinkResolveVisitor final : public VNVisitor {
}
void visit(AstVar* nodep) override {
iterateChildren(nodep);
if (m_classp && !nodep->isParam()) nodep->varType(VVarType::MEMBER);
if (m_ftaskp) nodep->funcLocal(true);
if (nodep->isSigModPublic()) {
nodep->sigModPublic(false); // We're done with this attribute