diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index 680f3b8b4..9af5384a6 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -95,8 +95,8 @@ private: m_unnamedScope = dot(m_unnamedScope, ident); // Create CellInline for dotted var resolution if (!m_ftaskp) { - AstCellInline* const inlinep = new AstCellInline( - nodep->fileline(), m_unnamedScope, blockName, m_modp->timeunit()); + AstCellInline* const inlinep = new AstCellInline{ + nodep->fileline(), m_unnamedScope, blockName, m_modp->timeunit()}; m_modp->addInlinesp(inlinep); // Must be parsed before any AstCells } } diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp index 9b76b8d2b..2ff17e9f6 100644 --- a/src/V3Broken.cpp +++ b/src/V3Broken.cpp @@ -355,8 +355,8 @@ void V3Broken::brokenAll(AstNetlist* nodep) { void V3Broken::selfTest() { // Exercise addNewed and deleted for coverage, as otherwise only used with VL_LEAK_CHECKS - FileLine* const fl = new FileLine(FileLine::commandLineFilename()); - const AstNode* const newp = new AstBegin(fl, "[EditWrapper]", nullptr); + FileLine* const fl = new FileLine{FileLine::commandLineFilename()}; + const AstNode* const newp = new AstBegin{fl, "[EditWrapper]", nullptr}; addNewed(newp); deleted(newp); VL_DO_DANGLING(delete newp, newp); diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index 31661a277..501e42098 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -58,7 +58,7 @@ private: UASSERT_OBJ(!nodep->access().isRW(), nodep, "Cannot handle a READWRITE reference"); if (nodep->access().isWriteOnly()) { nodep->replaceWith( - new AstVarRef(nodep->fileline(), nodep->varScopep(), VAccess::READ)); + new AstVarRef{nodep->fileline(), nodep->varScopep(), VAccess::READ}); } } @@ -113,7 +113,7 @@ private: AstIf* makeActiveIf(AstSenTree* sensesp) { AstNode* const senEqnp = createSenseEquation(sensesp->sensesp()); UASSERT_OBJ(senEqnp, sensesp, "No sense equation, shouldn't be in sequent activation."); - AstIf* const newifp = new AstIf(sensesp->fileline(), senEqnp); + AstIf* const newifp = new AstIf{sensesp->fileline(), senEqnp}; return newifp; } void clearLastSen() { @@ -130,11 +130,11 @@ private: AstNode* const changeWrp = nodep->changep()->unlinkFrBack(); AstNode* const changeRdp = ConvertWriteRefsToRead::main(changeWrp->cloneTree(false)); AstIf* const newp - = new AstIf(nodep->fileline(), new AstXor(nodep->fileline(), origp, changeRdp), incp); + = new AstIf{nodep->fileline(), new AstXor{nodep->fileline(), origp, changeRdp}, incp}; // We could add another IF to detect posedges, and only increment if so. // It's another whole branch though versus a potential memory miss. // We'll go with the miss. - newp->addThensp(new AstAssign(nodep->fileline(), changeWrp, origp->cloneTree(false))); + newp->addThensp(new AstAssign{nodep->fileline(), changeWrp, origp->cloneTree(false)}); nodep->replaceWith(newp); VL_DO_DANGLING(nodep->deleteTree(), nodep); } diff --git a/src/V3Config.cpp b/src/V3Config.cpp index d71b7cc16..9570c7245 100644 --- a/src/V3Config.cpp +++ b/src/V3Config.cpp @@ -105,10 +105,10 @@ public: // Apply all attributes to the variable void apply(AstVar* varp) { for (const_iterator it = begin(); it != end(); ++it) { - AstNode* const newp = new AstAttrOf(varp->fileline(), it->m_type); + AstNode* const newp = new AstAttrOf{varp->fileline(), it->m_type}; varp->addAttrsp(newp); if (it->m_type == VAttrType::VAR_PUBLIC_FLAT_RW && it->m_sentreep) { - newp->addNext(new AstAlwaysPublic(varp->fileline(), it->m_sentreep, nullptr)); + newp->addNext(new AstAlwaysPublic{varp->fileline(), it->m_sentreep, nullptr}); } } } @@ -143,9 +143,9 @@ public: void apply(AstNodeFTask* ftaskp) const { if (m_noinline) - ftaskp->addStmtsp(new AstPragma(ftaskp->fileline(), VPragmaType::NO_INLINE_TASK)); + ftaskp->addStmtsp(new AstPragma{ftaskp->fileline(), VPragmaType::NO_INLINE_TASK}); if (m_public) - ftaskp->addStmtsp(new AstPragma(ftaskp->fileline(), VPragmaType::PUBLIC_TASK)); + ftaskp->addStmtsp(new AstPragma{ftaskp->fileline(), VPragmaType::PUBLIC_TASK}); // Only functions can have isolate (return value) if (VN_IS(ftaskp, Func)) ftaskp->attrIsolateAssign(m_isolate); } @@ -194,7 +194,7 @@ public: if (m_inline) { const VPragmaType type = m_inlineValue ? VPragmaType::INLINE_MODULE : VPragmaType::NO_INLINE_MODULE; - AstNode* const nodep = new AstPragma(modp->fileline(), type); + AstNode* const nodep = new AstPragma{modp->fileline(), type}; modp->addStmtsp(nodep); } for (const auto& itr : m_modPragmas) { @@ -208,7 +208,7 @@ public: if (!nodep->unnamed()) { for (const string& i : m_coverageOffBlocks) { if (VString::wildmatch(nodep->name(), i)) { - nodep->addStmtsp(new AstPragma(nodep->fileline(), pragma)); + nodep->addStmtsp(new AstPragma{nodep->fileline(), pragma}); } } } @@ -302,7 +302,7 @@ public: // Apply to block at this line const VPragmaType pragma = VPragmaType::COVERAGE_BLOCK_OFF; if (lineMatch(nodep->fileline()->lineno(), pragma)) { - nodep->addStmtsp(new AstPragma(nodep->fileline(), pragma)); + nodep->addStmtsp(new AstPragma{nodep->fileline(), pragma}); } } void applyCase(AstCase* nodep) { @@ -569,14 +569,14 @@ void V3Config::addVarAttr(FileLine* fl, const string& module, const string& ftas fl->v3error("Signals inside functions/tasks cannot be marked forceable"); } else { V3ConfigResolver::s().modules().at(module).vars().at(var).push_back( - V3ConfigVarAttr(attr)); + V3ConfigVarAttr{attr}); } } else { V3ConfigModule& mod = V3ConfigResolver::s().modules().at(module); if (ftask.empty()) { - mod.vars().at(var).push_back(V3ConfigVarAttr(attr, sensep)); + mod.vars().at(var).push_back(V3ConfigVarAttr{attr, sensep}); } else { - mod.ftasks().at(ftask).vars().at(var).push_back(V3ConfigVarAttr(attr, sensep)); + mod.ftasks().at(ftask).vars().at(var).push_back(V3ConfigVarAttr{attr, sensep}); } } } diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index 69497def3..09ea0c1eb 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -53,14 +53,14 @@ private: // Create sub function AstScope* const scopep = m_cfuncp->scopep(); const string name = m_cfuncp->name() + "__deep" + cvtToStr(++m_deepNum); - AstCFunc* const funcp = new AstCFunc(nodep->fileline(), name, scopep); + AstCFunc* const funcp = new AstCFunc{nodep->fileline(), name, scopep}; funcp->slow(m_cfuncp->slow()); funcp->isStatic(m_cfuncp->isStatic()); funcp->isLoose(m_cfuncp->isLoose()); funcp->addStmtsp(nodep); scopep->addBlocksp(funcp); // Call sub function at the point where the body was removed from - AstCCall* const callp = new AstCCall(nodep->fileline(), funcp); + AstCCall* const callp = new AstCCall{nodep->fileline(), funcp}; callp->dtypeSetVoid(); if (VN_IS(m_modp, Class)) { funcp->argTypes(EmitCBaseVisitor::symClassVar()); diff --git a/src/V3EmitXml.cpp b/src/V3EmitXml.cpp index 17a35a426..db6ec800f 100644 --- a/src/V3EmitXml.cpp +++ b/src/V3EmitXml.cpp @@ -441,7 +441,7 @@ void V3EmitXml::emitxml() { const string filename = (v3Global.opt.xmlOutput().empty() ? v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + ".xml" : v3Global.opt.xmlOutput()); - V3OutXmlFile of(filename); + V3OutXmlFile of{filename}; of.putsHeader(); of.puts("\n"); diff --git a/src/V3Global.cpp b/src/V3Global.cpp index 34cbe343b..dd9ec4ac5 100644 --- a/src/V3Global.cpp +++ b/src/V3Global.cpp @@ -52,14 +52,14 @@ void V3Global::readFiles() { // AstNode::user4p() // VSymEnt* Package and typedef symbol names const VNUser4InUse inuser4; - VInFilter filter(v3Global.opt.pipeFilter()); - V3ParseSym parseSyms(v3Global.rootp()); // Symbol table must be common across all parsing + VInFilter filter{v3Global.opt.pipeFilter()}; + V3ParseSym parseSyms{v3Global.rootp()}; // Symbol table must be common across all parsing V3Parse parser(v3Global.rootp(), &filter, &parseSyms); // Read top module const V3StringList& vFiles = v3Global.opt.vFiles(); for (const string& filename : vFiles) { - parser.parseFile(new FileLine(FileLine::commandLineFilename()), filename, false, + parser.parseFile(new FileLine{FileLine::commandLineFilename()}, filename, false, "Cannot find file containing module: "); } @@ -68,7 +68,7 @@ void V3Global::readFiles() { // this needs to be done after the top file is read const V3StringSet& libraryFiles = v3Global.opt.libraryFiles(); for (const string& filename : libraryFiles) { - parser.parseFile(new FileLine(FileLine::commandLineFilename()), filename, true, + parser.parseFile(new FileLine{FileLine::commandLineFilename()}, filename, true, "Cannot find file containing library module: "); } // v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("parse.tree")); diff --git a/src/V3InstrCount.cpp b/src/V3InstrCount.cpp index 7aff91d73..b72e352e6 100644 --- a/src/V3InstrCount.cpp +++ b/src/V3InstrCount.cpp @@ -333,6 +333,6 @@ private: uint32_t V3InstrCount::count(AstNode* nodep, bool assertNoDups, std::ostream* osp) { const InstrCountVisitor visitor{nodep, assertNoDups, osp}; - if (osp) InstrCountDumpVisitor dumper(nodep, osp); + if (osp) InstrCountDumpVisitor dumper{nodep, osp}; return visitor.instrCount(); } diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index 1de5d06e3..4a30bcc7b 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -106,7 +106,7 @@ private: ? oldVarp->name() : nodep->scopep()->nameDotless() + "__DOT__" + oldVarp->name(); AstVar* const newVarp - = new AstVar(oldVarp->fileline(), oldVarp->varType(), newName, oldVarp); + = new AstVar{oldVarp->fileline(), oldVarp->varType(), newName, oldVarp}; newVarp->funcLocal(true); funcp->addInitsp(newVarp); diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 64b9d2b60..e438d646e 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1688,7 +1688,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) { whole_file += "\n"; // So string match below is simplified if (inCmt) fl->v3error("Unterminated /* comment inside -f file."); - fl = new FileLine(filename); + fl = new FileLine{filename}; // Split into argument list and process // Note we try to respect escaped char, double/simple quoted strings diff --git a/src/V3ParseGrammar.cpp b/src/V3ParseGrammar.cpp index 0c0fbf969..2c1c31e47 100644 --- a/src/V3ParseGrammar.cpp +++ b/src/V3ParseGrammar.cpp @@ -73,12 +73,12 @@ AstArg* V3ParseGrammar::argWrapList(AstNode* nodep) { // Convert list of expressions to list of arguments if (!nodep) return nullptr; AstArg* outp = nullptr; - AstBegin* const tempp = new AstBegin(nodep->fileline(), "[EditWrapper]", nodep); + AstBegin* const tempp = new AstBegin{nodep->fileline(), "[EditWrapper]", nodep}; while (nodep) { AstNode* const nextp = nodep->nextp(); AstNode* const exprp = nodep->unlinkFrBack(); nodep = nextp; - outp = AstNode::addNext(outp, new AstArg(exprp->fileline(), "", exprp)); + outp = AstNode::addNext(outp, new AstArg{exprp->fileline(), "", exprp}); } VL_DO_DANGLING(tempp->deleteTree(), tempp); return outp; @@ -127,22 +127,22 @@ AstNodeDType* V3ParseGrammar::createArray(AstNodeDType* basep, AstNodeRange* nra AstRange* const rangep = VN_CAST(nrangep, Range); if (rangep && isPacked) { arrayp - = new AstPackArrayDType(rangep->fileline(), VFlagChildDType(), arrayp, rangep); + = new AstPackArrayDType{rangep->fileline(), VFlagChildDType(), arrayp, rangep}; } else if (rangep && (VN_IS(rangep->leftp(), Unbounded) || VN_IS(rangep->rightp(), Unbounded))) { - arrayp = new AstQueueDType(nrangep->fileline(), VFlagChildDType(), arrayp, - rangep->rightp()->cloneTree(true)); + arrayp = new AstQueueDType{nrangep->fileline(), VFlagChildDType(), arrayp, + rangep->rightp()->cloneTree(true)}; } else if (rangep) { - arrayp = new AstUnpackArrayDType(rangep->fileline(), VFlagChildDType(), arrayp, - rangep); + arrayp = new AstUnpackArrayDType{rangep->fileline(), VFlagChildDType{}, arrayp, + rangep}; } else if (VN_IS(nrangep, UnsizedRange)) { - arrayp = new AstUnsizedArrayDType(nrangep->fileline(), VFlagChildDType(), arrayp); + arrayp = new AstUnsizedArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp}; } else if (VN_IS(nrangep, BracketRange)) { const AstBracketRange* const arangep = VN_AS(nrangep, BracketRange); AstNode* const keyp = arangep->elementsp()->unlinkFrBack(); - arrayp = new AstBracketArrayDType(nrangep->fileline(), VFlagChildDType(), arrayp, - keyp); + arrayp = new AstBracketArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp, + keyp}; } else if (VN_IS(nrangep, WildcardRange)) { arrayp = new AstWildcardArrayDType{nrangep->fileline(), VFlagChildDType{}, arrayp}; } else { @@ -166,7 +166,7 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name, } if (GRAMMARP->m_varDecl == VVarType::WREAL) { // dtypep might not be null, might be implicit LOGIC before we knew better - dtypep = new AstBasicDType(fileline, VBasicDTypeKwd::DOUBLE); + dtypep = new AstBasicDType{fileline, VBasicDTypeKwd::DOUBLE}; } if (!dtypep) { // Created implicitly if (m_insideProperty) { @@ -199,7 +199,7 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name, // ARRAYDTYPE0(ARRAYDTYPE1(ARRAYDTYPE2(BASICTYPE3), RANGE), RANGE) AstNodeDType* const arrayDTypep = createArray(dtypep, arrayp, false); - AstVar* const nodep = new AstVar(fileline, type, name, VFlagChildDType(), arrayDTypep); + AstVar* const nodep = new AstVar{fileline, type, name, VFlagChildDType(), arrayDTypep}; nodep->addAttrsp(attrsp); nodep->ansi(m_pinAnsi); nodep->declTyped(m_varDeclTyped); @@ -222,7 +222,7 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name, } if (VN_IS(dtypep, ParseTypeDType)) { // Parser needs to know what is a type - AstNode* const newp = new AstTypedefFwd(fileline, name); + AstNode* const newp = new AstTypedefFwd{fileline, name}; AstNode::addNext(nodep, newp); SYMP->reinsert(newp); } diff --git a/src/V3ParseImp.cpp b/src/V3ParseImp.cpp index cb26c7026..c73b6b64c 100644 --- a/src/V3ParseImp.cpp +++ b/src/V3ParseImp.cpp @@ -196,7 +196,7 @@ double V3ParseImp::lexParseTimenum(const char* textp) { } *dp++ = '\0'; const double d = strtod(strgp, nullptr); - const string suffix(sp); + const string suffix{sp}; double divisor = 1; if (suffix == "s") { @@ -240,7 +240,7 @@ size_t V3ParseImp::ppInputToLex(char* buf, size_t max_size) { got += len; } if (debug() >= 9) { - const string out = string(buf, got); + const string out = std::string{buf, got}; cout << " inputToLex got=" << got << " '" << out << "'" << endl; } // Note returns 0 at EOF @@ -274,7 +274,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i const string modname = V3Os::filenameNonExt(modfilename); UINFO(2, __FUNCTION__ << ": " << modname << (inLibrary ? " [LIB]" : "") << endl); - m_lexFileline = new FileLine(fileline); + m_lexFileline = new FileLine{fileline}; m_lexFileline->newContent(); m_bisonLastFileline = m_lexFileline; m_inLibrary = inLibrary; @@ -284,7 +284,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i if (!ok) { if (errmsg != "") return; // Threw error already // Create fake node for later error reporting - AstNodeModule* const nodep = new AstNotFoundModule(fileline, modname); + AstNodeModule* const nodep = new AstNotFoundModule{fileline, modname}; v3Global.rootp()->addModulesp(nodep); return; } @@ -589,7 +589,7 @@ std::ostream& operator<<(std::ostream& os, const V3ParseBisonYYSType& rhs) { // V3Parse functions V3Parse::V3Parse(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* symp) { - m_impp = new V3ParseImp(rootp, filterp, symp); + m_impp = new V3ParseImp{rootp, filterp, symp}; } V3Parse::~V3Parse() { // VL_DO_CLEAR(delete m_impp, m_impp = nullptr); diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 6aadb69f7..4bc4f0d76 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -263,10 +263,10 @@ public: void configure(FileLine* filelinep) { // configure() separate from constructor to avoid calling abstract functions m_preprocp = this; // Silly, but to make code more similar to Verilog-Perl - m_finFilelinep = new FileLine(filelinep->filename()); + m_finFilelinep = new FileLine{filelinep->filename()}; m_finFilelinep->lineno(1); // Create lexer - m_lexp = new V3PreLex(this, filelinep); + m_lexp = new V3PreLex{this, filelinep}; m_lexp->m_keepComments = keepComments(); m_lexp->m_keepWhitespace = keepWhitespace(); m_lexp->m_pedantic = pedantic(); @@ -793,7 +793,7 @@ void V3PreProcImp::openFile(FileLine*, VInFilter* filterp, const string& filenam } // Save file contents for future error reporting - FileLine* const flsp = new FileLine(filename); + FileLine* const flsp = new FileLine{filename}; flsp->lineno(1); flsp->newContent(); for (const string& i : wholefile) flsp->contentp()->pushText(i); diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp index 0502535af..9236283ca 100644 --- a/src/V3PreShell.cpp +++ b/src/V3PreShell.cpp @@ -46,10 +46,10 @@ protected: void boot() { // Create the implementation pointer if (!s_preprocp) { - FileLine* const cmdfl = new FileLine(FileLine::commandLineFilename()); + FileLine* const cmdfl = new FileLine{FileLine::commandLineFilename()}; s_preprocp = V3PreProc::createPreProc(cmdfl); // Default defines - FileLine* const prefl = new FileLine(FileLine::builtInFilename()); + FileLine* const prefl = new FileLine{FileLine::builtInFilename()}; s_preprocp->defineCmdLine(prefl, "VERILATOR", "1"); // LEAK_OK s_preprocp->defineCmdLine(prefl, "verilator", "1"); // LEAK_OK s_preprocp->defineCmdLine(prefl, "verilator3", "1"); // LEAK_OK @@ -161,7 +161,7 @@ void V3PreShell::preprocInclude(FileLine* fl, const string& modname) { V3PreShellImp::s_preImp.preprocInclude(fl, modname); } void V3PreShell::defineCmdLine(const string& name, const string& value) { - FileLine* const prefl = new FileLine(FileLine::commandLineFilename()); + FileLine* const prefl = new FileLine{FileLine::commandLineFilename()}; V3PreShellImp::s_preprocp->defineCmdLine(prefl, name, value); } void V3PreShell::undef(const string& name) { V3PreShellImp::s_preprocp->undef(name); } diff --git a/src/V3Scoreboard.cpp b/src/V3Scoreboard.cpp index d21422a81..b46aee6fb 100644 --- a/src/V3Scoreboard.cpp +++ b/src/V3Scoreboard.cpp @@ -58,9 +58,9 @@ void V3ScoreboardBase::selfTest() { UASSERT(!sb.needsRescore(), "SelfTest: Empty sb should not need rescore."); - ScoreboardTestElem e1(10); - ScoreboardTestElem e2(20); - ScoreboardTestElem e3(30); + ScoreboardTestElem e1{10}; + ScoreboardTestElem e2{20}; + ScoreboardTestElem e3{30}; sb.add(&e1); sb.add(&e2); diff --git a/src/V3String.cpp b/src/V3String.cpp index af6122e7d..4b1f2f7f6 100644 --- a/src/V3String.cpp +++ b/src/V3String.cpp @@ -263,7 +263,7 @@ void VHashSha256::insert(const void* datap, size_t length) { // If there are large inserts it would be more efficient to avoid this copy // by copying bytes in the loop below from either m_remainder or the data // as appropriate. - tempData = m_remainder + string(static_cast(datap), length); + tempData = m_remainder + std::string{static_cast(datap), length}; chunkLen = tempData.length(); chunkp = reinterpret_cast(tempData.data()); } @@ -286,7 +286,7 @@ void VHashSha256::insert(const void* datap, size_t length) { sha256Block(m_inthash, w); } - m_remainder = string(reinterpret_cast(chunkp + posBegin), chunkLen - posEnd); + m_remainder = std::string(reinterpret_cast(chunkp + posBegin), chunkLen - posEnd); } void VHashSha256::finalize() { @@ -426,7 +426,7 @@ string VName::dehash(const string& in) { const auto begin_vhsh = std::search(search_begin, search_end, std::begin(VHSH), std::end(VHSH) - 1); if (begin_vhsh != search_end) { - const std::string vhsh(begin_vhsh, search_end); + const std::string vhsh{begin_vhsh, search_end}; const auto& it = s_dehashMap.find(vhsh); UASSERT(it != s_dehashMap.end(), "String not in reverse hash map '" << vhsh << "'"); // Is this not the first component, but the first to require dehashing? @@ -435,13 +435,13 @@ string VName::dehash(const string& in) { dehashed = in.substr(0, last_dot_pos); } // Append the unhashed part of the component. - dehashed += std::string(search_begin, begin_vhsh); + dehashed += std::string{search_begin, begin_vhsh}; // Append the bit that was lost to truncation but retrieved from the dehash map. dehashed += it->second; } // This component doesn't need dehashing but a previous one might have. else if (!dehashed.empty()) { - dehashed += std::string(search_begin, search_end); + dehashed += std::string{search_begin, search_end}; } if (next_dot_pos != string::npos) { diff --git a/src/V3Subst.cpp b/src/V3Subst.cpp index 60a664786..4df63e5c8 100644 --- a/src/V3Subst.cpp +++ b/src/V3Subst.cpp @@ -238,7 +238,7 @@ private: // METHODS SubstVarEntry* getEntryp(AstVarRef* nodep) { if (!nodep->varp()->user1p()) { - SubstVarEntry* const entryp = new SubstVarEntry(nodep->varp()); + SubstVarEntry* const entryp = new SubstVarEntry{nodep->varp()}; m_entryps.push_back(entryp); nodep->varp()->user1p(entryp); return entryp; @@ -290,7 +290,7 @@ private: if (debug() > 5) nodep->dumpTree(cout, " substw_old: "); AstNode* newp = substp->cloneTree(true); if (!nodep->isQuad() && newp->isQuad()) { - newp = new AstCCast(newp->fileline(), newp, nodep); + newp = new AstCCast{newp->fileline(), newp, nodep}; } if (debug() > 5) newp->dumpTree(cout, " w_new: "); nodep->replaceWith(newp); diff --git a/src/V3TSP.cpp b/src/V3TSP.cpp index 0e488ca45..522856da2 100644 --- a/src/V3TSP.cpp +++ b/src/V3TSP.cpp @@ -90,7 +90,7 @@ public: void addVertex(const T_Key& key) { const auto itr = m_vertices.find(key); UASSERT(itr == m_vertices.end(), "Vertex already exists with same key"); - Vertex* v = new Vertex(this, key); + Vertex* v = new Vertex{this, key}; m_vertices[key] = v; } @@ -118,8 +118,8 @@ public: // which uniquely identifies a single bidir edge. Luckily we // can do both efficiently. const uint64_t userValue = (static_cast(cost) << 32) | edgeId; - (new V3GraphEdge(this, fp, tp, cost))->user(userValue); - (new V3GraphEdge(this, tp, fp, cost))->user(userValue); + (new V3GraphEdge{this, fp, tp, cost})->user(userValue); + (new V3GraphEdge{this, tp, fp, cost})->user(userValue); } static uint32_t getEdgeId(const V3GraphEdge* edgep) { @@ -581,11 +581,11 @@ void V3TSP::selfTestStates() { // Linear test -- coords all along the x-axis { V3TSP::StateVec states; - const TspTestState s10(10, 0); - const TspTestState s60(60, 0); - const TspTestState s20(20, 0); - const TspTestState s100(100, 0); - const TspTestState s5(5, 0); + const TspTestState s10{10, 0}; + const TspTestState s60{60, 0}; + const TspTestState s20{20, 0}; + const TspTestState s100{100, 0}; + const TspTestState s5{5, 0}; states.push_back(&s10); states.push_back(&s60); states.push_back(&s20); @@ -615,13 +615,13 @@ void V3TSP::selfTestStates() { // Test that tspSort() will rotate the list for minimum cost. { V3TSP::StateVec states; - const TspTestState a(0, 0); - const TspTestState b(100, 0); - const TspTestState c(200, 0); - const TspTestState d(200, 100); - const TspTestState e(150, 150); - const TspTestState f(0, 150); - const TspTestState g(0, 100); + const TspTestState a{0, 0}; + const TspTestState b{100, 0}; + const TspTestState c{200, 0}; + const TspTestState d{200, 100}; + const TspTestState e{150, 150}; + const TspTestState f{0, 150}; + const TspTestState g{0, 100}; states.push_back(&a); states.push_back(&b); diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index c2a757a9b..2a2b2943d 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -267,7 +267,7 @@ private: UndrivenVarEntry* getEntryp(AstVar* nodep, int which_user) { if (!(which_user == 1 ? nodep->user1p() : nodep->user2p())) { - UndrivenVarEntry* const entryp = new UndrivenVarEntry(nodep); + UndrivenVarEntry* const entryp = new UndrivenVarEntry{nodep}; // UINFO(9," Associate u="<name()<