]> granicus.if.org Git - clang/commitdiff
[ASTDump] Mark BlockDecls which capture this with a tag
authorStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 21:55:24 +0000 (21:55 +0000)
committerStephen Kelly <steveire@gmail.com>
Fri, 18 Jan 2019 21:55:24 +0000 (21:55 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351600 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDumper.cpp
test/AST/ast-dump-decl.mm

index b99ed3b286bcb5dea840377dc67ebb4562dc56d6..e2390baa7a4bea0fc1a2a007a999a52556b4efc3 100644 (file)
@@ -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());
index d18e56c939d9d6bef2305f69334892f1a0bb1307..efe356886a93b346b52912b3c4ef6689ae7d7760 100644 (file)
@@ -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