forked from OSchip/llvm-project
[C++11] Replacing Scope 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.
llvm-svn: 204053
This commit is contained in:
parent
35c5495bbb
commit
5df6aa465e
|
@ -361,27 +361,16 @@ public:
|
|||
/// is a FunctionPrototypeScope.
|
||||
bool containedInPrototypeScope() const;
|
||||
|
||||
typedef UsingDirectivesTy::iterator udir_iterator;
|
||||
typedef UsingDirectivesTy::const_iterator const_udir_iterator;
|
||||
|
||||
void PushUsingDirective(UsingDirectiveDecl *UDir) {
|
||||
UsingDirectives.push_back(UDir);
|
||||
}
|
||||
|
||||
udir_iterator using_directives_begin() {
|
||||
return UsingDirectives.begin();
|
||||
}
|
||||
typedef llvm::iterator_range<UsingDirectivesTy::iterator>
|
||||
using_directives_range;
|
||||
|
||||
udir_iterator using_directives_end() {
|
||||
return UsingDirectives.end();
|
||||
}
|
||||
|
||||
const_udir_iterator using_directives_begin() const {
|
||||
return UsingDirectives.begin();
|
||||
}
|
||||
|
||||
const_udir_iterator using_directives_end() const {
|
||||
return UsingDirectives.end();
|
||||
using_directives_range using_directives() {
|
||||
return using_directives_range(UsingDirectives.begin(),
|
||||
UsingDirectives.end());
|
||||
}
|
||||
|
||||
/// Init - This is used by the parser to implement scope caching.
|
||||
|
|
|
@ -113,10 +113,8 @@ namespace {
|
|||
if (Ctx && Ctx->isFileContext()) {
|
||||
visit(Ctx, Ctx);
|
||||
} else if (!Ctx || Ctx->isFunctionOrMethod()) {
|
||||
Scope::udir_iterator I = S->using_directives_begin(),
|
||||
End = S->using_directives_end();
|
||||
for (; I != End; ++I)
|
||||
visit(*I, InnermostFileDC);
|
||||
for (auto *I : S->using_directives())
|
||||
visit(I, InnermostFileDC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue