Skip to content

Commit

Permalink
Small change
Browse files Browse the repository at this point in the history
  • Loading branch information
olabetskyi committed Feb 8, 2024
1 parent fdbcf81 commit e45701a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,20 +725,22 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
const Token *argStart = nullptr;
const Token *declEnd = nullptr;
if (isFunction(tok, scope, &funcStart, &argStart, &declEnd)) {
bool newFunc = true; // Is this function already in the database?
auto range = scope->functionMap.equal_range(tok->str());
for (std::multimap<std::string, const Function*>::const_iterator it = range.first; it != range.second; ++it) {
if (it->second->argsMatch(scope, it->second->argDef, argStart, emptyString, 0)) {
newFunc = false;
break;
if (declEnd && declEnd->str() == ";") {
bool newFunc = true; // Is this function already in the database?
auto range = scope->functionMap.equal_range(tok->str());
for (std::multimap<std::string, const Function*>::const_iterator it = range.first; it != range.second; ++it) {
if (it->second->argsMatch(scope, it->second->argDef, argStart, emptyString, 0)) {
newFunc = false;
break;
}
}
// save function prototype in database
if (newFunc) {
addGlobalFunctionDecl(scope, tok, argStart, funcStart);
}
tok = declEnd;
continue;
}
// save function prototype in database
if (newFunc)
addGlobalFunctionDecl(scope, tok, argStart, funcStart);

tok = declEnd;
continue;
}

} else if (Token::Match(tok, "%var% {")) {
Expand Down

0 comments on commit e45701a

Please sign in to comment.