Internals: Cleanup empty string constructors for clang-tidy. No functional change.

This commit is contained in:
Wilson Snyder 2018-10-13 23:06:36 -04:00
parent e8b8b33ff6
commit 442e4f35f0
10 changed files with 12 additions and 12 deletions

View File

@ -1977,8 +1977,8 @@ private:
} }
if (m_doNConst && anyconst) { if (m_doNConst && anyconst) {
//UINFO(9," Display in "<<nodep->text()<<endl); //UINFO(9," Display in "<<nodep->text()<<endl);
string newFormat = ""; string newFormat;
string fmt = ""; string fmt;
bool inPct = false; bool inPct = false;
AstNode* argp = nodep->exprsp(); AstNode* argp = nodep->exprsp();
string text = nodep->text(); string text = nodep->text();

View File

@ -1559,7 +1559,7 @@ void EmitCStmts::displayNode(AstNode* nodep, AstScopeName* scopenamep,
// Convert Verilog display to C printf formats // Convert Verilog display to C printf formats
// "%0t" becomes "%d" // "%0t" becomes "%d"
emitDispState.clear(); emitDispState.clear();
string vfmt = ""; string vfmt;
string::const_iterator pos = vformat.begin(); string::const_iterator pos = vformat.begin();
bool inPct = false; bool inPct = false;
for (; pos != vformat.end(); ++pos) { for (; pos != vformat.end(); ++pos) {
@ -2242,7 +2242,7 @@ void EmitCStmts::emitVarSort(const VarSortMap& vmap, VarVec* sortedp) {
void EmitCStmts::emitSortedVarList(const VarVec& anons, void EmitCStmts::emitSortedVarList(const VarVec& anons,
const VarVec& nonanons, const VarVec& nonanons,
const string& prefixIfImp) { const string& prefixIfImp) {
string curVarCmt = ""; string curVarCmt;
// Output anons // Output anons
{ {
int anonMembers = anons.size(); int anonMembers = anons.size();

View File

@ -485,7 +485,7 @@ public:
} }
baddot = ident; // So user can see where they botched it baddot = ident; // So user can see where they botched it
okSymp = lookupSymp; okSymp = lookupSymp;
string altIdent = ""; string altIdent;
if (m_forPrearray) { if (m_forPrearray) {
// GENFOR Begin is foo__BRA__##__KET__ after we've genloop unrolled, // GENFOR Begin is foo__BRA__##__KET__ after we've genloop unrolled,
// but presently should be just "foo". // but presently should be just "foo".

View File

@ -256,7 +256,7 @@ private:
// Check display arguments, return new format string // Check display arguments, return new format string
string newFormat; string newFormat;
bool inPct = false; bool inPct = false;
string fmt = ""; string fmt;
for (string::const_iterator it = format.begin(); it != format.end(); ++it) { for (string::const_iterator it = format.begin(); it != format.end(); ++it) {
char ch = *it; char ch = *it;
if (!inPct && ch=='%') { if (!inPct && ch=='%') {

View File

@ -629,7 +629,7 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
} }
} }
string out = ""; string out;
{ // Parse substitution define using arguments { // Parse substitution define using arguments
string argName; string argName;
bool quote = false; bool quote = false;

View File

@ -831,7 +831,7 @@ private:
if (m_params) { if (m_params) {
AstNode* nextArgp = nodep->exprsp(); AstNode* nextArgp = nodep->exprsp();
string result = ""; string result;
string format = nodep->text(); string format = nodep->text();
string::const_iterator pos = format.begin(); string::const_iterator pos = format.begin();
bool inPct = false; bool inPct = false;

View File

@ -969,7 +969,7 @@ private:
else if (ftaskNoInline) prefix = "__VnoInFunc_"; else if (ftaskNoInline) prefix = "__VnoInFunc_";
// Unless public, v3Descope will not uniquify function names even if duplicate per-scope, // Unless public, v3Descope will not uniquify function names even if duplicate per-scope,
// so make it unique now. // so make it unique now.
string suffix = ""; // So, make them unique string suffix; // So, make them unique
if (!nodep->taskPublic()) suffix = "_"+m_scopep->nameDotless(); if (!nodep->taskPublic()) suffix = "_"+m_scopep->nameDotless();
AstCFunc* cfuncp = new AstCFunc(nodep->fileline(), AstCFunc* cfuncp = new AstCFunc(nodep->fileline(),
prefix + nodep->name() + suffix, prefix + nodep->name() + suffix,

View File

@ -76,7 +76,7 @@ private:
inline bool drivenFlag(int bit) const { return m_drivenWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_DRIVEN]; } 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 }; enum BitNamesWhich { BN_UNUSED, BN_UNDRIVEN, BN_BOTH };
string bitNames(BitNamesWhich which) { string bitNames(BitNamesWhich which) {
string bits=""; string bits;
bool prev = false; bool prev = false;
int msb = 0; int msb = 0;
// bit==-1 loops below; we do one extra iteration so end with prev=false // bit==-1 loops below; we do one extra iteration so end with prev=false

View File

@ -238,7 +238,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
if (first) { if (first) {
first = false; first = false;
// Multiple columns on same line; print line just once // 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) { for (string::const_iterator pos=line.begin(); pos!=line.end() && isspace(*pos); ++pos) {
indent += *pos; indent += *pos;
} }

View File

@ -3070,7 +3070,7 @@ dpi_import_export<nodep>: // ==IEEE: dpi_import_export
; ;
dpi_importLabelE<strp>: // IEEE: part of dpi_import_export dpi_importLabelE<strp>: // IEEE: part of dpi_import_export
/* empty */ { static string s = ""; $$ = &s; } /* empty */ { static string s; $$ = &s; }
| idAny/*c_identifier*/ '=' { $$ = $1; $<fl>$=$<fl>1; } | idAny/*c_identifier*/ '=' { $$ = $1; $<fl>$=$<fl>1; }
; ;