Tokenizer::simplifyTemplates: Broke out handling for 'template<>..'

This commit is contained in:
Daniel Marjamäki 2011-02-12 19:43:33 +01:00
parent 518a495334
commit 654116af61
2 changed files with 17 additions and 1 deletions

View File

@ -2548,7 +2548,7 @@ static void removeTemplates(Token *tok)
} }
} }
void Tokenizer::simplifyTemplates() std::set<std::string> Tokenizer::simplifyTemplatesExpandSpecialized()
{ {
std::set<std::string> expandedtemplates; std::set<std::string> expandedtemplates;
@ -2614,6 +2614,15 @@ void Tokenizer::simplifyTemplates()
} }
} }
return expandedtemplates;
}
void Tokenizer::simplifyTemplates()
{
std::set<std::string> expandedtemplates;
expandedtemplates = simplifyTemplatesExpandSpecialized();
// Locate templates.. // Locate templates..
std::list<Token *> templates; std::list<Token *> templates;
for (Token *tok = _tokens; tok; tok = tok->next()) for (Token *tok = _tokens; tok; tok = tok->next())

View File

@ -25,6 +25,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
#include <set>
class Token; class Token;
class ErrorLogger; class ErrorLogger;
@ -395,6 +396,12 @@ public:
*/ */
void simplifyTemplates(); void simplifyTemplates();
/**
* Expand specialized templates : "template<>.."
* \return names of expanded templates
*/
std::set<std::string> simplifyTemplatesExpandSpecialized();
/** /**
* Used after simplifyTemplates to perform a little cleanup. * Used after simplifyTemplates to perform a little cleanup.
* Sometimes the simplifyTemplates isn't fully successful and then * Sometimes the simplifyTemplates isn't fully successful and then