Tokenizer: add reportProgress to Tokenizer::simplifyKnownVariables. Ticket: #4409

This commit is contained in:
Daniel Marjamäki 2013-01-03 15:22:06 +01:00
parent 70059c06de
commit ded0d50591
1 changed files with 14 additions and 0 deletions

View File

@ -3376,6 +3376,9 @@ bool Tokenizer::simplifyTokenList()
bool modified = true;
while (modified) {
if (_settings && _settings->terminated())
return false;
modified = false;
modified |= simplifyConditions();
modified |= simplifyFunctionReturn();
@ -5978,6 +5981,10 @@ bool Tokenizer::simplifyKnownVariables()
Token *tok3 = NULL;
bool valueIsPointer = false;
// there could be a hang here if tok2 is moved back by the function calls below for some reason
if (_settings->terminated())
return false;
if (!simplifyKnownVariablesGetData(varid, &tok2, &tok3, value, valueVarId, valueIsPointer, floatvars.find(tok2->varId()) != floatvars.end()))
continue;
@ -6017,6 +6024,10 @@ bool Tokenizer::simplifyKnownVariables()
const bool valueIsPointer(false);
Token *tok3 = tok2->tokAt(6);
ret |= simplifyKnownVariablesSimplify(&tok2, tok3, varid, structname, value, valueVarId, valueIsPointer, valueToken, indentlevel);
// there could be a hang here if tok2 was moved back by the function call above for some reason
if (_settings->terminated())
return false;
}
}
@ -6102,6 +6113,9 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
{
const bool pointeralias(valueToken->isName() || Token::Match(valueToken, "& %var% ["));
if (_errorLogger && !list.getFiles().empty())
_errorLogger->reportProgress(list.getFiles()[0], "Tokenize (simplifyKnownVariables)", tok3->progressValue());
bool ret = false;
// skip increments and decrements if the given indentlevel is -1