This revision was automatically updated to reflect the committed changes.
Closed by commit rG11a04a64aaa3: [DebugInfo] Change to constructor homing debug
info mode: skip literal types (authored by akhuang).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77432/new/
https://reviews.llvm.org/D77432
Files:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
Index: clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
+++ clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
@@ -1,30 +1,26 @@
// RUN: %clang -cc1 -debug-info-kind=constructor -emit-llvm %s -o - |
FileCheck %s
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
-// CHECK-NOT: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
-struct A {};
-void TestA() { A a; }
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name:
"A"{{.*}}DIFlagTypePassByValue
+struct A {
+} TestA;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "B"
-// CHECK-SAME: flags: DIFlagFwdDecl
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name:
"B"{{.*}}flags: DIFlagFwdDecl
struct B {
B();
-};
-void TestB() { B b; }
+} TestB;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "C"
-// CHECK-NOT: flags: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name:
"C"{{.*}}DIFlagTypePassByValue
struct C {
C() {}
-};
-void TestC() { C c; }
+} TestC;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D"
-// CHECK-NOT: flags: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name:
"D"{{.*}}DIFlagTypePassByValue
struct D {
D();
};
D::D() {}
+
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name:
"E"{{.*}}DIFlagTypePassByValue
+struct E {
+ constexpr E(){};
+} TestE;
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2261,12 +2261,11 @@
// constructor is emitted. Skip this optimization if the class or any of
// its methods are marked dllimport.
if (DebugKind == codegenoptions::DebugInfoConstructor &&
- !CXXDecl->isLambda() && !isClassOrMethodDLLImport(CXXDecl)) {
- for (const auto *Ctor : CXXDecl->ctors()) {
+ !CXXDecl->isLambda() && !CXXDecl->hasConstexprNonCopyMoveConstructor() &&
+ !isClassOrMethodDLLImport(CXXDecl))
+ for (const auto *Ctor : CXXDecl->ctors())
if (Ctor->isUserProvided())
return true;
- }
- }
TemplateSpecializationKind Spec = TSK_Undeclared;
if (const auto *SD = dyn_cast<ClassTemplateSpecializationDecl>(RD))
Index: clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
+++ clang/test/CodeGenCXX/debug-info-limited-ctor.cpp
@@ -1,30 +1,26 @@
// RUN: %clang -cc1 -debug-info-kind=constructor -emit-llvm %s -o - | FileCheck %s
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
-// CHECK-NOT: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
-struct A {};
-void TestA() { A a; }
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "A"{{.*}}DIFlagTypePassByValue
+struct A {
+} TestA;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "B"
-// CHECK-SAME: flags: DIFlagFwdDecl
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "B"{{.*}}flags: DIFlagFwdDecl
struct B {
B();
-};
-void TestB() { B b; }
+} TestB;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "C"
-// CHECK-NOT: flags: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "C"{{.*}}DIFlagTypePassByValue
struct C {
C() {}
-};
-void TestC() { C c; }
+} TestC;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D"
-// CHECK-NOT: flags: DIFlagFwdDecl
-// CHECK-SAME: ){{$}}
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "D"{{.*}}DIFlagTypePassByValue
struct D {
D();
};
D::D() {}
+
+// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "E"{{.*}}DIFlagTypePassByValue
+struct E {
+ constexpr E(){};
+} TestE;
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2261,12 +2261,11 @@
// constructor is emitted. Skip this optimization if the class or any of
// its methods are marked dllimport.
if (DebugKind == codegenoptions::DebugInfoConstructor &&
- !CXXDecl->isLambda() && !isClassOrMethodDLLImport(CXXDecl)) {
- for (const auto *Ctor : CXXDecl->ctors()) {
+ !CXXDecl->isLambda() && !CXXDecl->hasConstexprNonCopyMoveConstructor() &&
+ !isClassOrMethodDLLImport(CXXDecl))
+ for (const auto *Ctor : CXXDecl->ctors())
if (Ctor->isUserProvided())
return true;
- }
- }
TemplateSpecializationKind Spec = TSK_Undeclared;
if (const auto *SD = dyn_cast<ClassTemplateSpecializationDecl>(RD))
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits