Internal: Misc cleanups. No functional change intended.

This commit is contained in:
Wilson Snyder 2020-12-06 13:49:44 -05:00
parent d5f88cbf78
commit 570631380b
7 changed files with 39 additions and 39 deletions

View File

@ -171,10 +171,9 @@ private:
}
virtual void visit(AstAssign* nodep) override {
if (m_check == CT_SEQ) {
AstNode* las = m_assignp;
VL_RESTORER(m_assignp);
m_assignp = nodep;
iterateAndNextNull(nodep->lhsp());
m_assignp = las;
}
}
virtual void visit(AstVarRef* nodep) override {

View File

@ -210,6 +210,7 @@ private:
// VISITORS - BOTH
virtual void visit(AstNodeModule* nodep) override {
AstNodeModule* origModp = m_modp;
VL_RESTORER(m_modp);
VL_RESTORER(m_state);
{
createHandle(nodep);
@ -223,7 +224,6 @@ private:
}
iterateChildren(nodep);
}
m_modp = origModp;
}
virtual void visit(AstNodeProcedure* nodep) override { iterateProcedure(nodep); }

View File

@ -114,11 +114,12 @@ private:
virtual void visit(AstNodeTermop* nodep) override {}
virtual void visit(AstNodeMath* nodep) override {
// We have some operator defines that use 2 parens, so += 2.
m_depth += 2;
if (m_depth > m_maxdepth) m_maxdepth = m_depth;
iterateChildren(nodep);
m_depth -= 2;
{
VL_RESTORER(m_depth);
m_depth += 2;
if (m_depth > m_maxdepth) m_maxdepth = m_depth;
iterateChildren(nodep);
}
if (m_stmtp && (v3Global.opt.compLimitParens() >= 1) // Else compiler doesn't need it
&& (m_maxdepth - m_depth) > v3Global.opt.compLimitParens()
&& !VN_IS(nodep->backp(), NodeStmt) // Not much point if we're about to use it

View File

@ -351,7 +351,7 @@ private:
if (!inputPin
&& !VN_IS(exprp, VarRef)
// V3Const will collapse the SEL with the one we're about to make
&& !VN_IS(exprp, Concat) && !VN_IS(exprp, Sel)) {
&& !VN_IS(exprp, Concat) && !VN_IS(exprp, Replicate) && !VN_IS(exprp, Sel)) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Per-bit array instantiations "
"with output connections to non-wires.");
// Note spec allows more complicated matches such as slices and such

View File

@ -96,10 +96,11 @@ private:
void visitIterateNodeDType(AstNodeDType* nodep) {
if (!nodep->user1SetOnce()) { // Process only once.
cleanFileline(nodep);
AstNodeDType* upperDtypep = m_dtypep;
m_dtypep = nodep;
iterateChildren(nodep);
m_dtypep = upperDtypep;
{
VL_RESTORER(m_dtypep);
m_dtypep = nodep;
iterateChildren(nodep);
}
}
}
@ -125,10 +126,11 @@ private:
if (!nodep->user1SetOnce()) { // Process only once.
cleanFileline(nodep);
UINFO(5, " " << nodep << endl);
AstNodeModule* upperValueModp = m_valueModp;
m_valueModp = nullptr;
iterateChildren(nodep);
m_valueModp = upperValueModp;
{
VL_RESTORER(m_valueModp);
m_valueModp = nullptr;
iterateChildren(nodep);
}
}
}
virtual void visit(AstNodeDType* nodep) override { visitIterateNodeDType(nodep); }
@ -510,17 +512,17 @@ private:
void visitIterateNoValueMod(AstNode* nodep) {
// Iterate a node which shouldn't have any local variables moved to an Initial
cleanFileline(nodep);
//
AstNodeModule* upperValueModp = m_valueModp;
m_valueModp = nullptr;
iterateChildren(nodep);
m_valueModp = upperValueModp;
{
VL_RESTORER(m_valueModp);
m_valueModp = nullptr;
iterateChildren(nodep);
}
}
virtual void visit(AstNodeProcedure* nodep) override { visitIterateNoValueMod(nodep); }
virtual void visit(AstAlways* nodep) override {
VL_RESTORER(m_inAlways);
m_inAlways = true;
visitIterateNoValueMod(nodep);
m_inAlways = false;
}
virtual void visit(AstCover* nodep) override { visitIterateNoValueMod(nodep); }
virtual void visit(AstRestrict* nodep) override { visitIterateNoValueMod(nodep); }

View File

@ -784,12 +784,10 @@ class ParamVisitor final : public AstNVisitor {
string fullName(m_modp->hierName());
if (const string* genHierNamep = (string*)cellp->user5p()) {
fullName += *genHierNamep;
}
visitCellDeparam(cellp, fullName);
if (const string* genHierNamep = (string*)cellp->user5p()) {
cellp->user5p(nullptr);
VL_DO_DANGLING(delete genHierNamep, genHierNamep);
}
VL_DO_DANGLING(visitCellDeparam(cellp, fullName), cellp);
}
}
}
@ -1050,10 +1048,9 @@ class ParamVisitor final : public AstNVisitor {
// Note this clears nodep->genforp(), so begin is no longer special
}
} else {
string rootHierName(m_generateHierName);
VL_RESTORER(m_generateHierName);
m_generateHierName += "." + nodep->prettyName();
iterateChildren(nodep);
m_generateHierName = rootHierName;
}
}
virtual void visit(AstGenFor* nodep) override { // LCOV_EXCL_LINE

View File

@ -206,18 +206,19 @@ private:
}
virtual void visit(AstNodeFTask* nodep) override {
UINFO(9, " TASK " << nodep << endl);
TaskBaseVertex* lastVxp = m_curVxp;
m_curVxp = getFTaskVertex(nodep);
if (nodep->dpiImport()) m_curVxp->noInline(true);
if (nodep->classMethod()) m_curVxp->noInline(true); // Until V3Task supports it
if (nodep->isConstructor()) {
m_curVxp->noInline(true);
m_ctorp = nodep;
UASSERT_OBJ(m_classp, nodep, "Ctor not under class");
m_funcToClassMap[nodep] = m_classp;
{
VL_RESTORER(m_curVxp);
m_curVxp = getFTaskVertex(nodep);
if (nodep->dpiImport()) m_curVxp->noInline(true);
if (nodep->classMethod()) m_curVxp->noInline(true); // Until V3Task supports it
if (nodep->isConstructor()) {
m_curVxp->noInline(true);
m_ctorp = nodep;
UASSERT_OBJ(m_classp, nodep, "Ctor not under class");
m_funcToClassMap[nodep] = m_classp;
}
iterateChildren(nodep);
}
iterateChildren(nodep);
m_curVxp = lastVxp;
}
virtual void visit(AstPragma* nodep) override {
if (nodep->pragType() == AstPragmaType::NO_INLINE_TASK) {