Skip to content

Commit 517bbc6

Browse files
committed
DebugInfo: Fully integrate ctor type homing into 'limited' debug info
Simplify debug info back to just "limited" or "full" by rolling the ctor type homing fully into the "limited" debug info. Also fix a bug I found along the way that was causing ctor type homing to kick in even when something could be vtable homed (where vtable homing is stronger/more effective than ctor homing) - fixing at the same time as it keeps the tests (that were testing only "limited non ctor" homing and now test ctor homing) passing.
1 parent 77f72ac commit 517bbc6

28 files changed

+61
-132
lines changed

clang/docs/UsersManual.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,19 +2672,6 @@ 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-
26882675
.. option:: -g
26892676

26902677
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::DebugInfoConstructor;
471+
return getDebugInfo() >= codegenoptions::LimitedDebugInfo;
472472
}
473473

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

clang/include/clang/Basic/DebugInfoOptions.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ 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-
4337
/// Limit generated debug info to reduce size (-fno-standalone-debug). This
4438
/// emits forward decls for types that could be replaced with forward decls in
4539
/// the source code. For dynamic C++ classes type info is only emitted into

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5234,11 +5234,6 @@ def mrelocation_model : Separate<["-"], "mrelocation-model">,
52345234
def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
52355235
HelpText<"Disable implicit builtin knowledge of math functions">,
52365236
MarshallingInfoFlag<LangOpts<"NoMathBuiltin">>;
5237-
def fno_use_ctor_homing: Flag<["-"], "fno-use-ctor-homing">,
5238-
HelpText<"Don't use constructor homing for debug info">;
5239-
def fuse_ctor_homing: Flag<["-"], "fuse-ctor-homing">,
5240-
HelpText<"Use constructor homing if we are using limited debug info already">;
5241-
52425237
} // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
52435238

52445239
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,6 +27,7 @@
2727
#include "clang/AST/RecordLayout.h"
2828
#include "clang/AST/RecursiveASTVisitor.h"
2929
#include "clang/Basic/CodeGenOptions.h"
30+
#include "clang/Basic/DebugInfoOptions.h"
3031
#include "clang/Basic/FileManager.h"
3132
#include "clang/Basic/SourceManager.h"
3233
#include "clang/Basic/Version.h"
@@ -586,7 +587,6 @@ void CGDebugInfo::CreateCompileUnit() {
586587
case codegenoptions::DebugDirectivesOnly:
587588
EmissionKind = llvm::DICompileUnit::DebugDirectivesOnly;
588589
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::DebugInfoConstructor)
1864+
if (DebugKind == codegenoptions::LimitedDebugInfo)
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::DebugInfoConstructor) &&
2531+
if ((DebugKind == codegenoptions::LimitedDebugInfo) &&
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)
3352+
if (DebugKind <= codegenoptions::DebugLineTablesOnly || D.isDynamicClass())
33533353
return;
33543354

33553355
completeClassData(&D);

clang/lib/Driver/ToolChains/Clang.cpp

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

