summaryrefslogtreecommitdiff
path: root/include/clang/AST
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-26 01:42:24 +0000
committerAlp Toker <alp@nuanti.com>2014-06-26 01:42:24 +0000
commit2a38ab6aeaab8fbe3c4c74ea3ed389ca5bd04c07 (patch)
tree7014c0da5afbda5a5a94415e42577e14c63f7f5e /include/clang/AST
parent5937825128564ab750d20467a91d6776afe8cc73 (diff)
downloadclang-2a38ab6aeaab8fbe3c4c74ea3ed389ca5bd04c07.tar.gz
clang-2a38ab6aeaab8fbe3c4c74ea3ed389ca5bd04c07.tar.bz2
clang-2a38ab6aeaab8fbe3c4c74ea3ed389ca5bd04c07.tar.xz
RAV: visit copy expressions of captured variables in blocks (ObjC++11)
Patch by Mathieu Baudet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST')
-rw-r--r--include/clang/AST/DataRecursiveASTVisitor.h5
-rw-r--r--include/clang/AST/RecursiveASTVisitor.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/AST/DataRecursiveASTVisitor.h b/include/clang/AST/DataRecursiveASTVisitor.h
index 93a9d1d0d2..23c9ce554f 100644
--- a/include/clang/AST/DataRecursiveASTVisitor.h
+++ b/include/clang/AST/DataRecursiveASTVisitor.h
@@ -1207,6 +1207,11 @@ DEF_TRAVERSE_DECL(BlockDecl, {
if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
TRY_TO(TraverseStmt(D->getBody()));
+ for (const auto &I : D->captures()) {
+ if (I.hasCopyExpr()) {
+ TRY_TO(TraverseStmt(I.getCopyExpr()));
+ }
+ }
// This return statement makes sure the traversal of nodes in
// decls_begin()/decls_end() (done in the DEF_TRAVERSE_DECL macro)
// is skipped - don't remove it.
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h
index c9de9e318f..2877642be5 100644
--- a/include/clang/AST/RecursiveASTVisitor.h
+++ b/include/clang/AST/RecursiveASTVisitor.h
@@ -1272,6 +1272,11 @@ DEF_TRAVERSE_DECL(BlockDecl, {
if (TypeSourceInfo *TInfo = D->getSignatureAsWritten())
TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
TRY_TO(TraverseStmt(D->getBody()));
+ for (const auto &I : D->captures()) {
+ if (I.hasCopyExpr()) {
+ TRY_TO(TraverseStmt(I.getCopyExpr()));
+ }
+ }
// This return statement makes sure the traversal of nodes in
// decls_begin()/decls_end() (done in the DEF_TRAVERSE_DECL macro)
// is skipped - don't remove it.