From 09ebc0c1632e41c789dc20f96c4602f8de35e3e1 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 22 Jul 2012 22:48:39 -0400 Subject: [PATCH] Internals: Fix 0x tree debug suffix. Misc merges from struct. No functional change. --- src/V3AstNodes.cpp | 6 +++--- src/V3LinkDot.cpp | 8 ++++++-- src/V3SymTable.h | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index c673c95e8..cb04d822c 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -755,7 +755,7 @@ void AstVarScope::dump(ostream& str) { } void AstVarXRef::dump(ostream& str) { this->AstNode::dump(str); - if (packagep()) { str<<" pkg=0x"<<(void*)packagep(); } + if (packagep()) { str<<" pkg="<<(void*)packagep(); } if (lvalue()) str<<" [LV] => "; else str<<" [RV] <- "; str<AstNode::dump(str); - if (packagep()) { str<<" pkg=0x"<<(void*)packagep(); } + if (packagep()) { str<<" pkg="<<(void*)packagep(); } if (lvalue()) str<<" [LV] => "; else str<<" [RV] <- "; if (varScopep()) { varScopep()->dump(str); } @@ -815,7 +815,7 @@ void AstActive::dump(ostream& str) { } void AstNodeFTaskRef::dump(ostream& str) { this->AstNode::dump(str); - if (packagep()) { str<<" pkg=0x"<<(void*)packagep(); } + if (packagep()) { str<<" pkg="<<(void*)packagep(); } str<<" -> "; if (dotted()!="") { str<dump(str); } diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index bbc0e0b41..0e79994a1 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -374,7 +374,7 @@ public: } VSymEnt* findSymPrefixed(VSymEnt* lookupSymp, const string& dotname, string& baddot) { - // Find symbol in given point in hierarchy + // Find symbol in given point in hierarchy, allowing prefix (post-Inline) // For simplicity lookupSymp may be passed NULL result from findDotted if (!lookupSymp) return NULL; UINFO(8,"\t\tfindSymPrefixed "<insertSym(moduleSymp, newp->name(), newp, NULL/*packagep*/); } } + void taskFuncSwapCheck(AstNodeFTaskRef* nodep) { + if (nodep->taskp() && nodep->taskp()->castTask() + && nodep->castFuncRef()) nodep->v3error("Illegal call of a task as a function: "<prettyName()); + } // VISITs virtual void visit(AstNetlist* nodep, AstNUser* vup) { @@ -1251,7 +1255,7 @@ private: okSymp->cellErrorScopes(nodep); } } - if (taskp->castTask() && nodep->castFuncRef()) nodep->v3error("Illegal call of a task as a function: "<prettyName()); + taskFuncSwapCheck(nodep); } nodep->iterateChildren(*this); } diff --git a/src/V3SymTable.h b/src/V3SymTable.h index 67892b2d5..f86b02b56 100644 --- a/src/V3SymTable.h +++ b/src/V3SymTable.h @@ -152,7 +152,8 @@ public: } return any; } - void cellErrorScopes(AstNode* lookp) { + void cellErrorScopes(AstNode* lookp, string prettyName="") { + if (prettyName=="") prettyName = lookp->prettyName(); string scopes; for (IdNameMap::iterator it = m_idNameMap.begin(); it!=m_idNameMap.end(); ++it) { AstNode* nodep = it->second->nodep(); @@ -163,7 +164,7 @@ public: } } if (scopes=="") scopes=""; - cerr<prettyName()<<"': " + cerr<