531532
static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) {
@@ -1086,9 +1087,6 @@ static void RenderDebugEnablingArgs(const ArgList &Args, ArgStringList &CmdArgs,
10861087
case codegenoptions::DebugLineTablesOnly:
10871088
CmdArgs.push_back("-debug-info-kind=line-tables-only");
10881089
break;
1089-
case codegenoptions::DebugInfoConstructor:
1090-
CmdArgs.push_back("-debug-info-kind=constructor");
1091-
break;
10921090
case codegenoptions::LimitedDebugInfo:
10931091
CmdArgs.push_back("-debug-info-kind=limited");
10941092
break;
@@ -2670,7 +2668,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
26702668
CmdArgs.push_back(Value.data());
26712669
} else {
26722670
RenderDebugEnablingArgs(Args, CmdArgs,
2673-
codegenoptions::DebugInfoConstructor,
2671+
codegenoptions::LimitedDebugInfo,
26742672
DwarfVersion, llvm::DebuggerKind::Default);
26752673
}
26762674
} else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") ||
@@ -4096,7 +4094,7 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
40964094
}
40974095
}
40984096
if (const Arg *A = Args.getLastArg(options::OPT_g_Group)) {
4099-
DebugInfoKind = codegenoptions::DebugInfoConstructor;
4097+
DebugInfoKind = codegenoptions::LimitedDebugInfo;
41004098

41014099
// If the last option explicitly specified a debug-info level, use it.
41024100
if (checkDebugInfoOption(A, Args, D, TC) &&
@@ -4218,7 +4216,7 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
42184216
if (checkDebugInfoOption(A, Args, D, TC)) {
42194217
if (DebugInfoKind != codegenoptions::DebugLineTablesOnly &&
42204218
DebugInfoKind != codegenoptions::DebugDirectivesOnly) {
4221-
DebugInfoKind = codegenoptions::DebugInfoConstructor;
4219+
DebugInfoKind = codegenoptions::LimitedDebugInfo;
42224220
CmdArgs.push_back("-dwarf-ext-refs");
42234221
CmdArgs.push_back("-fmodule-format=obj");
42244222
}
@@ -4239,8 +4237,7 @@ static void renderDebugOptions(const ToolChain &TC, const Driver &D,
42394237
if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug))
42404238
(void)checkDebugInfoOption(A, Args, D, TC);
42414239

4242-
if (DebugInfoKind == codegenoptions::LimitedDebugInfo ||
4243-
DebugInfoKind == codegenoptions::DebugInfoConstructor) {
4240+
if (DebugInfoKind == codegenoptions::LimitedDebugInfo) {
42444241
if (Args.hasFlag(options::OPT_fno_eliminate_unused_debug_types,
42454242
options::OPT_feliminate_unused_debug_types, false))
42464243
DebugInfoKind = codegenoptions::UnusedTypeInfo;
@@ -5438,7 +5435,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54385435
// This controls whether or not we perform JustMyCode instrumentation.
54395436
if (Args.hasFlag(options::OPT_fjmc, options::OPT_fno_jmc, false)) {
54405437
if (TC.getTriple().isOSBinFormatELF()) {
5441-
if (DebugInfoKind >= codegenoptions::DebugInfoConstructor)
5438+
if (DebugInfoKind >= codegenoptions::LimitedDebugInfo)
54425439
CmdArgs.push_back("-fjmc");
54435440
else
54445441
D.Diag(clang::diag::warn_drv_jmc_requires_debuginfo) << "-fjmc"
@@ -7561,7 +7558,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
75617558
options::OPT_gline_tables_only)) {
75627559
*EmitCodeView = true;
75637560
if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7))
7564-
*DebugInfoKind = codegenoptions::DebugInfoConstructor;
7561+
*DebugInfoKind = codegenoptions::LimitedDebugInfo;
75657562
else
75667563
*DebugInfoKind = codegenoptions::DebugLineTablesOnly;
75677564
} else {
@@ -7573,7 +7570,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
75737570
// This controls whether or not we perform JustMyCode instrumentation.
75747571
if (Args.hasFlag(options::OPT__SLASH_JMC, options::OPT__SLASH_JMC_,
75757572
/*Default=*/false)) {
7576-
if (*EmitCodeView && *DebugInfoKind >= codegenoptions::DebugInfoConstructor)
7573+
if (*EmitCodeView && *DebugInfoKind >= codegenoptions::LimitedDebugInfo)
75777574
CmdArgs.push_back("-fjmc");
75787575
else
75797576
D.Diag(clang::diag::warn_drv_jmc_requires_debuginfo) << "/JMC"
@@ -7898,7 +7895,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
78987895
// the guard for source type, however there is a test which asserts
78997896
// that some assembler invocation receives no -debug-info-kind,
79007897
// and it's not clear whether that test is just overly restrictive.
7901-
DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor
7898+
DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo
79027899
: codegenoptions::NoDebugInfo);
79037900

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

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,9 +1360,6 @@ void CompilerInvocation::GenerateCodeGenArgs(
13601360
case codegenoptions::DebugDirectivesOnly:
13611361
DebugInfoVal = "line-directives-only";
13621362
break;
1363-
case codegenoptions::DebugInfoConstructor:
1364-
DebugInfoVal = "constructor";
1365-
break;
13661363
case codegenoptions::LimitedDebugInfo:
13671364
DebugInfoVal = "limited";
13681365
break;
@@ -1637,7 +1634,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
16371634
llvm::StringSwitch<unsigned>(A->getValue())
16381635
.Case("line-tables-only", codegenoptions::DebugLineTablesOnly)
16391636
.Case("line-directives-only", codegenoptions::DebugDirectivesOnly)
1640-
.Case("constructor", codegenoptions::DebugInfoConstructor)
16411637
.Case("limited", codegenoptions::LimitedDebugInfo)
16421638
.Case("standalone", codegenoptions::FullDebugInfo)
16431639
.Case("unused-types", codegenoptions::UnusedTypeInfo)
@@ -1649,18 +1645,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
16491645
Opts.setDebugInfo(static_cast<codegenoptions::DebugInfoKind>(Val));
16501646
}
16511647

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-
16641648
for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) {
16651649
auto Split = StringRef(Arg).split('=');
16661650
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=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
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
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=constructor %s | FileCheck %s
1+
// RUN: %clang_cc1 -triple i686-w64-windows-gnu -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
22

33
enum nsresult {};
44

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

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

3434
struct E {
35-
E();
3635
virtual ~E();
3736
virtual void func() {
3837
}
3938
};
4039

4140
struct F {
42-
struct inner {
41+
struct F_inner {
4342
};
4443
static const int i = 2;
4544
virtual ~F();
4645
};
4746

4847
struct G {
4948
virtual void func();
50-
struct inner {
49+
struct G_inner {
5150
int j;
5251
};
5352
};
@@ -83,7 +82,7 @@ void f1() {
8382
x.func();
8483
E y;
8584
int i = F::i;
86-
F::inner z;
85+
F::F_inner z;
8786
K k;
8887
k.func();
8988
L l;
@@ -92,7 +91,7 @@ void f1() {
9291

9392
int main(int argc, char **argv) {
9493
B b;
95-
G::inner c_i;
94+
G::G_inner c_i;
9695
if (argc) {
9796
A a;
9897
}
@@ -116,11 +115,13 @@ int main(int argc, char **argv) {
116115
// CHECK-SAME: DIFlagFwdDecl
117116
// CHECK-NOT: identifier:
118117
// 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"
119121
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "I"
120122
// CHECK-NOT: DIFlagFwdDecl
121123
// CHECK-SAME: ){{$}}
122124

123-
// CHECK: ![[INT:[0-9]+]] = !DIBasicType(name: "int"
124125
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
125126
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "bar"
126127
// CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "baz"
@@ -173,10 +174,10 @@ int main(int argc, char **argv) {
173174
// CHECK-SAME: DISPFlagLocalToUnit | DISPFlagDefinition
174175
// CHECK-SAME: declaration: [[L_FUNC_DECL]]
175176

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

181182
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "G"
182183
// CHECK-SAME: DIFlagFwdDecl
@@ -186,8 +187,6 @@ int main(int argc, char **argv) {
186187
// CHECK: [[G_INNER_I]] = !DIDerivedType(tag: DW_TAG_member, name: "j"
187188
// CHECK-SAME: baseType: ![[INT]]
188189

189-
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "A"
190-
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "HdrSize"
191190
//
192-
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 100,
193-
// CHECK: ![[RETLOC]] = !DILocation(line: 99,
191+
// CHECK: ![[EXCEPTLOC]] = !DILocation(line: 99,
192+
// CHECK: ![[RETLOC]] = !DILocation(line: 98,

clang/test/CodeGenCXX/debug-info-ctor-homing-flag.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

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=constructor -emit-llvm %s -o - | FileCheck %s
1+
// RUN: %clang_cc1 -debug-info-kind=limited -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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
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-
63
// Run again with -gline-tables-only or -gline-directives-only and verify we don't crash. We won't output
74
// type info at all.
85
// 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]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D",
15+
// CHECK: ![[D:[0-9]+]] = !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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,7 @@ int main(void) {
174174
// CHECK: ret void
175175
// CHECK: }
176176

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)
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)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
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.
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
43

54
#if SETATTR
65
#define STANDALONEDEBUGATTR __attribute__((standalone_debug))

0 commit comments

Comments
 (0)