Skip to content

Commit

Permalink
Fix linking types of typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Nov 29, 2024
1 parent d7893a6 commit 9f8fcaf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/V3AstNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2598,9 +2598,14 @@ void AstClassOrPackageRef::dump(std::ostream& str) const {
void AstClassOrPackageRef::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
AstNodeModule* AstClassOrPackageRef::classOrPackagep() const {
AstNode* foundp = m_classOrPackageNodep;
if (auto* const anodep = VN_CAST(foundp, Typedef)) foundp = anodep->subDTypep();
if (auto* const anodep = VN_CAST(foundp, NodeDType)) foundp = anodep->skipRefp();
if (auto* const anodep = VN_CAST(foundp, ClassRefDType)) foundp = anodep->classp();
AstNode* lastp = nullptr;
while (foundp != lastp) {
lastp = foundp;
if (AstNodeDType* const anodep = VN_CAST(foundp, NodeDType)) foundp = anodep->skipRefp();
if (AstTypedef* const anodep = VN_CAST(foundp, Typedef)) foundp = anodep->subDTypep();
if (AstClassRefDType* const anodep = VN_CAST(foundp, ClassRefDType))
foundp = anodep->classp();
}
return VN_CAST(foundp, NodeModule);
}

Expand Down

0 comments on commit 9f8fcaf

Please sign in to comment.