Skip to content

Commit 4821508

Browse files
committed
Revert "DebugInfo: Fully integrate ctor type homing into 'limited' debug info"
Reverting to simplify some Google-internal rollout issues. Will recommit in a week or two. This reverts commit 517bbc6.
1 parent e0d0695 commit 4821508

28 files changed

+132
-61
lines changed

clang/docs/UsersManual.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,6 +2672,19 @@ below. If multiple flags are present, the last one is used.
26722672
**-fno-standalone-debug** option can be used to get to turn on the
26732673
vtable-based optimization described above.
26742674

2675+
.. option:: -fuse-ctor-homing
2676+
2677+
This optimization is similar to the optimizations that are enabled as part
2678+
of -fno-standalone-debug. Here, Clang only emits type info for a
2679+
non-trivial, non-aggregate C++ class in the modules that contain a
2680+
definition of one of its constructors. This relies on the additional
2681+
assumption that all classes that are not trivially constructible have a
2682+
non-trivial constructor that is used somewhere. The negation,
2683+
-fno-use-ctor-homing, ensures that constructor homing is not used.
2684+
2685+
This flag is not enabled by default, and needs to be used with -cc1 or
2686+
-Xclang.
2687+
26752688
.. option:: -g
26762689

26772690
Generate complete debug info.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ class CodeGenOptions : public CodeGenOptionsBase {
468468

469469
/// Check if type and variable info should be emitted.
470470
bool hasReducedDebugInfo() const {
471-
return getDebugInfo() >= codegenoptions::LimitedDebugInfo;
471+
return getDebugInfo() >= codegenoptions::DebugInfoConstructor;
472472
}
473473

474474
/// Check if maybe unused type info should be emitted.

clang/include/clang/Basic/DebugInfoOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ enum DebugInfoKind {
3434
/// (-gline-tables-only).
3535
DebugLineTablesOnly,
3636

37+
/// Limit generated debug info for classes to reduce size. This emits class
38+
/// type info only where the constructor is emitted, if it is a class that
39+
/// has a constructor.
40+
/// FIXME: Consider combining this with LimitedDebugInfo.
41+
DebugInfoConstructor,
42+
3743
/// Limit generated debug info to reduce size (-fno-standalone-debug). This
3844
/// emits forward decls for types that could be replaced with forward decls in
3945
/// the source code. For dynamic C++ classes type info is only emitted into

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5246,6 +5246,11 @@ def mrelocation_model : Separate<["-"], "mrelocation-model">,
52465246
def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
52475247
HelpText<"Disable implicit builtin knowledge of math functions">,
52485248
MarshallingInfoFlag<LangOpts<"NoMathBuiltin">>;
5249+
def fno_use_ctor_homing: Flag<["-"], "fno-use-ctor-homing">,
5250+
HelpText<"Don't use constructor homing for debug info">;
5251+
def fuse_ctor_homing: Flag<["-"], "fuse-ctor-homing">,
5252+
HelpText<"Use constructor homing if we are using limited debug info already">;
5253+
52495254
} // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
52505255

52515256
let Flags = [CC1Option, NoDriverOption] in {

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "clang/AST/RecordLayout.h"
2828
#include "clang/AST/RecursiveASTVisitor.h"
2929
#include "clang/Basic/CodeGenOptions.h"
30-
#include "clang/Basic/DebugInfoOptions.h"
3130
#include "clang/Basic/FileManager.h"
3231
#include "clang/Basic/SourceManager.h"
3332
#include "clang/Basic/Version.h"
@@ -587,6 +586,7 @@ void CGDebugInfo::CreateCompileUnit() {
587586
case codegenoptions::DebugDirectivesOnly:
588587
EmissionKind = llvm::DICompileUnit::DebugDirectivesOnly;
589588
break;
589+
case codegenoptions::DebugInfoConstructor:
590590
case codegenoptions::LimitedDebugInfo:
591591
case codegenoptions::FullDebugInfo:
592592
case codegenoptions::UnusedTypeInfo:
@@ -1861,7 +1861,7 @@ llvm::DISubprogram *CGDebugInfo::CreateCXXMemberFunction(
18611861

18621862
// In this debug mode, emit type info for a class when its constructor type
18631863
// info is emitted.
1864-
if (DebugKind == codegenoptions::LimitedDebugInfo)
1864+
if (DebugKind == codegenoptions::DebugInfoConstructor)
18651865
if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(Method))
18661866
completeUnusedClass(*CD->getParent());
18671867

@@ -2528,7 +2528,7 @@ static bool shouldOmitDefinition(codegenoptions::DebugInfoKind DebugKind,
25282528

25292529
// In constructor homing mode, only emit complete debug info for a class
25302530
// when its constructor is emitted.
2531-
if ((DebugKind == codegenoptions::LimitedDebugInfo) &&
2531+
if ((DebugKind == codegenoptions::DebugInfoConstructor) &&
25322532
canUseCtorHoming(CXXDecl))
25332533
return true;
25342534

@@ -3349,7 +3349,7 @@ void CGDebugInfo::completeTemplateDefinition(
33493349
}
33503350

33513351
void CGDebugInfo::completeUnusedClass(const CXXRecordDecl &D) {
3352-
if (DebugKind <= codegenoptions::DebugLineTablesOnly || D.isDynamicClass())
3352+
if (DebugKind <= codegenoptions::DebugLineTablesOnly)
33533353
return;
33543354

33553355
completeClassData(&D);

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "clang/Basic/CLWarnings.h"
2727
#include "clang/Basic/CharInfo.h"
2828
#include "clang/Basic/CodeGenOptions.h"
29-
#include "clang/Basic/DebugInfoOptions.h"
3029
#include "clang/Basic/LangOptions.h"
3130
#include "clang/Basic/ObjCRuntime.h"
3231
#include "clang/Basic/Version.h"
@@ -526,7 +525,7 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoKind(const Arg &A) {
526525
return codegenoptions::DebugLineTablesOnly;
527526
if (A.getOption().matches(options::OPT_gline_directives_only))
528527
return codegenoptions::DebugDirectivesOnly;
529-
return codegenoptions::LimitedDebugInfo;
528+
return codegenoptions::DebugInfoConstructor;
530529
}
531530

532531
static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) {
@@ -1087,6 +1086,9 @@ static void RenderDebugEnablingArgs(const ArgList &Args, ArgStringList &CmdArgs,
10871086
case codegenoptions::DebugLineTablesOnly:
10881087
CmdArgs.push_back("-debug-info-kind=line-tables-only");
10891088
break;
1089+
case codegenoptions::DebugInfoConstructor:
1090+
CmdArgs.push_back("-debug-info-kind=constructor");
1091+
break;
10901092
case codegenoptions::LimitedDebugInfo:
10911093
CmdArgs.push_back("-debug-info-kind=limited");
10921094
break;
@@ -2668,7 +2670,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
26682670
CmdArgs.push_back(Value.data());
26692671
} else {
26702672
RenderDebugEnablingArgs(Args, CmdArgs,
2671-
codegenoptions::LimitedDebugInfo,
2673+
codegenoptions::DebugInfoConstructor,
26722674
DwarfVersion, llvm::DebuggerKind::Default);
26732675
}
26742676
} else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") ||
@@ -4094,7 +4096,7 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
40944096
}
40954097
}
40964098
if (const Arg *A = Args.getLastArg(options::OPT_g_Group)) {
4097-
DebugInfoKind = codegenoptions::LimitedDebugInfo;
4099+
DebugInfoKind = codegenoptions::DebugInfoConstructor;
40984100

40994101
// If the last option explicitly specified a debug-info level, use it.
41004102
if (checkDebugInfoOption(A, Args, D, TC) &&
@@ -4216,7 +4218,7 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
42164218
if (checkDebugInfoOption(A, Args, D, TC)) {
42174219
if (DebugInfoKind != codegenoptions::DebugLineTablesOnly &&
42184220
DebugInfoKind != codegenoptions::DebugDirectivesOnly) {
4219-
DebugInfoKind = codegenoptions::LimitedDebugInfo;
4221+
DebugInfoKind = codegenoptions::DebugInfoConstructor;
42204222
CmdArgs.push_back("-dwarf-ext-refs");
42214223
CmdArgs.push_back("-fmodule-format=obj");
42224224
}
@@ -4237,7 +4239,8 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
42374239
if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug))
42384240
(void)checkDebugInfoOption(A, Args, D, TC);
42394241

4240-
if (DebugInfoKind == codegenoptions::LimitedDebugInfo) {
4242+
if (DebugInfoKind == codegenoptions::LimitedDebugInfo ||
4243+
DebugInfoKind == codegenoptions::DebugInfoConstructor) {
42414244
if (Args.hasFlag(options::OPT_fno_eliminate_unused_debug_types,
42424245
options::OPT_feliminate_unused_debug_types, false))
42434246
DebugInfoKind = codegenoptions::UnusedTypeInfo;
@@ -5435,7 +5438,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54355438
// This controls whether or not we perform JustMyCode instrumentation.
54365439
if (Args.hasFlag(options::OPT_fjmc, options::OPT_fno_jmc, false)) {
54375440
if (TC.getTriple().isOSBinFormatELF()) {
5438-
if (DebugInfoKind >= codegenoptions::LimitedDebugInfo)
5441+
if (DebugInfoKind >= codegenoptions::DebugInfoConstructor)
54395442
CmdArgs.push_back("-fjmc");
54405443
else
54415444
D.Diag(clang::diag::warn_drv_jmc_requires_debuginfo) << "-fjmc"
@@ -7562,7 +7565,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
75627565
options::OPT_gline_tables_only)) {
75637566
*EmitCodeView = true;
75647567
if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7))
7565-
*DebugInfoKind = codegenoptions::LimitedDebugInfo;
7568+
*DebugInfoKind = codegenoptions::DebugInfoConstructor;
75667569
else
75677570
*DebugInfoKind = codegenoptions::DebugLineTablesOnly;
75687571
} else {
@@ -7574,7 +7577,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
75747577
// This controls whether or not we perform JustMyCode instrumentation.
75757578
if (Args.hasFlag(options::OPT__SLASH_JMC, options::OPT__SLASH_JMC_,
75767579
/*Default=*/false)) {
7577-
if (*EmitCodeView && *DebugInfoKind >= codegenoptions::LimitedDebugInfo)
7580+
if (*EmitCodeView && *DebugInfoKind >= codegenoptions::DebugInfoConstructor)
75787581
CmdArgs.push_back("-fjmc");
75797582
else
75807583
D.Diag(clang::diag::warn_drv_jmc_requires_debuginfo) << "/JMC"
@@ -7899,7 +7902,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
78997902
// the guard for source type, however there is a test which asserts
79007903
// that some assembler invocation receives no -debug-info-kind,
79017904
// and it's not clear whether that test is just overly restrictive.
7902-
DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo
7905+
DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor
79037906
: codegenoptions::NoDebugInfo);
79047907

79057908
addDebugPrefixMapArg(getToolChain().getDriver(), getToolChain(), Args,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,9 @@ void CompilerInvocation::GenerateCodeGenArgs(
13601360
case codegenoptions::DebugDirectivesOnly:
13611361
DebugInfoVal = "line-directives-only";
13621362
break;
1363+
case codegenoptions::DebugInfoConstructor:
1364+
DebugInfoVal = "constructor";
1365+
break;
13631366
case codegenoptions::LimitedDebugInfo:
13641367
DebugInfoVal = "limited";
13651368
break;
@@ -1634,6 +1637,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
16341637
llvm::StringSwitch<unsigned>(A->getValue())
16351638
.Case("line-tables-only", codegenoptions::DebugLineTablesOnly)
16361639
.Case("line-directives-only", codegenoptions::DebugDirectivesOnly)
1640+
.Case("constructor", codegenoptions::DebugInfoConstructor)
16371641
.Case("limited", codegenoptions::LimitedDebugInfo)
16381642
.Case("standalone", codegenoptions::FullDebugInfo)
16391643
.Case("unused-types", codegenoptions::UnusedTypeInfo)
@@ -1645,6 +1649,18 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
16451649
Opts.setDebugInfo(static_cast<codegenoptions::DebugInfoKind>(Val));
16461650
}
16471651

1652+
// If -fuse-ctor-homing is set and limited debug info is already on, then use
1653+
// constructor homing, and vice versa for -fno-use-ctor-homing.
1654+
if (const Arg *A =
1655+
Args.getLastArg(OPT_fuse_ctor_homing, OPT_fno_use_ctor_homing)) {
1656+
if (A->getOption().matches(OPT_fuse_ctor_homing) &&
1657+
Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo)
1658+
Opts.setDebugInfo(codegenoptions::DebugInfoConstructor);
1659+
if (A->getOption().matches(OPT_fno_use_ctor_homing) &&
1660+
Opts.getDebugInfo() == codegenoptions::DebugInfoConstructor)
1661+
Opts.setDebugInfo(codegenoptions::LimitedDebugInfo);
1662+
}
1663+
16481664
for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) {
16491665
auto Split = StringRef(Arg).split('=');
16501666
Opts.DebugPrefixMap.insert(

clang/test/CodeGen/attr-cpuspecific-renaming.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-linux-gnu -emit-llvm -o - -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,LIN
2-
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-pc -emit-llvm -o - -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,WIN
1+
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-linux-gnu -emit-llvm -o - -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,LIN
2+
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-pc -emit-llvm -o - -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb %s | FileCheck %s --check-prefixes=CHECK,WIN
33

44
// LIN: @[[S1_NAME:.+]].ifunc = weak_odr ifunc void (%struct.S1*), void (%struct.S1*)* ()* @[[S1_NAME]].resolver
55
// LIN: @[[S2_NAME:.+]].ifunc = weak_odr ifunc void (%struct.S2*), void (%struct.S2*)* ()* @[[S2_NAME]].resolver

clang/test/CodeGen/pr52782-stdcall-func-decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple i686-w64-windows-gnu -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
1+
// RUN: %clang_cc1 -triple i686-w64-windows-gnu -o - -emit-llvm -debug-info-kind=constructor %s | FileCheck %s
22

33
enum nsresult {};
44

clang/test/CodeGenCXX/debug-info-class.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ struct D {
3232
};
3333

3434
struct E {
35+
E();
3536
virtual ~E();
3637
virtual void func() {
3738
}
3839
};
3940

4041
struct F {
41-
struct F_inner {
42+
struct inner {
4243
};
4344
static const int i = 2;
4445
virtual ~F();
4546
};
4647

4748
struct G {
4849
virtual void func();
49-
struct G_inner {
50+
struct inner {
5051
int j;
5152
};
5253
};
@@ -82,7 +83,7 @@ void f1() {
8283
x.func();
8384
E y;
8485
int i = F::i;
85-
F::F_inner z;
86+
F::inner z;
8687
K k;
8788
k.func();
8889
L l;
@@ -91,7 +92,7 @@ void f1() {
9192

9293
int main(int argc, char **argv) {
9394
B b;
94-
G::G_inner c_i;
95+
G::inner c_i;
9596
if (argc) {
9697
A a;
9798
}
@@ -115,13 +116,11 @@ int main(int argc, char **argv) {
115116
// CHECK-SAME: DIFlagFwdDecl
116117
// CHECK-NOT: identifier:
117118
// CHECK-SAME: ){{$}}
118-
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
119-
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
120-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
121119
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
122120
// CHECK-NOT: DIFlagFwdDecl
123121
// CHECK-SAME: ){{$}}
124122

123+
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
125124
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
126125
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "bar"
127126
// CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "baz"
@@ -174,10 +173,10 @@ int main(int argc, char **argv) {
174173
// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
175174
// CHECK-SAME: declaration: [[L_FUNC_DECL]]
176175

177-
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "G_inner",
176+
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "inner",{{.*}} line: 50
178177
// CHECK-NOT: DIFlagFwdDecl
179178
// CHECK-SAME: elements: [[G_INNER_MEM:![0-9]*]]
180-
// CHECK-SAME: identifier: "_ZTSN1G7G_innerE"
179+
// CHECK-SAME: identifier: "_ZTSN1G5innerE"
181180

182181
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "G"
183182
// CHECK-SAME: DIFlagFwdDecl
@@ -187,6 +186,8 @@ int main(int argc, char **argv) {
187186
// CHECK: [[G_INNER_I]] = !DIDerivedType(tag: DW_TAG_member, name: "j"
188187
// CHECK-SAME: baseType: ![[INT]]
189188

189+
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
190+
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
190191
//
191-
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 99,
192-
// CHECK: ![[RETLOC]] = !DILocation(line: 98,
192+
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 100,
193+
// CHECK: ![[RETLOC]] = !DILocation(line: 99,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %clang_cc1 -debug-info-kind=constructor -emit-llvm %s -o - \
2+
// RUN: | FileCheck %s -check-prefix=CTOR_HOMING
3+
// RUN: %clang_cc1 -debug-info-kind=limited -fuse-ctor-homing -emit-llvm %s -o - \
4+
// RUN: | FileCheck %s -check-prefix=CTOR_HOMING
5+
// RUN: %clang_cc1 -debug-info-kind=standalone -fuse-ctor-homing -emit-llvm %s -o - \
6+
// RUN: | FileCheck %s -check-prefix=FULL_DEBUG
7+
// RUN: %clang_cc1 -debug-info-kind=line-tables-only -fuse-ctor-homing -emit-llvm %s -o - \
8+
// RUN: | FileCheck %s -check-prefix=NO_DEBUG
9+
// RUN: %clang_cc1 -fuse-ctor-homing -emit-llvm %s -o - \
10+
// RUN: | FileCheck %s -check-prefix=NO_DEBUG
11+
//
12+
// RUN: %clang_cc1 -debug-info-kind=constructor -fno-use-ctor-homing \
13+
// RUN: -emit-llvm %s -o - | FileCheck %s -check-prefix=FULL_DEBUG
14+
15+
// This tests that the -fuse-ctor-homing is only used if limited debug info would have
16+
// been used otherwise.
17+
18+
// CTOR_HOMING: !DICompositeType(tag: DW_TAG_structure_type, name: "A"{{.*}}flags: DIFlagFwdDecl
19+
// FULL_DEBUG: !DICompositeType(tag: DW_TAG_structure_type, name: "A"{{.*}}DIFlagTypePassByValue
20+
// NO_DEBUG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
21+
struct A {
22+
A();
23+
} TestA;

clang/test/CodeGenCXX/debug-info-limited-ctor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -debug-info-kind=constructor -emit-llvm %s -o - | FileCheck %s
22

33
// CHECK-DAG: !DICompositeType(tag: DW_TAG_structure_type, name: "A"{{.*}}DIFlagTypePassByValue
44
struct A {

clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=limited %s -o - | FileCheck %s
22

3+
// Make sure this still works with constructor homing.
4+
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=constructor %s -o - | FileCheck %s
5+
36
// Run again with -gline-tables-only or -gline-directives-only and verify we don't crash. We won't output
47
// type info at all.
58
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s -check-prefix LINES-ONLY

clang/test/CodeGenCXX/debug-lambda-this.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int D::d(int x) {
1212
}();
1313
}
1414

15-
// CHECK: ![[D:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "D",
15+
// CHECK: ![[D:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D",
1616
// CHECK: ![[POINTER:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[D]], size: 64)
1717
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "this",
1818
// CHECK-SAME: line: 11

clang/test/CodeGenCXX/ibm128-declarations.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,5 @@ int main(void) {
174174
// CHECK: ret void
175175
// CHECK: }
176176

177-
// CHECK: [[GF_TYPE:!.*]] = !DIBasicType(name: "__ibm128", size: 128, encoding: DW_ATE_float)
178-
// CHECK: = distinct !DIGlobalVariable(name: "gf",
179-
// CHECK-SAME: type: [[GF_TYPE]],
180-
// CHECK-SAME: isDefinition: true)
177+
// CHECK: !6 = distinct !DIGlobalVariable(name: "gf", scope: !2, file: !7, line: {{[0-9]+}}, type: !8, isLocal: false, isDefinition: true)
178+
// CHECK: !8 = !DIBasicType(name: "__ibm128", size: 128, encoding: DW_ATE_float)

clang/test/CodeGenCXX/standalone-debug-attribute.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// RUN: %clang_cc1 -DSETATTR=0 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=DEBUG
2-
// RUN: %clang_cc1 -DSETATTR=1 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=WITHATTR
1+
// RUN: %clang_cc1 -DSETATTR=0 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=DEBUG
2+
// RUN: %clang_cc1 -DSETATTR=1 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=WITHATTR
3+
// Use -debug-info-kind=constructor because it includes all the optimizations.
34

45
#if SETATTR
56
#define STANDALONEDEBUGATTR __attribute__((standalone_debug))

0 commit comments

Comments
 (0)