diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 18:34:04 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-14 18:34:04 +0000 |
commit | 9371dd2287d35b63193f1f01329e6f7af368d966 (patch) | |
tree | a5774aa255e93ba82568bb564b389ef8fc0cd4f8 /clang/lib/Analysis/AnalysisDeclContext.cpp | |
parent | 84e0723af89eeea211cfd9fce7edf0cbb70ca483 (diff) | |
download | llvm-9371dd2287d35b63193f1f01329e6f7af368d966.zip llvm-9371dd2287d35b63193f1f01329e6f7af368d966.tar.gz llvm-9371dd2287d35b63193f1f01329e6f7af368d966.tar.bz2 |
[C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203958
Diffstat (limited to 'clang/lib/Analysis/AnalysisDeclContext.cpp')
-rw-r--r-- | clang/lib/Analysis/AnalysisDeclContext.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp index 1cc87d1..13f74ae 100644 --- a/clang/lib/Analysis/AnalysisDeclContext.cpp +++ b/clang/lib/Analysis/AnalysisDeclContext.cpp @@ -133,9 +133,8 @@ const ImplicitParamDecl *AnalysisDeclContext::getSelfDecl() const { return MD->getSelfDecl(); if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) { // See if 'self' was captured by the block. - for (BlockDecl::capture_const_iterator it = BD->capture_begin(), - et = BD->capture_end(); it != et; ++it) { - const VarDecl *VD = it->getVariable(); + for (const auto &I : BD->captures()) { + const VarDecl *VD = I.getVariable(); if (VD->getName() == "self") return dyn_cast<ImplicitParamDecl>(VD); } @@ -511,9 +510,8 @@ static DeclVec* LazyInitializeReferencedDecls(const BlockDecl *BD, new (BV) DeclVec(BC, 10); // Go through the capture list. - for (BlockDecl::capture_const_iterator CI = BD->capture_begin(), - CE = BD->capture_end(); CI != CE; ++CI) { - BV->push_back(CI->getVariable(), BC); + for (const auto &CI : BD->captures()) { + BV->push_back(CI.getVariable(), BC); } // Find the referenced global/static variables. |