Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,15 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
// Store current access in each scope (depends on evaluation progress)
std::map<const Scope*, AccessControl> access;

const bool doProgress = (mSettings.reportProgress != -1);

// find all scopes
for (const Token *tok = mTokenizer.tokens(); tok; tok = tok ? tok->next() : nullptr) {
// #5593 suggested to add here:
mErrorLogger.reportProgress(mTokenizer.list.getSourceFilePath(),
"SymbolDatabase",
tok->progressValue());
if (doProgress)
mErrorLogger.reportProgress(mTokenizer.list.getSourceFilePath(),
"SymbolDatabase",
tok->progressValue());
// Locate next class
if ((tok->isCpp() && tok->isKeyword() &&
((Token::Match(tok, "class|struct|union|namespace ::| %name% final| {|:|::|<") &&
Expand Down
4 changes: 2 additions & 2 deletions lib/templatesimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3186,7 +3186,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
continue;

Token * const tok2 = instantiation.token();
if (!mTokenList.getFiles().empty())
if ((mSettings.reportProgress != -1) && !mTokenList.getFiles().empty())
mErrorLogger.reportProgress(mTokenList.getFiles()[0], "TemplateSimplifier::simplifyTemplateInstantiations()", tok2->progressValue());

if (maxtime > 0 && std::time(nullptr) > maxtime) {
Expand Down Expand Up @@ -3262,7 +3262,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
// TODO: remove the specialized check and handle all uninstantiated templates someday.
if (!instantiated && specialized) {
auto * tok2 = const_cast<Token *>(templateDeclaration.nameToken());
if (!mTokenList.getFiles().empty())
if ((mSettings.reportProgress != -1) && !mTokenList.getFiles().empty())
mErrorLogger.reportProgress(mTokenList.getFiles()[0], "TemplateSimplifier::simplifyTemplateInstantiations()", tok2->progressValue());

if (maxtime > 0 && std::time(nullptr) > maxtime) {
Expand Down
7 changes: 5 additions & 2 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,10 @@ void Tokenizer::simplifyTypedefCpp()
simplifyUsingToTypedef();

const std::time_t maxTime = mSettings.typedefMaxTime > 0 ? std::time(nullptr) + mSettings.typedefMaxTime: 0;
const bool doProgress = (mSettings.reportProgress != -1) && !list.getFiles().empty();

for (Token *tok = list.front(); tok; tok = tok->next()) {
if (!list.getFiles().empty())
if (doProgress)
mErrorLogger.reportProgress(list.getFiles()[0], "Tokenize (typedef)", tok->progressValue());

if (Settings::terminated())
Expand Down Expand Up @@ -2879,8 +2880,10 @@ bool Tokenizer::simplifyUsing()
};
std::list<Using> usingList;

const bool doProgress = (mSettings.reportProgress != -1) && !list.getFiles().empty();

for (Token *tok = list.front(); tok; tok = tok->next()) {
if (!list.getFiles().empty())
if (doProgress)
mErrorLogger.reportProgress(list.getFiles()[0], "Tokenize (using)", tok->progressValue());

if (Settings::terminated())
Expand Down