[PATCH] D56752: [ASTDump] Mark BlockDecls which capture this with a tag

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 01:43:30 PST 2019


steveire updated this revision to Diff 182475.
steveire added a comment.

Rebase


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56752/new/

https://reviews.llvm.org/D56752

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


Index: test/AST/ast-dump-decl.mm
===================================================================
--- test/AST/ast-dump-decl.mm
+++ test/AST/ast-dump-decl.mm
@@ -39,8 +39,7 @@
     // 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
Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -1379,12 +1379,12 @@
   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());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56752.182475.patch
Type: text/x-patch
Size: 1272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190118/8f0decc3/attachment.bin>


More information about the cfe-commits mailing list