Fix class extends with typedef.

This commit is contained in:
Wilson Snyder 2020-10-16 18:25:32 -04:00
parent f4ed367850
commit 4849c0530b
3 changed files with 39 additions and 41 deletions

View File

@ -2674,8 +2674,6 @@ private:
// Until overridden by a SCOPE // Until overridden by a SCOPE
m_ds.m_dotSymp = m_curSymp = m_modSymp = m_statep->getNodeSym(nodep); m_ds.m_dotSymp = m_curSymp = m_modSymp = m_statep->getNodeSym(nodep);
m_modp = nodep; m_modp = nodep;
iterateChildren(nodep);
}
for (AstNode* itemp = nodep->extendsp(); itemp; itemp = itemp->nextp()) { for (AstNode* itemp = nodep->extendsp(); itemp; itemp = itemp->nextp()) {
if (AstClassExtends* cextp = VN_CAST(itemp, ClassExtends)) { if (AstClassExtends* cextp = VN_CAST(itemp, ClassExtends)) {
// Replace abstract reference with hard pointer // Replace abstract reference with hard pointer
@ -2690,11 +2688,15 @@ private:
bool ok = false; bool ok = false;
if (foundp) { if (foundp) {
if (AstClass* classp = VN_CAST(foundp->nodep(), Class)) { if (AstClass* classp = VN_CAST(foundp->nodep(), Class)) {
UINFO(8, "Import to " << nodep << " from export class " << classp
<< endl);
AstClassRefDType* newp AstClassRefDType* newp
= new AstClassRefDType{nodep->fileline(), classp}; = new AstClassRefDType{nodep->fileline(), classp};
cextp->childDTypep(newp); cextp->childDTypep(newp);
classp->isExtended(true); classp->isExtended(true);
nodep->isExtended(true); nodep->isExtended(true);
VSymEnt* srcp = m_statep->getNodeSym(classp);
m_curSymp->importFromClass(m_statep->symsp(), srcp);
VL_DO_DANGLING(cpackagerefp->unlinkFrBack()->deleteTree(), VL_DO_DANGLING(cpackagerefp->unlinkFrBack()->deleteTree(),
cpackagerefp); cpackagerefp);
ok = true; ok = true;
@ -2711,6 +2713,8 @@ private:
} }
} }
} }
iterateChildren(nodep);
}
// V3Width when determines types needs to find enum values and such // V3Width when determines types needs to find enum values and such
// so add members pointing to appropriate enum values // so add members pointing to appropriate enum values
{ {

View File

@ -1,4 +0,0 @@
%Error: t/t_class_extends.v:25:4: Can't find typedef: 'T'
25 | T imemberc;
| ^
%Error: Exiting due to

View File

@ -11,13 +11,11 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1); scenarios(simulator => 1);
compile( compile(
fails => $Self->{vlt_all},
expect_filename => $Self->{golden_filename},
); );
#execute( execute(
# check_finished => 1, check_finished => 1,
# ); );
ok(1); ok(1);
1; 1;