From 442e4f35f0f992eecaf35c701fc6ff2f6d5d68de Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 13 Oct 2018 23:06:36 -0400 Subject: [PATCH] Internals: Cleanup empty string constructors for clang-tidy. No functional change. --- src/V3Const.cpp | 4 ++-- src/V3EmitC.cpp | 4 ++-- src/V3LinkDot.cpp | 2 +- src/V3LinkResolve.cpp | 2 +- src/V3PreProc.cpp | 2 +- src/V3Simulate.h | 2 +- src/V3Task.cpp | 2 +- src/V3Undriven.cpp | 2 +- src/VlcTop.cpp | 2 +- src/verilog.y | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/V3Const.cpp b/src/V3Const.cpp index 6a048d403..86c3675ce 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -1977,8 +1977,8 @@ private: } if (m_doNConst && anyconst) { //UINFO(9," Display in "<text()<exprsp(); string text = nodep->text(); diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 3d86a49dd..31fe61574 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1559,7 +1559,7 @@ void EmitCStmts::displayNode(AstNode* nodep, AstScopeName* scopenamep, // Convert Verilog display to C printf formats // "%0t" becomes "%d" emitDispState.clear(); - string vfmt = ""; + string vfmt; string::const_iterator pos = vformat.begin(); bool inPct = false; for (; pos != vformat.end(); ++pos) { @@ -2242,7 +2242,7 @@ void EmitCStmts::emitVarSort(const VarSortMap& vmap, VarVec* sortedp) { void EmitCStmts::emitSortedVarList(const VarVec& anons, const VarVec& nonanons, const string& prefixIfImp) { - string curVarCmt = ""; + string curVarCmt; // Output anons { int anonMembers = anons.size(); diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 040a3717b..19c70e5fb 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -485,7 +485,7 @@ public: } baddot = ident; // So user can see where they botched it okSymp = lookupSymp; - string altIdent = ""; + string altIdent; if (m_forPrearray) { // GENFOR Begin is foo__BRA__##__KET__ after we've genloop unrolled, // but presently should be just "foo". diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index 98ac8d5c5..b97ffce80 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -256,7 +256,7 @@ private: // Check display arguments, return new format string string newFormat; bool inPct = false; - string fmt = ""; + string fmt; for (string::const_iterator it = format.begin(); it != format.end(); ++it) { char ch = *it; if (!inPct && ch=='%') { diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 87c47d918..40d512b35 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -629,7 +629,7 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) { } } - string out = ""; + string out; { // Parse substitution define using arguments string argName; bool quote = false; diff --git a/src/V3Simulate.h b/src/V3Simulate.h index d00808201..220ecf105 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -831,7 +831,7 @@ private: if (m_params) { AstNode* nextArgp = nodep->exprsp(); - string result = ""; + string result; string format = nodep->text(); string::const_iterator pos = format.begin(); bool inPct = false; diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 573a51186..596416a1a 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -969,7 +969,7 @@ private: else if (ftaskNoInline) prefix = "__VnoInFunc_"; // Unless public, v3Descope will not uniquify function names even if duplicate per-scope, // so make it unique now. - string suffix = ""; // So, make them unique + string suffix; // So, make them unique if (!nodep->taskPublic()) suffix = "_"+m_scopep->nameDotless(); AstCFunc* cfuncp = new AstCFunc(nodep->fileline(), prefix + nodep->name() + suffix, diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index 304742cb8..bc0a12503 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -76,7 +76,7 @@ private: inline bool drivenFlag(int bit) const { return m_drivenWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_DRIVEN]; } enum BitNamesWhich { BN_UNUSED, BN_UNDRIVEN, BN_BOTH }; string bitNames(BitNamesWhich which) { - string bits=""; + string bits; bool prev = false; int msb = 0; // bit==-1 loops below; we do one extra iteration so end with prev=false diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp index 179650ea4..ebf9895cb 100644 --- a/src/VlcTop.cpp +++ b/src/VlcTop.cpp @@ -238,7 +238,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) { if (first) { first = false; // Multiple columns on same line; print line just once - string indent = ""; + string indent; for (string::const_iterator pos=line.begin(); pos!=line.end() && isspace(*pos); ++pos) { indent += *pos; } diff --git a/src/verilog.y b/src/verilog.y index 207e96474..c72998382 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -3070,7 +3070,7 @@ dpi_import_export: // ==IEEE: dpi_import_export ; dpi_importLabelE: // IEEE: part of dpi_import_export - /* empty */ { static string s = ""; $$ = &s; } + /* empty */ { static string s; $$ = &s; } | idAny/*c_identifier*/ '=' { $$ = $1; $$=$1; } ;