mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00

Summary: This patch adds an option to limit debug info by only emitting complete class type information when its constructor is emitted. This applies to classes that have nontrivial user defined constructors. I implemented the option by adding another level to `DebugInfoKind`, and a flag `-flimit-debug-info-constructor`. Total object file size on Windows, compiling with RelWithDebInfo: before: 4,257,448 kb after: 2,104,963 kb And on Linux before: 9,225,140 kb after: 4,387,464 kb According to the Windows clang.pdb files, here is a list of types that are no longer complete with this option enabled: https://reviews.llvm.org/P8182 Reviewers: rnk, dblaikie Subscribers: aprantl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72427
31 lines
788 B
C++
31 lines
788 B
C++
// 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: !DICompositeType(tag: DW_TAG_structure_type, name: "B"
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
|
struct B {
|
|
B();
|
|
};
|
|
void TestB() { B b; }
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "C"
|
|
// CHECK-NOT: flags: DIFlagFwdDecl
|
|
// CHECK-SAME: ){{$}}
|
|
struct C {
|
|
C() {}
|
|
};
|
|
void TestC() { C c; }
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D"
|
|
// CHECK-NOT: flags: DIFlagFwdDecl
|
|
// CHECK-SAME: ){{$}}
|
|
struct D {
|
|
D();
|
|
};
|
|
D::D() {}
|