diff options
| author | Stephen Kelly <steveire@gmail.com> | 2019-01-18 21:55:24 +0000 |
|---|---|---|
| committer | Stephen Kelly <steveire@gmail.com> | 2019-01-18 21:55:24 +0000 |
| commit | 5110ebd9fe5f3c4d6714b6b01635f8f211786808 (patch) | |
| tree | 71e885ffc35931e0c4d164a56999cced36d3a60c | |
| parent | 96e47014010440adbc700e66c68e566236dfc2dd (diff) | |
| download | bcm5719-llvm-5110ebd9fe5f3c4d6714b6b01635f8f211786808.tar.gz bcm5719-llvm-5110ebd9fe5f3c4d6714b6b01635f8f211786808.zip | |
[ASTDump] Mark BlockDecls which capture this with a tag
Summary:
Removal of the child node makes it easier to separate traversal from
output generation.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56752
llvm-svn: 351600
| -rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 6 | ||||
| -rw-r--r-- | clang/test/AST/ast-dump-decl.mm | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index b99ed3b286b..e2390baa7a4 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -1379,12 +1379,12 @@ void ASTDumper::VisitBlockDecl(const BlockDecl *D) { if (D->isVariadic()) OS << " variadic"; + if (D->capturesCXXThis()) + OS << " captures_this"; + for (auto I : D->parameters()) dumpDecl(I); - if (D->capturesCXXThis()) - dumpChild([=]{ OS << "capture this"; }); - for (const auto &I : D->captures()) Visit(I); dumpStmt(D->getBody()); diff --git a/clang/test/AST/ast-dump-decl.mm b/clang/test/AST/ast-dump-decl.mm index d18e56c939d..efe356886a9 100644 --- a/clang/test/AST/ast-dump-decl.mm +++ b/clang/test/AST/ast-dump-decl.mm @@ -39,8 +39,7 @@ struct Test { // CHECK-NEXT: cleanup Block // CHECK-NEXT: CallExpr {{.*}} <col:5, col:24> 'void' // CHECK-NEXT: BlockExpr {{.*}} <col:5, col:22> 'void (^)()' - // CHECK-NEXT: BlockDecl {{.*}} <col:5, col:22> col:5 - // CHECK-NEXT: capture this + // CHECK-NEXT: BlockDecl {{.*}} <col:5, col:22> col:5 captures_this // CHECK-NEXT: CompoundStmt {{.*}} <col:6, col:22> // CHECK-NEXT: CXXMemberCallExpr {{.*}} <col:8, col:19> 'void' // CHECK-NEXT: MemberExpr {{.*}} <col:8, col:14> '<bound member function type>' ->yada |

