Internals: Fix many but not all missing bool member dumps. No functional change.

This commit is contained in:
Wilson Snyder
2026-09-01 22:20:20 -04:00
parent a5f4f7eade
commit 80907b1e26
8 changed files with 251 additions and 24 deletions
+198 -9
View File
@@ -130,6 +130,7 @@ void AstNodeStmt::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
void AstNodeCCall::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (superReference()) str << " [SUPERREF]";
if (funcp()) {
str << " " << funcp()->name() << " => ";
funcp()->dump(str);
@@ -138,6 +139,7 @@ void AstNodeCCall::dump(std::ostream& str) const {
}
}
void AstNodeCCall::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, superReference);
if (funcp()) dumpJsonStr(str, "funcName", funcp()->name());
dumpJsonGen(str);
}
@@ -437,14 +439,19 @@ void AstCReset::dumpJson(std::ostream& str) const {
void AstCase::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " " << verilogKwd();
if (fullPragma()) str << " [FULL]";
if (parallelPragma()) str << " [PAR]";
if (priorityPragma()) str << " [PRI]";
if (uniquePragma()) str << " [UNQ]";
if (unique0Pragma()) str << " [UNQ0]";
}
void AstCase::dumpJson(std::ostream& str) const {
dumpJsonStr(str, "kwd", verilogKwd());
dumpJsonBoolIf(str, "full", fullPragma());
dumpJsonBoolIf(str, "parallel", parallelPragma());
dumpJsonBoolIf(str, "priority", priorityPragma());
dumpJsonBoolIf(str, "unique", uniquePragma());
dumpJsonBoolIf(str, "unique0", unique0Pragma());
dumpJsonBoolIf(str, "priority", priorityPragma());
dumpJsonGen(str);
}
@@ -2173,6 +2180,14 @@ void AstCExpr::dumpJson(std::ostream& str) const {
dumpJsonBoolIf(str, "pure", m_pure);
dumpJsonGen(str);
}
void AstCExprUser::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (m_pure) str << " [PURE]";
}
void AstCExprUser::dumpJson(std::ostream& str) const {
dumpJsonBoolIf(str, "pure", m_pure);
dumpJsonGen(str);
}
bool AstClass::isCacheableChild(const AstNode* nodep) {
return VN_IS(nodep, Var) || VN_IS(nodep, Typedef)
|| (VN_IS(nodep, Constraint) && !VN_AS(nodep, Constraint)->isExternProto())
@@ -2199,26 +2214,31 @@ void AstClass::dump(std::ostream& str) const {
if (isCovergroup()) str << " [CG]";
if (isExtended()) str << " [EXT]";
if (isInterfaceClass()) str << " [IFCCLS]";
if (isVirtual()) str << " [VIRT]";
if (useVirtualPublic()) str << " [VIRPUB]";
if (isPrintedFrom()) str << " [PRINTED]";
if (isVirtual()) str << " [VIRT]";
if (needRNG()) str << " [NRNG]";
if (useVirtualPublic()) str << " [VIRPUB]";
}
void AstClass::dumpJson(std::ostream& str) const {
// dumpJsonNumFunc(str, declTokenNum); // Not dumped as adding token changes whole file
dumpJsonBoolFuncIf(str, isCovergroup);
dumpJsonBoolFuncIf(str, isExtended);
dumpJsonBoolFuncIf(str, isInterfaceClass);
dumpJsonBoolFuncIf(str, isVirtual);
dumpJsonBoolFuncIf(str, isPrintedFrom);
dumpJsonBoolFuncIf(str, isVirtual);
dumpJsonBoolFuncIf(str, needRNG);
dumpJsonBoolFuncIf(str, useVirtualPublic);
if (baseOverride().isAny()) dumpJsonStr(str, "baseOverride", baseOverride().ascii());
dumpJsonGen(str);
}
void AstClassExtends::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (isImplements()) str << " [IMPLEMENTS]";
if (isImplements()) str << " [IMPL]";
if (parameterized()) str << " [PAR]";
}
void AstClassExtends::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isImplements);
dumpJsonBoolFuncIf(str, parameterized);
dumpJsonGen(str);
}
AstClass* AstClassExtends::classOrNullp() const {
@@ -2374,6 +2394,22 @@ void AstDisplay::dump(std::ostream& str) const {
str << " [" << displayType().ascii() << "]";
}
void AstDisplay::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
void AstDistItem::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (isWhole()) str << " [WHOLE]";
}
void AstDistItem::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isWhole);
dumpJsonGen(str);
}
void AstDumpCtl::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
str << " [" << ctlType().ascii() << "]";
}
void AstDumpCtl::dumpJson(std::ostream& str) const {
dumpJsonStr(str, "ctlType", ctlType().ascii());
dumpJsonGen(str);
}
void AstEnumDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
str << " enum";
@@ -2435,6 +2471,29 @@ void AstGenBlock::dumpJson(std::ostream& str) const {
dumpJsonGen(str);
}
void AstNodeIf::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (isBoundsCheck()) str << " [BOUNDS]";
}
void AstNodeIf::dumpJson(std::ostream& str) const {
dumpJsonBoolIf(str, "isBoundsCheck", isBoundsCheck());
dumpJsonGen(str);
}
void AstIf::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " " << verilogKwd();
if (priorityPragma()) str << " [PRI]";
if (uniquePragma()) str << " [UNQ]";
if (unique0Pragma()) str << " [UNQ0]";
}
void AstIf::dumpJson(std::ostream& str) const {
dumpJsonStr(str, "kwd", verilogKwd());
dumpJsonBoolIf(str, "priority", priorityPragma());
dumpJsonBoolIf(str, "unique", uniquePragma());
dumpJsonBoolIf(str, "unique0", unique0Pragma());
dumpJsonGen(str);
}
void AstIfaceRefDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (isPortDecl()) str << " [PORTDECL]";
@@ -2572,7 +2631,7 @@ const char* AstLoopTest::broken() const {
void AstMemberDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (isConstrainedRand()) str << " [CONSTRAINEDRAND]";
if (isConstrainedRand()) str << " [CSRAND]";
if (rand().isRandomizable()) str << " [" << rand() << "]";
if (name() != "") str << " name=" << name();
if (tag() != "") str << " tag=" << tag();
@@ -2673,6 +2732,14 @@ void AstModule::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, hasGenericIface);
dumpJsonGen(str);
}
void AstMonitorOff::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (off()) str << " [OFF]";
}
void AstMonitorOff::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, off);
dumpJsonGen(str);
}
void AstPin::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (modVarp()) {
@@ -2719,7 +2786,14 @@ void AstPrintTimeScale::dumpJson(std::ostream& str) const {
dumpJsonStr(str, "timeunit", timeunit().ascii());
dumpJsonGen(str);
}
void AstPull::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (direction()) str << " [UP]";
}
void AstPull::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, direction);
dumpJsonGen(str);
}
void AstTime::dump(std::ostream& str) const {
this->AstNodeTermop::dump(str);
str << " " << timeunit();
@@ -2744,6 +2818,16 @@ void AstTimeImport::dumpJson(std::ostream& str) const {
dumpJsonStr(str, "timeunit", timeunit().ascii());
dumpJsonGen(str);
}
void AstTracePushPrefix::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (m_quotedPrefix) str << " [QUOTE]";
str << " [" << prefixType().ascii() << "]";
}
void AstTracePushPrefix::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, quotedPrefix);
dumpJsonStr(str, "prefixType", prefixType().ascii());
dumpJsonGen(str);
}
void AstTypedef::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (attrPublic()) str << " [PUBLIC]";
@@ -2769,6 +2853,14 @@ void AstTypedefFwd::dumpJson(std::ostream& str) const {
}
void AstNodeRange::dump(std::ostream& str) const { this->AstNode::dump(str); }
void AstNodeRange::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
void AstRand::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (urandom()) str << " [U]";
}
void AstRand::dumpJson(std::ostream& str) const {
dumpJsonBoolIf(str, "urandom", urandom());
dumpJsonGen(str);
}
void AstRandSequence::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " start=" << start();
@@ -2795,6 +2887,14 @@ void AstRange::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, fromBracket);
dumpJsonGen(str);
}
void AstNodeReadWriteMem::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (isHex()) str << " [HEX]";
}
void AstNodeReadWriteMem::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isHex);
dumpJsonGen(str);
}
void AstParamTypeDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (subDTypep()) {
@@ -2841,15 +2941,25 @@ void AstNodeUOrStructDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (packed()) str << " [PACKED]";
if (isFourstate()) str << " [4STATE]";
if (classOrPackagep()) str << " pkg=" << nodeAddr(classOrPackagep());
if (isConstrainedRand()) str << " [CSRAND]";
if (emitToString()) str << " [EMITSTR]";
if (classOrPackagep()) str << " pkg=" << nodeAddr(classOrPackagep());
}
void AstNodeUOrStructDType::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, packed);
dumpJsonBoolFuncIf(str, isConstrainedRand);
dumpJsonBoolFuncIf(str, isFourstate);
dumpJsonBoolFuncIf(str, emitToString);
dumpJsonGen(str);
}
void AstUdpTableLine::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (udpIsCombo()) str << " [COMBO]";
}
void AstUdpTableLine::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, udpIsCombo);
dumpJsonGen(str);
}
void AstUnionDType::dump(std::ostream& str) const {
this->AstNodeUOrStructDType::dump(str);
if (isSoft()) str << " [soft]";
@@ -2961,11 +3071,21 @@ std::vector<AstUnpackArrayDType*> AstUnpackArrayDType::unpackDimensions() {
}
return dims;
}
void AstNBACommitQueueDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (partial()) str << " [PARTIAL]";
}
void AstNBACommitQueueDType::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, partial);
dumpJsonGen(str);
}
void AstNetlist::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (timescaleSpecified()) str << " [TIMESCALES]";
str << " [" << timeunit() << "/" << timeprecision() << "]";
}
void AstNetlist::dumpJson(std::ostream& str) const {
dumpJsonBoolIf(str, "timescaleSpecified", timescaleSpecified());
dumpJsonStr(str, "timeunit", timeunit().ascii());
dumpJsonStr(str, "timeprecision", timeprecision().ascii());
dumpJsonGen(str);
@@ -3071,6 +3191,16 @@ void AstNodeModule::dumpJson(std::ostream& str) const {
if (libname() != "work") dumpJsonStr(str, "libname=", libname());
dumpJsonGen(str);
}
void AstPExprClause::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (pass()) str << " [PASS]";
if (vacuous()) str << " [VACUOUS]";
}
void AstPExprClause::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, pass);
dumpJsonBoolFuncIf(str, vacuous);
dumpJsonGen(str);
}
void AstPackageExport::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (packagep()) {
@@ -3134,11 +3264,13 @@ VFormatAttr AstSFormatArg::formatAttrDefauled(const AstSFormatArg* nodep,
void AstSFormatF::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (exprFormat()) str << " [EXPRFMT]";
if (hidden()) str << " [HID]";
if (optionalFormat()) str << " [OPTFMT]";
}
void AstSFormatF::dumpJson(std::ostream& str) const {
dumpJsonGen(str);
dumpJsonBoolFuncIf(str, exprFormat);
dumpJsonBoolFuncIf(str, hidden);
dumpJsonBoolFuncIf(str, optionalFormat);
}
void AstSampled::dump(std::ostream& str) const {
@@ -3239,6 +3371,15 @@ bool AstWildcardArrayDType::similarDTypeNode(const AstNodeDType* samep) const {
const AstWildcardArrayDType* const asamep = VN_DBG_AS(samep, WildcardArrayDType);
return asamep->subDTypep() && subDTypep()->similarDType(asamep->subDTypep());
}
void AstUnpackArrayDType::dump(std::ostream& str) const {
this->AstNodeDType::dump(str);
if (isCompound()) str << " [COMPOUND]";
str << " " << declRange();
}
void AstUnpackArrayDType::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isCompound);
dumpJsonGen(str);
}
bool AstUnpackArrayDType::similarDTypeNode(const AstNodeDType* samep) const {
const AstUnpackArrayDType* const asamep = VN_DBG_AS(samep, UnpackArrayDType);
return hi() == asamep->hi() && rangep()->sameTree(asamep->rangep())
@@ -3561,6 +3702,7 @@ void AstNodeFTaskRef::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (classOrPackagep()) str << " pkg=" << nodeAddr(classOrPackagep());
if (containsGenBlock()) str << " [GENBLK]";
if (pli()) str << " [PLI]";
if (superReference()) str << " [SUPERREF]";
str << " -> ";
if (dotted() != "") str << ".=" << dotted() << " ";
@@ -3573,6 +3715,7 @@ void AstNodeFTaskRef::dump(std::ostream& str) const {
void AstNodeFTaskRef::dumpJson(std::ostream& str) const {
dumpJsonStrFunc(str, dotted);
dumpJsonBoolFuncIf(str, containsGenBlock);
dumpJsonBoolFuncIf(str, pli);
dumpJsonBoolFuncIf(str, superReference);
dumpJsonGen(str);
}
@@ -3660,6 +3803,22 @@ void AstBegin::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, needProcess);
dumpJsonGen(str);
}
void AstComment::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (showAt()) str << " [SHOWAT]";
}
void AstComment::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, showAt);
dumpJsonGen(str);
}
void AstCompareNN::dump(std::ostream& str) const {
this->AstNodeExpr::dump(str);
if (ignoreCase()) str << " [IGNORECASE]";
}
void AstCompareNN::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, ignoreCase);
dumpJsonGen(str);
}
void AstNodeCoverDecl::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (!page().empty()) str << " page=" << page();
@@ -3719,6 +3878,14 @@ void AstCoverInc::dump(std::ostream& str) const {
}
}
void AstCoverInc::dumpJson(std::ostream& str) const { dumpJsonGen(str); }
void AstFireEvent::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (isDelayed()) str << " [DLY]";
}
void AstFireEvent::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isDelayed);
dumpJsonGen(str);
}
void AstFork::dump(std::ostream& str) const {
this->AstNodeBlock::dump(str);
str << " [" << joinType() << "]";
@@ -3729,6 +3896,14 @@ void AstFork::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, immediateStart);
dumpJsonGen(str);
}
void AstSequence::dump(std::ostream& str) const {
this->AstNodeFTask::dump(str);
if (isReferenced()) str << " [REFED]";
}
void AstSequence::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isReferenced);
dumpJsonGen(str);
}
void AstStop::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (isFatal()) str << " [FATAL]";
@@ -3739,10 +3914,12 @@ void AstStop::dumpJson(std::ostream& str) const {
}
void AstTraceDecl::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (inDtypeFunc()) str << " [DT]";
if (codeAssigned()) str << " [code=" << code() << "]";
if (dtypeCallp()) str << " [dtypeCallp=" << dtypeCallp() << "]";
}
void AstTraceDecl::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, inDtypeFunc);
dumpJsonNumFunc(str, code);
dumpJsonGen(str);
}
@@ -3809,6 +3986,7 @@ void AstCFunc::dump(std::ostream& str) const {
if (needProcess()) str << " [NPRC]";
if (entryPoint()) str << " [ENTRY]";
if (noLife()) str << " [NOLIFE]";
if (!cname().empty() && cname() != name()) str << " [c=" << cname() << "]";
}
void AstCFunc::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, slow);
@@ -3824,6 +4002,7 @@ void AstCFunc::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, isCoroutine);
dumpJsonBoolFuncIf(str, needProcess);
dumpJsonBoolFuncIf(str, noLife);
dumpJsonStrFunc(str, cname);
dumpJsonGen(str);
// TODO: maybe try to shorten these flags somehow
}
@@ -3870,6 +4049,14 @@ void AstCStmt::dumpJson(std::ostream& str) const {
dumpJsonGen(str);
if (!stmtType().isNone()) dumpJsonStr(str, "stmtType", stmtType().ascii());
}
void AstCStmtUser::dump(std::ostream& str) const {
this->AstNodeStmt::dump(str);
if (!fromDollarC()) str << " [$C]";
}
void AstCStmtUser::dumpJson(std::ostream& str) const {
dumpJsonBoolFuncIf(str, fromDollarC);
dumpJsonGen(str);
}
void AstCUse::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " [" << useType() << "]";
@@ -3987,12 +4174,14 @@ void AstCoverBin::dump(std::ostream& str) const {
this->AstNode::dump(str);
str << " " << m_binsType.ascii();
if (m_isArray) str << "[]";
if (m_isWildcard) str << "[*]";
}
void AstCoverBin::dumpJson(std::ostream& str) const {
this->AstNode::dumpJson(str);
dumpJsonBoolIf(str, "isArray", isArray());
dumpJsonBoolIf(str, "isWildcard", isWildcard());
str << ", \"binsType\": \"" << binsType().ascii() << "\"";
if (m_isArray) str << ", \"isArray\": true";
}
void AstCoverTransItem::dump(std::ostream& str) const {