diff --git a/src/V3Assert.cpp b/src/V3Assert.cpp index 8607c05fa..15969106a 100644 --- a/src/V3Assert.cpp +++ b/src/V3Assert.cpp @@ -54,11 +54,11 @@ private: string assertDisplayMessage(AstNode* nodep, const string& prefix, const string& message, VDisplayType severity) { if (severity == VDisplayType::DT_ERROR || severity == VDisplayType::DT_FATAL) { - return (string("[%0t] " + prefix + ": ") + nodep->fileline()->filebasename() + ":" + return (string{"[%0t] " + prefix + ": "} + nodep->fileline()->filebasename() + ":" + cvtToStr(nodep->fileline()->lineno()) + ": Assertion failed in %m" + ((message != "") ? ": " : "") + message + "\n"); } else { - return (string("[%0t] " + prefix + ": ") + nodep->fileline()->filebasename() + ":" + return (string{"[%0t] " + prefix + ": "} + nodep->fileline()->filebasename() + ":" + cvtToStr(nodep->fileline()->lineno()) + ": %m" + ((message != "") ? ": " : "") + message + "\n"); } diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index 8221ee0ab..51a12ad14 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -229,7 +229,7 @@ private: // always queue.push(); AstCMethodHard* const pushp = new AstCMethodHard{ flp, new AstVarRef{flp, queueVarp, VAccess::WRITE}, "push", - new AstTime(nodep->fileline(), m_modp->timeunit())}; + new AstTime{nodep->fileline(), m_modp->timeunit()}}; pushp->addPinsp(exprp->cloneTree(false)); pushp->dtypeSetVoid(); m_clockingp->addNextHere( @@ -238,7 +238,7 @@ private: // always @ queue.pop(, /*out*/}); AstCMethodHard* const popp = new AstCMethodHard{ flp, new AstVarRef{flp, queueVarp, VAccess::READWRITE}, "pop", - new AstTime(nodep->fileline(), m_modp->timeunit())}; + new AstTime{nodep->fileline(), m_modp->timeunit()}}; popp->addPinsp(skewp->unlinkFrBack()); popp->addPinsp(refp); popp->dtypeSetVoid(); diff --git a/src/V3AstNodeOther.h b/src/V3AstNodeOther.h index a9b1ecb10..e923385d3 100644 --- a/src/V3AstNodeOther.h +++ b/src/V3AstNodeOther.h @@ -952,7 +952,7 @@ public: BROKEN_RTN(!fmtp()); return nullptr; } - string verilogKwd() const override { return (string("$") + string(displayType().ascii())); } + string verilogKwd() const override { return string{"$"} + string{displayType().ascii()}; } bool isGateOptimizable() const override { return false; } bool isPredictOptimizable() const override { return false; } bool isPure() const override { return false; } // SPECIAL: $display has 'visual' ordering @@ -1360,7 +1360,7 @@ public: void name(const string& name) override { m_name = name; } void dump(std::ostream& str) const override; string nameDotless() const; - string nameVlSym() const { return ((string("vlSymsp->")) + nameDotless()); } + string nameVlSym() const { return string{"vlSymsp->"} + nameDotless(); } AstNodeModule* modp() const { return m_modp; } // AstScope* aboveScopep() const VL_MT_SAFE { return m_aboveScopep; } @@ -2640,8 +2640,8 @@ public: return nullptr; } string verilogKwd() const override { - return (filep() ? string("$f") + string(displayType().ascii()) - : string("$") + string(displayType().ascii())); + return (filep() ? string{"$f"} + string{displayType().ascii()} + : string{"$"} + string{displayType().ascii()}); } bool isGateOptimizable() const override { return false; } bool isPredictOptimizable() const override { return false; } diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index fd7d78fc5..9b84b5c4b 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -574,7 +574,7 @@ string AstVar::dpiArgType(bool named, bool forReturn) const { } else { class converter final : public dpiTypesToStringConverter { string bitLogicVector(const AstVar* varp, bool isBit) const override { - return string(varp->isReadOnly() ? "const " : "") + return string{varp->isReadOnly() ? "const " : ""} + dpiTypesToStringConverter::bitLogicVector(varp, isBit) + '*'; } string primitive(const AstVar* varp) const override { @@ -637,13 +637,13 @@ string AstVar::dpiTmpVarType(const string& varName) const { string AstVar::scType() const { if (isScBigUint()) { - return (string("sc_biguint<") + cvtToStr(widthMin()) + return (string{"sc_biguint<"} + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >> } else if (isScUint()) { - return (string("sc_uint<") + cvtToStr(widthMin()) + return (string{"sc_uint<"} + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >> } else if (isScBv()) { - return (string("sc_bv<") + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >> + return (string{"sc_bv<"} + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >> } else if (widthMin() == 1) { return "bool"; } else if (widthMin() <= VL_IDATASIZE) { diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index c2a06df4b..b7707754d 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -299,7 +299,7 @@ private: // To keep correct visual order, must add before other Text's AstText* const afterp = nodep->scopeAttrp(); if (afterp) afterp->unlinkFrBackWithNext(); - nodep->addScopeAttrp(new AstText{nodep->fileline(), string("__DOT__") + scname}); + nodep->addScopeAttrp(new AstText{nodep->fileline(), string{"__DOT__"} + scname}); if (afterp) nodep->addScopeAttrp(afterp); } iterateChildren(nodep); diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index 1a7be8041..bf374d2a3 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -95,7 +95,7 @@ private: if (vscp->user1p()) return VN_AS(vscp->user1p(), VarScope); const AstVar* const varp = vscp->varp(); const string newvarname - = string("__Vsampled__") + vscp->scopep()->nameDotless() + "__" + varp->name(); + = string{"__Vsampled__"} + vscp->scopep()->nameDotless() + "__" + varp->name(); FileLine* const flp = vscp->fileline(); AstVar* const newvarp = new AstVar{flp, VVarType::MODULETEMP, newvarname, varp->dtypep()}; newvarp->noReset(true); // Reset by below assign diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index d249b2637..1a491422d 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -262,8 +262,8 @@ private: if (VN_IS(dimp, Const)) { // bit = const, can just use it dimreadps.push_front(dimp); } else { - const string bitvarname = (string("__Vdlyvdim") + cvtToStr(dimension) + "__" - + oldvarp->shortName() + "__v" + cvtToStr(modVecNum)); + const string bitvarname = string{"__Vdlyvdim"} + cvtToStr(dimension) + "__" + + oldvarp->shortName() + "__v" + cvtToStr(modVecNum); AstVarScope* const bitvscp = createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), nullptr); AstAssign* const bitassignp = new AstAssign{ @@ -282,8 +282,8 @@ private: // vlsb = constant, can just push constant into where we use it bitreadp = lsbvaluep; } else { - const string bitvarname = (string("__Vdlyvlsb__") + oldvarp->shortName() + "__v" - + cvtToStr(modVecNum)); + const string bitvarname + = string{"__Vdlyvlsb__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum); AstVarScope* const bitvscp = createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), nullptr); AstAssign* const bitassignp = new AstAssign{ @@ -301,7 +301,7 @@ private: valreadp = nodep->rhsp()->unlinkFrBack(); } else { const string valvarname - = (string("__Vdlyvval__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum)); + = string{"__Vdlyvval__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum); AstVarScope* const valvscp = createVarSc(varrefp->varScopep(), valvarname, 0, nodep->rhsp()->dtypep()); newlhsp = new AstVarRef{nodep->fileline(), valvscp, VAccess::WRITE}; @@ -321,7 +321,7 @@ private: ++m_statSharedSet; } else { // Create new one const string setvarname - = (string("__Vdlyvset__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum)); + = string{"__Vdlyvset__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum); setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, nullptr); if (!m_inSuspendableOrFork) { // Suspendables reset __Vdlyvset__ in the AstAlwaysPost @@ -483,7 +483,7 @@ private: if (nodep->isDelayed()) { AstVarRef* const vrefp = VN_AS(nodep->operandp(), VarRef); vrefp->unlinkFrBack(); - const string newvarname = (string("__Vdly__") + vrefp->varp()->shortName()); + const string newvarname = string{"__Vdly__"} + vrefp->varp()->shortName(); AstVarScope* const dlyvscp = createVarSc(vrefp->varScopep(), newvarname, 1, nullptr); const auto dlyRef = [=](VAccess access) { @@ -572,7 +572,7 @@ private: checkActivePost(nodep, oldactivep); } if (!dlyvscp) { // First use of this delayed variable - const string newvarname = (string("__Vdly__") + nodep->varp()->shortName()); + const string newvarname = string{"__Vdly__"} + nodep->varp()->shortName(); dlyvscp = createVarSc(oldvscp, newvarname, 0, nullptr); AstNodeAssign* const prep = new AstAssignPre{ nodep->fileline(), diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index fded54459..3c1eeb518 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -166,7 +166,7 @@ private: new AstEq{ funcp->fileline(), new AstCExpr{funcp->fileline(), "this", 64}, new AstCExpr{funcp->fileline(), - string("&(") + funcp->scopep()->nameVlSym() + ")", + string{"&("} + funcp->scopep()->nameVlSym() + ")", 64}}, returnp}; newfuncp->addStmtsp(ifp); @@ -178,7 +178,7 @@ private: // to come up with some return value // newfuncp->addStmtsp(new AstDisplay(newfuncp->fileline(), // VDisplayType::DT_WARNING, - // string("%%Error: ")+name+"() called with bad + // string{"%%Error: "}+name+"() called with bad // scope", nullptr)); // newfuncp->addStmtsp(new AstStop(newfuncp->fileline())); if (debug() >= 9) newfuncp->dumpTree("- newfunc: "); diff --git a/src/V3EmitCFunc.cpp b/src/V3EmitCFunc.cpp index 498c46f1e..9160e5068 100644 --- a/src/V3EmitCFunc.cpp +++ b/src/V3EmitCFunc.cpp @@ -275,9 +275,9 @@ void EmitCFunc::displayArg(AstNode* dispp, AstNode** elistp, bool isScan, const double dchars = mantissabits / 3.321928094887362 + 1.0; if (fmtLetter == 'd') dchars++; // space for sign const int nchars = int(dchars); - pfmt = string("%") + cvtToStr(nchars) + fmtLetter; + pfmt = string{"%"} + cvtToStr(nchars) + fmtLetter; } else { - pfmt = string("%") + vfmt + fmtLetter; + pfmt = string{"%"} + vfmt + fmtLetter; } m_emitDispState.pushFormat(pfmt); if (!ignore) { @@ -672,7 +672,7 @@ string EmitCFunc::emitVarResetRecurse(const AstVar* varp, const string& varNameP } else if (const AstUnpackArrayDType* const adtypep = VN_CAST(dtypep, UnpackArrayDType)) { UASSERT_OBJ(adtypep->hi() >= adtypep->lo(), varp, "Should have swapped msb & lsb earlier."); - const string ivar = string("__Vi") + cvtToStr(depth); + const string ivar = string{"__Vi"} + cvtToStr(depth); const string pre = ("for (int " + ivar + " = " + cvtToStr(0) + "; " + ivar + " < " + cvtToStr(adtypep->elementsConst()) + "; ++" + ivar + ") {\n"); const string below = emitVarResetRecurse(varp, varNameProtected, adtypep->subDTypep(), diff --git a/src/V3EmitCFunc.h b/src/V3EmitCFunc.h index 83997f570..1149c728f 100644 --- a/src/V3EmitCFunc.h +++ b/src/V3EmitCFunc.h @@ -492,7 +492,7 @@ public: if (!v3Global.opt.protectIds()) return; } if (!(nodep->protect() && v3Global.opt.protectIds())) { - putsDecoration(string("// ") + nodep->name() + at + "\n"); + putsDecoration(string{"// "} + nodep->name() + at + "\n"); } iterateChildrenConst(nodep); } @@ -1310,7 +1310,7 @@ public: // Default void visit(AstNode* nodep) override { - puts(string("\n???? // ") + nodep->prettyTypeName() + "\n"); + puts(string{"\n???? // "} + nodep->prettyTypeName() + "\n"); iterateChildrenConst(nodep); // LCOV_EXCL_START if (!v3Global.opt.lintOnly()) { // An internal problem, so suppress diff --git a/src/V3EmitCImp.cpp b/src/V3EmitCImp.cpp index d231d7058..ead32fb03 100644 --- a/src/V3EmitCImp.cpp +++ b/src/V3EmitCImp.cpp @@ -401,7 +401,7 @@ class EmitCImp final : EmitCFunc { const int vecnum = vects++; UASSERT_OBJ(arrayp->hi() >= arrayp->lo(), varp, "Should have swapped msb & lsb earlier."); - const string ivar = string("__Vi") + cvtToStr(vecnum); + const string ivar = string{"__Vi"} + cvtToStr(vecnum); puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0)); puts("; " + ivar + " < " + cvtToStr(arrayp->elementsConst())); puts("; ++" + ivar + ") {\n"); @@ -415,7 +415,7 @@ class EmitCImp final : EmitCFunc { if (elementp->isWide() && !(basicp && basicp->keyword() == VBasicDTypeKwd::STRING)) { const int vecnum = vects++; - const string ivar = string("__Vi") + cvtToStr(vecnum); + const string ivar = string{"__Vi"} + cvtToStr(vecnum); puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0)); puts("; " + ivar + " < " + cvtToStr(elementp->widthWords())); puts("; ++" + ivar + ") {\n"); diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index d9d865324..a1b64ea7f 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -516,7 +516,7 @@ void EmitCSyms::emitSymHdr() { puts("\n// CONSTRUCTORS\n"); puts(symClassName() + "(VerilatedContext* contextp, const char* namep, " + topClassName() + "* modelp);\n"); - puts(string("~") + symClassName() + "();\n"); + puts(string{"~"} + symClassName() + "();\n"); for (const auto& i : m_usesVfinal) { puts("void " + symClassName() + "_" + cvtToStr(i.first) + "("); diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index 86f325c2f..02696c342 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -156,9 +156,9 @@ public: of.puts("# Path to Verilator kit (from $VERILATOR_ROOT)\n"); of.puts("VERILATOR_ROOT = " + V3Options::getenvVERILATOR_ROOT() + "\n"); of.puts("# SystemC include directory with systemc.h (from $SYSTEMC_INCLUDE)\n"); - of.puts(string("SYSTEMC_INCLUDE ?= ") + V3Options::getenvSYSTEMC_INCLUDE() + "\n"); + of.puts(string{"SYSTEMC_INCLUDE ?= "} + V3Options::getenvSYSTEMC_INCLUDE() + "\n"); of.puts("# SystemC library directory with libsystemc.a (from $SYSTEMC_LIBDIR)\n"); - of.puts(string("SYSTEMC_LIBDIR ?= ") + V3Options::getenvSYSTEMC_LIBDIR() + "\n"); + of.puts(string{"SYSTEMC_LIBDIR ?= "} + V3Options::getenvSYSTEMC_LIBDIR() + "\n"); // Only check it if we really need the value if (v3Global.opt.systemC() && !V3Options::systemCFound()) { @@ -169,22 +169,22 @@ public: of.puts("\n### Switches...\n"); of.puts("# C++ code coverage 0/1 (from --prof-c)\n"); - of.puts(string("VM_PROFC = ") + ((v3Global.opt.profC()) ? "1" : "0") + "\n"); + of.puts(string{"VM_PROFC = "} + ((v3Global.opt.profC()) ? "1" : "0") + "\n"); of.puts("# SystemC output mode? 0/1 (from --sc)\n"); - of.puts(string("VM_SC = ") + ((v3Global.opt.systemC()) ? "1" : "0") + "\n"); + of.puts(string{"VM_SC = "} + ((v3Global.opt.systemC()) ? "1" : "0") + "\n"); of.puts("# Legacy or SystemC output mode? 0/1 (from --sc)\n"); - of.puts(string("VM_SP_OR_SC = $(VM_SC)\n")); + of.puts(string{"VM_SP_OR_SC = $(VM_SC)\n"}); of.puts("# Deprecated\n"); - of.puts(string("VM_PCLI = ") + (v3Global.opt.systemC() ? "0" : "1") + "\n"); + of.puts(string{"VM_PCLI = "} + (v3Global.opt.systemC() ? "0" : "1") + "\n"); of.puts( "# Deprecated: SystemC architecture to find link library path (from $SYSTEMC_ARCH)\n"); - of.puts(string("VM_SC_TARGET_ARCH = ") + V3Options::getenvSYSTEMC_ARCH() + "\n"); + of.puts(string{"VM_SC_TARGET_ARCH = "} + V3Options::getenvSYSTEMC_ARCH() + "\n"); of.puts("\n### Vars...\n"); of.puts("# Design prefix (from --prefix)\n"); - of.puts(string("VM_PREFIX = ") + v3Global.opt.prefix() + "\n"); + of.puts(string{"VM_PREFIX = "} + v3Global.opt.prefix() + "\n"); of.puts("# Module prefix (from --prefix)\n"); - of.puts(string("VM_MODPREFIX = ") + v3Global.opt.modPrefix() + "\n"); + of.puts(string{"VM_MODPREFIX = "} + v3Global.opt.modPrefix() + "\n"); of.puts("# User CFLAGS (from -CFLAGS on Verilator command line)\n"); of.puts("VM_USER_CFLAGS = \\\n"); diff --git a/src/V3Error.cpp b/src/V3Error.cpp index 9eaaf9b0d..6fc051edc 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -257,7 +257,7 @@ void V3Error::init() { describedEachWarn(static_cast(i), false); pretendError(static_cast(i), V3ErrorCode{i}.pretendError()); } - if (VL_UNCOVERABLE(string(V3ErrorCode{V3ErrorCode::_ENUM_MAX}.ascii()) != " MAX")) { + if (VL_UNCOVERABLE(string{V3ErrorCode{V3ErrorCode::_ENUM_MAX}.ascii()} != " MAX")) { v3fatalSrc("Enum table in V3ErrorCode::EC_ascii() is munged"); } } diff --git a/src/V3Global.cpp b/src/V3Global.cpp index 81f24ade4..a9300eaf3 100644 --- a/src/V3Global.cpp +++ b/src/V3Global.cpp @@ -52,7 +52,7 @@ void V3Global::readFiles() { VInFilter filter{v3Global.opt.pipeFilter()}; V3ParseSym parseSyms{v3Global.rootp()}; // Symbol table must be common across all parsing - V3Parse parser(v3Global.rootp(), &filter, &parseSyms); + V3Parse parser{v3Global.rootp(), &filter, &parseSyms}; // Parse the std package if (v3Global.opt.std()) { diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 74fe5d504..061e5caeb 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -555,7 +555,7 @@ public: V3Inst::checkOutputShort(pinp); AstNodeExpr* const pinexprp = VN_AS(pinp->exprp(), NodeExpr)->unlinkFrBack(); const string newvarname - = (string(pinVarp->isWritable() ? "__Vcellout" : "__Vcellinp") + = (string{pinVarp->isWritable() ? "__Vcellout" : "__Vcellinp"} // Prevent name conflict if both tri & non-tri add signals + (forTristate ? "t" : "") + "__" + cellp->name() + "__" + pinp->name()); AstVar* const newvarp diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 4a2bb0c1c..ac89c57ee 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -253,7 +253,7 @@ private: // Prepare a temporary variable FileLine* const fl = backp->fileline(); - const string name = string("__Vincrement") + cvtToStr(++m_modIncrementsNum); + const string name = string{"__Vincrement"} + cvtToStr(++m_modIncrementsNum); AstVar* const varp = new AstVar{fl, VVarType::BLOCKTEMP, name, VFlagChildDType{}, varrefp->varp()->subDTypep()->cloneTree(true)}; if (m_ftaskp) varp->funcLocal(true); diff --git a/src/V3LinkJump.cpp b/src/V3LinkJump.cpp index deba207eb..7ac37ade3 100644 --- a/src/V3LinkJump.cpp +++ b/src/V3LinkJump.cpp @@ -192,7 +192,7 @@ private: // REPEAT(count,body) -> loop=count,WHILE(loop>0) { body, loop-- } // Note var can be signed or unsigned based on original number. AstNodeExpr* const countp = nodep->countp()->unlinkFrBackWithNext(); - const string name = string("__Vrepeat") + cvtToStr(m_modRepeatNum++); + const string name = string{"__Vrepeat"} + cvtToStr(m_modRepeatNum++); // Spec says value is integral, if negative is ignored AstVar* const varp = new AstVar{nodep->fileline(), VVarType::BLOCKTEMP, name, nodep->findSigned32DType()}; diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 25283e424..31d37e4b9 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -966,9 +966,9 @@ void V3Options::parseOpts(FileLine* fl, int argc, char** argv) { // Default prefix to the filename if (prefix() == "" && topModule() != "") - m_prefix = string("V") + AstNode::encodeName(topModule()); + m_prefix = string{"V"} + AstNode::encodeName(topModule()); if (prefix() == "" && vFilesList.size() >= 1) - m_prefix = string("V") + AstNode::encodeName(V3Os::filenameNonExt(*(vFilesList.begin()))); + m_prefix = string{"V"} + AstNode::encodeName(V3Os::filenameNonExt(*(vFilesList.begin()))); if (modPrefix() == "") m_modPrefix = prefix(); // Find files in makedir diff --git a/src/V3Order.cpp b/src/V3Order.cpp index a81a8afe0..dc1905f97 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -510,7 +510,7 @@ public: } } string name() const { - return (string("MDS:") + " d=" + cvtToHex(domainp()) + " s=" + cvtToHex(scopep())); + return string{"MDS:"} + " d=" + cvtToHex(domainp()) + " s=" + cvtToHex(scopep()); } }; diff --git a/src/V3OrderMoveGraph.h b/src/V3OrderMoveGraph.h index 622ffd5d9..426b410ff 100644 --- a/src/V3OrderMoveGraph.h +++ b/src/V3OrderMoveGraph.h @@ -70,7 +70,7 @@ public: nm = "nul"; // LCOV_EXCL_LINE } else { nm = logicp()->name(); - nm += (string("\\nMV:") + " d=" + cvtToHex(logicp()->domainp()) + nm += (string{"\\nMV:"} + " d=" + cvtToHex(logicp()->domainp()) + " s=" + cvtToHex(logicp()->scopep())); } return nm; @@ -127,7 +127,7 @@ public: string nm; if (logicp()) { nm = logicp()->name(); - nm += (string("\\nMV:") + " d=" + cvtToHex(logicp()->domainp()) + " s=" + nm += (string{"\\nMV:"} + " d=" + cvtToHex(logicp()->domainp()) + " s=" + cvtToHex(logicp()->scopep()) // "color()" represents the mtask ID. + "\\nt=" + cvtToStr(color())); diff --git a/src/V3ParseImp.cpp b/src/V3ParseImp.cpp index b310beb96..cbf1808d5 100644 --- a/src/V3ParseImp.cpp +++ b/src/V3ParseImp.cpp @@ -554,7 +554,7 @@ void V3ParseImp::tokenPipelineSym() { } if (foundp && !v3Global.usesStdPackage()) { AstPackageImport* const impp - = new AstPackageImport(stdpkgp->fileline(), stdpkgp, "*"); + = new AstPackageImport{stdpkgp->fileline(), stdpkgp, "*"}; unitPackage(stdpkgp->fileline())->addStmtsp(impp); v3Global.setUsesStdPackage(); } diff --git a/src/V3Split.cpp b/src/V3Split.cpp index 774d2989d..88cd94652 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -148,7 +148,7 @@ public: SplitVarPostVertex(V3Graph* graphp, AstNode* nodep) : SplitNodeVertex{graphp, nodep} {} ~SplitVarPostVertex() override = default; - string name() const override VL_MT_STABLE { return string("POST ") + SplitNodeVertex::name(); } + string name() const override VL_MT_STABLE { return string{"POST "} + SplitNodeVertex::name(); } string dotColor() const override { return "CadetBlue"; } }; @@ -513,10 +513,10 @@ protected: // And a real ordering to get the statements into something reasonable // We don't care if there's cutable violations here... // Non-cutable violations should be impossible; as those edges are program-order - if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_preo"), false); + if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("splitg_preo", false); m_graph.acyclic(&SplitEdge::followCyclic); m_graph.rank(&SplitEdge::followCyclic); // Or order(), but that's more expensive - if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_opt"), false); + if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("splitg_opt", false); } void reorderBlock(AstNode* nodep) { diff --git a/src/V3Task.cpp b/src/V3Task.cpp index a46b8932a..94c45b035 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -323,7 +323,7 @@ struct TaskDpiUtils { return true; } else { const AstNodeDType* const dtypep = portp->dtypep()->skipRefp(); - frstmt = "VL_SET_" + string(dtypep->charIQWN()) + "_" + frSvType + "("; + frstmt = "VL_SET_" + string{dtypep->charIQWN()} + "_" + frSvType + "("; if (VN_IS(dtypep, UnpackArrayDType)) frstmt += "&"; frstmt += frName; ket = ")"; @@ -425,7 +425,7 @@ private: AstNode* const newbodysp = AstNode::cloneTreeNull(refp->taskp()->stmtsp(), true); // Maybe nullptr AstNode* const beginp - = new AstComment{refp->fileline(), string("Function: ") + refp->name(), true}; + = new AstComment{refp->fileline(), string{"Function: "} + refp->name(), true}; if (newbodysp) beginp->addNext(newbodysp); if (debug() >= 9) beginp->dumpTreeAndNext(cout, "- newbegi: "); // @@ -542,7 +542,7 @@ private: UASSERT_OBJ(cfuncp, refp, "No non-inline task associated with this task call?"); // AstNode* const beginp - = new AstComment{refp->fileline(), string("Function: ") + refp->name(), true}; + = new AstComment{refp->fileline(), string{"Function: "} + refp->name(), true}; AstNodeCCall* ccallp; if (VN_IS(refp, New)) { AstCNew* const cnewp = new AstCNew{refp->fileline(), cfuncp}; @@ -1725,7 +1725,7 @@ string V3Task::assignInternalToDpi(AstVar* portp, bool isPtr, const string& frSu stmt = "for (size_t " + idx + " = 0; " + idx + " < " + cvtToStr(unpackSize) + "; ++" + idx + ") "; stmt += (isBit ? "VL_SET_SVBV_" : "VL_SET_SVLV_") - + string(portp->dtypep()->skipRefp()->charIQWN()) + "(" + cvtToStr(portp->width()) + + string{portp->dtypep()->skipRefp()->charIQWN()} + "(" + cvtToStr(portp->width()) + ", "; stmt += toName + " + " + cvtToStr(portp->dtypep()->skipRefp()->widthWords()) + " * " + idx + ", "; diff --git a/src/verilog.y b/src/verilog.y index 571f51876..b8290953a 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -1803,11 +1803,11 @@ modportPortsDecl: // // IEEE: modport_simple_ports_declaration | modportSimplePortOrTFPort { $$ = GRAMMARP->m_modportImpExpActive ? static_cast( - new AstModportFTaskRef( - $1, *$1, GRAMMARP->m_modportImpExpLastIsExport) ) : + new AstModportFTaskRef{ + $1, *$1, GRAMMARP->m_modportImpExpLastIsExport} ) : static_cast( - new AstModportVarRef( - $1, *$1, GRAMMARP->m_varIO) ); } + new AstModportVarRef{ + $1, *$1, GRAMMARP->m_varIO} ); } ; modportSimplePortOrTFPort:// IEEE: modport_simple_port or modport_tf_port, depending what keyword was earlier