aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-14 17:01:24 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-14 17:01:24 +0000
commit535bbcccb12b3a98bd53b68fef678e38814dbb0c (patch)
treed1734ec7627827f84eda60ea88c320fcc06a5d1b /clang/lib/CodeGen
parentedc1753ba342c6b9ab1f0ab9e047a9ee82b0c079 (diff)
downloadllvm-535bbcccb12b3a98bd53b68fef678e38814dbb0c.zip
llvm-535bbcccb12b3a98bd53b68fef678e38814dbb0c.tar.gz
llvm-535bbcccb12b3a98bd53b68fef678e38814dbb0c.tar.bz2
[C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203947
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp7
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp5
2 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 1f0dd85..4b063c4 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -1013,10 +1013,9 @@ static bool isCapturedBy(const VarDecl &var, const Expr *e) {
}
else if (DeclStmt *DS = dyn_cast<DeclStmt>((*BI))) {
// special case declarations
- for (DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end();
- I != E; ++I) {
- if (VarDecl *VD = dyn_cast<VarDecl>((*I))) {
- Expr *Init = VD->getInit();
+ for (const auto *I : DS->decls()) {
+ if (const auto *VD = dyn_cast<VarDecl>((I))) {
+ const Expr *Init = VD->getInit();
if (Init && isCapturedBy(var, Init))
return true;
}
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index d69c5cd..4e95c8a 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -891,9 +891,8 @@ void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {
if (HaveInsertPoint())
EmitStopPoint(&S);
- for (DeclStmt::const_decl_iterator I = S.decl_begin(), E = S.decl_end();
- I != E; ++I)
- EmitDecl(**I);
+ for (const auto *I : S.decls())
+ EmitDecl(*I);
}
void CodeGenFunction::EmitBreakStmt(const BreakStmt &S) {