Symbol database: Refactoring. ticket: #1895
This commit is contained in:
parent
0afd19c59b
commit
5a6eff90d1
|
@ -385,6 +385,8 @@ void CheckClass::createSymbolDatabase()
|
||||||
else
|
else
|
||||||
classPattern = "operator " + func->tokenDef->str() + " (";
|
classPattern = "operator " + func->tokenDef->str() + " (";
|
||||||
}
|
}
|
||||||
|
else if (func->type == Func::Destructor)
|
||||||
|
classPattern = "~ " + func->tokenDef->str() + " (";
|
||||||
else
|
else
|
||||||
classPattern = func->tokenDef->str() + " (";
|
classPattern = func->tokenDef->str() + " (";
|
||||||
|
|
||||||
|
@ -821,7 +823,7 @@ void CheckClass::SpaceInfo::initializeVarList(const Func &func, std::list<std::s
|
||||||
{
|
{
|
||||||
if (Assign && Token::Match(ftok, "%var% ("))
|
if (Assign && Token::Match(ftok, "%var% ("))
|
||||||
{
|
{
|
||||||
initVar(ftok->strAt(0));
|
initVar(ftok->str());
|
||||||
|
|
||||||
// assignment in the initializer..
|
// assignment in the initializer..
|
||||||
// : var(value = x)
|
// : var(value = x)
|
||||||
|
@ -986,7 +988,7 @@ void CheckClass::SpaceInfo::initializeVarList(const Func &func, std::list<std::s
|
||||||
}
|
}
|
||||||
if (tok->isName())
|
if (tok->isName())
|
||||||
{
|
{
|
||||||
assignVar(tok->strAt(0));
|
assignVar(tok->str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -996,37 +998,37 @@ void CheckClass::SpaceInfo::initializeVarList(const Func &func, std::list<std::s
|
||||||
// Assignment of member variable?
|
// Assignment of member variable?
|
||||||
else if (Token::Match(ftok, "%var% ="))
|
else if (Token::Match(ftok, "%var% ="))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(0));
|
assignVar(ftok->str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assignment of array item of member variable?
|
// Assignment of array item of member variable?
|
||||||
else if (Token::Match(ftok, "%var% [ %any% ] ="))
|
else if (Token::Match(ftok, "%var% [ %any% ] ="))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(0));
|
assignVar(ftok->str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assignment of array item of member variable?
|
// Assignment of array item of member variable?
|
||||||
else if (Token::Match(ftok, "%var% [ %any% ] [ %any% ] ="))
|
else if (Token::Match(ftok, "%var% [ %any% ] [ %any% ] ="))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(0));
|
assignVar(ftok->str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assignment of array item of member variable?
|
// Assignment of array item of member variable?
|
||||||
else if (Token::Match(ftok, "* %var% ="))
|
else if (Token::Match(ftok, "* %var% ="))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(1));
|
assignVar(ftok->next()->str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assignment of struct member of member variable?
|
// Assignment of struct member of member variable?
|
||||||
else if (Token::Match(ftok, "%var% . %any% ="))
|
else if (Token::Match(ftok, "%var% . %any% ="))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(0));
|
assignVar(ftok->str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The functions 'clear' and 'Clear' are supposed to initialize variable.
|
// The functions 'clear' and 'Clear' are supposed to initialize variable.
|
||||||
if (Token::Match(ftok, "%var% . clear|Clear ("))
|
if (Token::Match(ftok, "%var% . clear|Clear ("))
|
||||||
{
|
{
|
||||||
assignVar(ftok->strAt(0));
|
assignVar(ftok->str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1762,7 +1764,7 @@ void CheckClass::virtualDestructor()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Empty destructor
|
// Empty destructor
|
||||||
if (destructor->tokenDef->tokAt(3)->link() == destructor->tokenDef->tokAt(4))
|
if (destructor->token->tokAt(3)->link() == destructor->token->tokAt(4))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const Token *derived = info->classDef;
|
const Token *derived = info->classDef;
|
||||||
|
|
Loading…
Reference in New Issue