diff options
author | Brad King <brad.king@kitware.com> | 2015-03-23 17:43:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-23 18:03:03 (GMT) |
commit | e86f4c65cdb0b1823fdcfa17038ba852990c8b79 (patch) | |
tree | 74229f62d7dd45733b66568369a22749df0d5fd2 /src | |
parent | d687d1d00346d81cf51bc9eb177d1c090b608bbe (diff) | |
download | CastXML-e86f4c65cdb0b1823fdcfa17038ba852990c8b79.zip CastXML-e86f4c65cdb0b1823fdcfa17038ba852990c8b79.tar.gz CastXML-e86f4c65cdb0b1823fdcfa17038ba852990c8b79.tar.bz2 |
Output: Simplify name lookup result traversal
Use a range-based for loop instead of explicit iterators.
Diffstat (limited to 'src')
-rw-r--r-- | src/Output.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Output.cxx b/src/Output.cxx index 6299cb8..2608704 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -1642,18 +1642,17 @@ void ASTVisitor::LookupStart(clang::DeclContext const* dc, std::string cur = name.substr(0, pos); clang::IdentifierTable& ids = CI.getPreprocessor().getIdentifierTable(); - clang::DeclContext::lookup_const_result r = + clang::DeclContext::lookup_const_result result = dc->lookup(clang::DeclarationName(&ids.get(cur))); if(pos == name.npos) { - for(clang::DeclContext::lookup_const_iterator i = r.begin(), e = r.end(); - i != e; ++i) { - this->AddStartDecl(*i); + for (clang::NamedDecl const* n: result) { + this->AddStartDecl(n); } } else { std::string rest = name.substr(pos+2); - for(clang::DeclContext::lookup_const_iterator i = r.begin(), e = r.end(); - i != e; ++i) { - if (clang::DeclContext* idc = clang::dyn_cast<clang::DeclContext>(*i)) { + for (clang::NamedDecl const* n: result) { + if (clang::DeclContext const* idc = + clang::dyn_cast<clang::DeclContext const>(n)) { this->LookupStart(idc, rest); } } |