mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 12:17:35 +00:00
Fix linking types of typedefs
This commit is contained in:
parent
d7893a60ca
commit
9f8fcaf827
@ -2598,9 +2598,14 @@ void AstClassOrPackageRef::dump(std::ostream& str) const {
|
|||||||
void AstClassOrPackageRef::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
|
void AstClassOrPackageRef::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
|
||||||
AstNodeModule* AstClassOrPackageRef::classOrPackagep() const {
|
AstNodeModule* AstClassOrPackageRef::classOrPackagep() const {
|
||||||
AstNode* foundp = m_classOrPackageNodep;
|
AstNode* foundp = m_classOrPackageNodep;
|
||||||
if (auto* const anodep = VN_CAST(foundp, Typedef)) foundp = anodep->subDTypep();
|
AstNode* lastp = nullptr;
|
||||||
if (auto* const anodep = VN_CAST(foundp, NodeDType)) foundp = anodep->skipRefp();
|
while (foundp != lastp) {
|
||||||
if (auto* const anodep = VN_CAST(foundp, ClassRefDType)) foundp = anodep->classp();
|
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);
|
return VN_CAST(foundp, NodeModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user