RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544 Similar to imported declarations, the patch tracks function-local types in DISubprogram's 'retainedNodes' field. DwarfDebug is adjusted in accordance with the aforementioned metadata change and provided a support of function-local types scoped within a lexical block. The patch assumes that DICompileUnit's 'enums field' no longer tracks local types and DwarfDebug would assert if any locally-scoped types get placed there. Reviewed By: jmmartinez Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com> Differential Revision: https://reviews.llvm.org/D144006
23 lines
688 B
C++
23 lines
688 B
C++
// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -emit-llvm -o - %s -fexceptions -std=c++11 -debug-info-kind=limited | FileCheck %s
|
|
|
|
struct D {
|
|
D();
|
|
D(const D&);
|
|
int x;
|
|
int d(int x);
|
|
};
|
|
int D::d(int x) {
|
|
[=] {
|
|
return this->x;
|
|
}();
|
|
}
|
|
|
|
// CHECK: ![[D:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D",
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "this",
|
|
// CHECK-SAME: line: 11
|
|
// CHECK-SAME: baseType: ![[POINTER:[0-9]+]]
|
|
// CHECK-SAME: size: 64
|
|
// CHECK-NOT: offset: 0
|
|
// CHECK-SAME: ){{$}}
|
|
// CHECK: ![[POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[D]], size: 64)
|