From de75bdfed5f837fce707e936cc32a9b8adfba03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 12 Feb 2011 21:11:20 +0100 Subject: [PATCH] Tokenizer: comments/refactorings --- lib/tokenize.cpp | 8 ++++---- lib/tokenize.h | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 2c2e6d5e1..ad2e81738 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2791,8 +2791,8 @@ void Tokenizer::simplifyTemplatesUseDefaultArgumentValues(const std::list &used, - const Token *tok, +void Tokenizer::simplifyTemplatesInstantiate(const Token *tok, + std::list &used, std::set &expandedtemplates) { // this variable is not used at the moment. the intention was to @@ -3157,9 +3157,9 @@ void Tokenizer::simplifyTemplates() //while (!done) { done = true; - for (std::list::iterator iter1 = templates.begin(); iter1 != templates.end(); ++iter1) + for (std::list::const_iterator iter1 = templates.begin(); iter1 != templates.end(); ++iter1) { - simplifyTemplatesInstantiate(used, *iter1, expandedtemplates); + simplifyTemplatesInstantiate(*iter1, used, expandedtemplates); } } diff --git a/lib/tokenize.h b/lib/tokenize.h index 579c233bd..cc076e120 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -425,9 +425,13 @@ public: /** * Simplify templates : expand all instantiatiations for a template + * @todo It seems that inner templates should be instantiated recursively + * @param tok token where the template declaration begins + * @param used a list of template usages (not necessarily just for this template) + * @param expandedtemplates all templates that has been expanded so far. The full names are stored. */ - void simplifyTemplatesInstantiate(std::list &used, - const Token *tok, + void simplifyTemplatesInstantiate(const Token *tok, + std::list &used, std::set &expandedtemplates); /**