Rename variables
This commit is contained in:
parent
fdb0d354ef
commit
03a4c84fec
|
@ -1655,17 +1655,17 @@ void TemplateSimplifier::simplifyTemplates(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<TokenAndName> templates(TemplateSimplifier::getTemplateDeclarations(tokenlist.front(), _codeWithTemplates));
|
std::list<TokenAndName> templateDeclarations(TemplateSimplifier::getTemplateDeclarations(tokenlist.front(), _codeWithTemplates));
|
||||||
|
|
||||||
// Locate possible instantiations of templates..
|
// Locate possible instantiations of templates..
|
||||||
std::list<TokenAndName> templateInstantiations(TemplateSimplifier::getTemplateInstantiations(tokenlist.front(), templates));
|
std::list<TokenAndName> templateInstantiations(TemplateSimplifier::getTemplateInstantiations(tokenlist.front(), templateDeclarations));
|
||||||
|
|
||||||
// No template instantiations? Then return.
|
// No template instantiations? Then return.
|
||||||
if (templateInstantiations.empty())
|
if (templateInstantiations.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Template arguments with default values
|
// Template arguments with default values
|
||||||
TemplateSimplifier::useDefaultArgumentValues(templates, &templateInstantiations);
|
TemplateSimplifier::useDefaultArgumentValues(templateDeclarations, &templateInstantiations);
|
||||||
|
|
||||||
TemplateSimplifier::simplifyTemplateAliases(&templateInstantiations);
|
TemplateSimplifier::simplifyTemplateAliases(&templateInstantiations);
|
||||||
|
|
||||||
|
@ -1674,8 +1674,8 @@ void TemplateSimplifier::simplifyTemplates(
|
||||||
//while (!done)
|
//while (!done)
|
||||||
{
|
{
|
||||||
//done = true;
|
//done = true;
|
||||||
std::list<TokenAndName> templates2;
|
std::list<TokenAndName> instantiatedTemplates;
|
||||||
for (std::list<TokenAndName>::reverse_iterator iter1 = templates.rbegin(); iter1 != templates.rend(); ++iter1) {
|
for (std::list<TokenAndName>::reverse_iterator iter1 = templateDeclarations.rbegin(); iter1 != templateDeclarations.rend(); ++iter1) {
|
||||||
bool instantiated = TemplateSimplifier::simplifyTemplateInstantiations(tokenlist,
|
bool instantiated = TemplateSimplifier::simplifyTemplateInstantiations(tokenlist,
|
||||||
errorlogger,
|
errorlogger,
|
||||||
_settings,
|
_settings,
|
||||||
|
@ -1684,17 +1684,17 @@ void TemplateSimplifier::simplifyTemplates(
|
||||||
templateInstantiations,
|
templateInstantiations,
|
||||||
expandedtemplates);
|
expandedtemplates);
|
||||||
if (instantiated)
|
if (instantiated)
|
||||||
templates2.push_back(*iter1);
|
instantiatedTemplates.push_back(*iter1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::list<TokenAndName>::const_iterator it = templates2.begin(); it != templates2.end(); ++it) {
|
for (std::list<TokenAndName>::const_iterator it = instantiatedTemplates.begin(); it != instantiatedTemplates.end(); ++it) {
|
||||||
std::list<TokenAndName>::iterator it1;
|
std::list<TokenAndName>::iterator it1;
|
||||||
for (it1 = templates.begin(); it1 != templates.end(); ++it1) {
|
for (it1 = templateDeclarations.begin(); it1 != templateDeclarations.end(); ++it1) {
|
||||||
if (it1->token == it->token)
|
if (it1->token == it->token)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (it1 != templates.end()) {
|
if (it1 != templateDeclarations.end()) {
|
||||||
templates.erase(it1);
|
templateDeclarations.erase(it1);
|
||||||
removeTemplate(it->token);
|
removeTemplate(it->token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue