diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 17:14:12 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 17:14:12 +0000 |
commit | 804a7fb7bafb1114317ec40cea548774d09913bd (patch) | |
tree | 18f209a2255c83949d58832b9936419abd6c250e /clang/lib/Sema/SemaLookup.cpp | |
parent | 3f44cd7926eda24cce75746094fac58c2a4f4c92 (diff) | |
download | bcm5719-llvm-804a7fb7bafb1114317ec40cea548774d09913bd.tar.gz bcm5719-llvm-804a7fb7bafb1114317ec40cea548774d09913bd.zip |
[C++11] Replacing DeclContext iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. Also used as an opportunity to normalize the name from getUsingDirectives() to using_directives().
llvm-svn: 204061
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 29671aa65d4..42c9acbdd80 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -151,7 +151,7 @@ namespace { void addUsingDirectives(DeclContext *DC, DeclContext *EffectiveDC) { SmallVector<DeclContext*,4> queue; while (true) { - for (auto UD : DC->getUsingDirectives()) { + for (auto UD : DC->using_directives()) { DeclContext *NS = UD->getNominatedNamespace(); if (visited.insert(NS)) { addUsingDirective(UD, EffectiveDC); @@ -1448,10 +1448,8 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, DeclContext *StartDC) { assert(StartDC->isFileContext() && "start context is not a file context"); - DeclContext::udir_iterator I = StartDC->using_directives_begin(); - DeclContext::udir_iterator E = StartDC->using_directives_end(); - - if (I == E) return false; + DeclContext::udir_range UsingDirectives = StartDC->using_directives(); + if (UsingDirectives.begin() == UsingDirectives.end()) return false; // We have at least added all these contexts to the queue. llvm::SmallPtrSet<DeclContext*, 8> Visited; @@ -1463,8 +1461,8 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, // We have already looked into the initial namespace; seed the queue // with its using-children. - for (; I != E; ++I) { - NamespaceDecl *ND = (*I)->getNominatedNamespace()->getOriginalNamespace(); + for (auto *I : UsingDirectives) { + NamespaceDecl *ND = I->getNominatedNamespace()->getOriginalNamespace(); if (Visited.insert(ND)) Queue.push_back(ND); } @@ -1511,7 +1509,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, continue; } - for (auto I : ND->getUsingDirectives()) { + for (auto I : ND->using_directives()) { NamespaceDecl *Nom = I->getNominatedNamespace(); if (Visited.insert(Nom)) Queue.push_back(Nom); @@ -3074,7 +3072,7 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, // Traverse using directives for qualified name lookup. if (QualifiedNameLookup) { ShadowContextRAII Shadow(Visited); - for (auto I : Ctx->getUsingDirectives()) { + for (auto I : Ctx->using_directives()) { LookupVisibleDecls(I->getNominatedNamespace(), Result, QualifiedNameLookup, InBaseClass, Consumer, Visited); } |