Tokenizer: Removed simplification Tokenizer::simplifyAssignmentBlock. This fixes a fp in linux.

This commit is contained in:
Daniel Marjamäki 2015-01-06 20:44:58 +01:00
parent ad8af6b24e
commit 840b2fb035
1 changed files with 0 additions and 33 deletions

View File

@ -3544,9 +3544,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
// f(x=g()) => x=g(); f(x) // f(x=g()) => x=g(); f(x)
simplifyAssignmentInFunctionCall(); simplifyAssignmentInFunctionCall();
// x = ({ 123; }); => { x = 123; }
simplifyAssignmentBlock();
// The simplifyTemplates have inner loops // The simplifyTemplates have inner loops
if (_settings->terminated()) if (_settings->terminated())
return false; return false;
@ -9410,36 +9407,6 @@ void Tokenizer::simplifyAssignmentInFunctionCall()
} }
} }
void Tokenizer::simplifyAssignmentBlock()
{
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (Token::Match(tok, "[;{}] %var% = ( {")) {
// goto the "} )"
unsigned int indentlevel = 0;
Token *tok2 = tok;
while (nullptr != (tok2 = tok2->next())) {
if (Token::Match(tok2, "(|{"))
++indentlevel;
else if (Token::Match(tok2, ")|}")) {
if (indentlevel <= 2)
break;
--indentlevel;
}
}
if (indentlevel == 2 && Token::simpleMatch(tok2, "} )")) {
tok2 = tok2->tokAt(-3);
if (Token::Match(tok2, "[;{}] %num%|%var% ;")) {
tok2->insertToken("=");
tok2->insertToken(tok->next()->str());
tok2->next()->varId(tok->next()->varId());
tok->deleteNext(3);
tok2->tokAt(5)->deleteNext();
}
}
}
}
}
// Remove __asm.. // Remove __asm..
void Tokenizer::simplifyAsm() void Tokenizer::simplifyAsm()
{ {