From 528f5da6d862f59c6e005f85eb32a0c67f65bc4d Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 27 Aug 2019 20:17:35 +0000 Subject: Debug Info: Support for DW_AT_export_symbols for anonymous structs This implements the DWARF 5 feature described in: http://dwarfstd.org/ShowIssue.php?issue=141212.1 To support recognizing anonymous structs: struct A { struct { // Anonymous struct int y; }; } a; This patch adds support in CGDebugInfo::CreateLimitedType(...) for this new flag and an accompanying test to verify this feature. Differential Revision: https://reviews.llvm.org/D66667 llvm-svn: 370107 --- clang/test/CodeGenCXX/debug-info-export_symbols.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 clang/test/CodeGenCXX/debug-info-export_symbols.cpp (limited to 'clang/test/CodeGenCXX') diff --git a/clang/test/CodeGenCXX/debug-info-export_symbols.cpp b/clang/test/CodeGenCXX/debug-info-export_symbols.cpp new file mode 100644 index 00000000000..19697beaf2f --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-export_symbols.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -triple %itanium_abi_triple %s -o - | FileCheck %s + +// CHECK: [[SCOPE:![0-9]+]] = distinct !DICompositeType({{.*}}flags: DIFlagTypePassByValue +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, scope: [[SCOPE]] +// CHECK-SAME: DIFlagExportSymbols | DIFlagTypePassByValue +struct A { + // Anonymous class exports its symbols into A + struct { + int y; + }; +} a; -- cgit v1.2.3