SymbolDatabase: rename _name
This commit is contained in:
parent
593f7eee38
commit
311454669f
|
@ -1619,7 +1619,7 @@ void Variable::evaluate(const Library* lib)
|
|||
unsigned int pointer = 0;
|
||||
_constness = 0;
|
||||
|
||||
if (_name)
|
||||
if (mNameToken)
|
||||
setFlag(fIsArray, arrayDimensions(lib));
|
||||
|
||||
const Token* tok = _start;
|
||||
|
@ -1673,7 +1673,7 @@ void Variable::evaluate(const Library* lib)
|
|||
setFlag(fIsStlString, isStlType() && (Token::Match(_start->tokAt(2), "string|wstring|u16string|u32string !!::") || (Token::simpleMatch(_start->tokAt(2), "basic_string <") && !Token::simpleMatch(_start->linkAt(3), "> ::"))));
|
||||
}
|
||||
if (_access == Argument) {
|
||||
tok = _name;
|
||||
tok = mNameToken;
|
||||
if (!tok) {
|
||||
// Argument without name
|
||||
tok = _end;
|
||||
|
@ -1697,7 +1697,7 @@ void Variable::evaluate(const Library* lib)
|
|||
// type var = {x}
|
||||
// type var = x; gets simplified to: type var ; var = x ;
|
||||
Token const * declEnd = declEndToken();
|
||||
if ((Token::Match(declEnd, "; %name% =") && declEnd->strAt(1) == _name->str()) ||
|
||||
if ((Token::Match(declEnd, "; %name% =") && declEnd->strAt(1) == mNameToken->str()) ||
|
||||
Token::Match(declEnd, "=|{"))
|
||||
setFlag(fHasDefault, true);
|
||||
}
|
||||
|
@ -2470,7 +2470,7 @@ bool Variable::arrayDimensions(const Library* lib)
|
|||
}
|
||||
}
|
||||
|
||||
const Token *dim = _name;
|
||||
const Token *dim = mNameToken;
|
||||
if (!dim) {
|
||||
// Argument without name
|
||||
dim = _end;
|
||||
|
@ -2600,7 +2600,7 @@ static std::string tokenType(const Token * tok)
|
|||
|
||||
void SymbolDatabase::printVariable(const Variable *var, const char *indent) const
|
||||
{
|
||||
std::cout << indent << "_name: " << tokenToString(var->nameToken(), _tokenizer) << std::endl;
|
||||
std::cout << indent << "mNameToken: " << tokenToString(var->nameToken(), _tokenizer) << std::endl;
|
||||
if (var->nameToken()) {
|
||||
std::cout << indent << " declarationId: " << var->declarationId() << std::endl;
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ public:
|
|||
Variable(const Token *name_, const Token *start_, const Token *end_,
|
||||
std::size_t index_, AccessControl access_, const Type *type_,
|
||||
const Scope *scope_, const Library* lib)
|
||||
: _name(name_),
|
||||
: mNameToken(name_),
|
||||
_start(start_),
|
||||
_end(end_),
|
||||
_index(index_),
|
||||
|
@ -239,7 +239,7 @@ public:
|
|||
* @return name token
|
||||
*/
|
||||
const Token *nameToken() const {
|
||||
return _name;
|
||||
return mNameToken;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -281,8 +281,8 @@ public:
|
|||
*/
|
||||
const std::string &name() const {
|
||||
// name may not exist for function arguments
|
||||
if (_name)
|
||||
return _name->str();
|
||||
if (mNameToken)
|
||||
return mNameToken->str();
|
||||
|
||||
return emptyString;
|
||||
}
|
||||
|
@ -293,8 +293,8 @@ public:
|
|||
*/
|
||||
unsigned int declarationId() const {
|
||||
// name may not exist for function arguments
|
||||
if (_name)
|
||||
return _name->varId();
|
||||
if (mNameToken)
|
||||
return mNameToken->varId();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ private:
|
|||
}
|
||||
|
||||
/** @brief variable name token */
|
||||
const Token *_name;
|
||||
const Token *mNameToken;
|
||||
|
||||
/** @brief variable type start token */
|
||||
const Token *_start;
|
||||
|
|
Loading…
Reference in New Issue