From: Shafik Yaghmour Date: Mon, 12 Aug 2019 17:07:49 +0000 (+0000) Subject: [ASTDump] Add is_anonymous to VisitCXXRecordDecl X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ba5798e3b5a616bf0d599a1e8f396ba53601ca2;p=clang [ASTDump] Add is_anonymous to VisitCXXRecordDecl Summary: Adding is_anonymous the ASTDump for CXXRecordDecl. This turned out to be useful when debugging some problems with how LLDB creates ASTs from DWARF. Differential Revision: https://reviews.llvm.org/D66028 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368591 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/TextNodeDumper.cpp b/lib/AST/TextNodeDumper.cpp index cba9091b10..df3d149f29 100644 --- a/lib/AST/TextNodeDumper.cpp +++ b/lib/AST/TextNodeDumper.cpp @@ -1537,6 +1537,7 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) { FLAG(isGenericLambda, generic); FLAG(isLambda, lambda); + FLAG(isAnonymousStructOrUnion, is_anonymous); FLAG(canPassInRegisters, pass_in_registers); FLAG(isEmpty, empty); FLAG(isAggregate, aggregate); diff --git a/test/AST/ast-dump-records.cpp b/test/AST/ast-dump-records.cpp index e48d406baf..3682e1a1a4 100644 --- a/test/AST/ast-dump-records.cpp +++ b/test/AST/ast-dump-records.cpp @@ -65,7 +65,7 @@ struct C { union { // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} line:[[@LINE-1]]:3 union definition - // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal + // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal // CHECK-NEXT: DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit @@ -87,7 +87,7 @@ struct C { struct { // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} line:[[@LINE-1]]:3 struct definition - // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal + // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal // CHECK-NEXT: DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit @@ -194,7 +194,7 @@ union G { union { // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} line:[[@LINE-1]]:3 union definition - // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal + // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal // CHECK-NEXT: DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit @@ -217,7 +217,7 @@ union G { struct { // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} line:[[@LINE-1]]:3 struct definition - // CHECK-NEXT: DefinitionData pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal + // CHECK-NEXT: DefinitionData is_anonymous pass_in_registers aggregate standard_layout trivially_copyable pod trivial literal // CHECK-NEXT: DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: MoveConstructor exists simple trivial needs_implicit