Skip to content

Commit 394db22

Browse files
committed
Revert "Switch to using -debug-info-kind=constructor as default (from =limited)"
This reverts commit 227db86. Causing debug info errors in google3 LTO builds; also causes a debuginfo-test failure.
1 parent 4c9af6d commit 394db22

File tree

11 files changed

+29
-32
lines changed

11 files changed

+29
-32
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoKind(const Arg &A) {
498498
return codegenoptions::DebugLineTablesOnly;
499499
if (A.getOption().matches(options::OPT_gline_directives_only))
500500
return codegenoptions::DebugDirectivesOnly;
501-
return codegenoptions::DebugInfoConstructor;
501+
return codegenoptions::LimitedDebugInfo;
502502
}
503503

504504
static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) {
@@ -2383,7 +2383,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
23832383
CmdArgs.push_back(Value.data());
23842384
} else {
23852385
RenderDebugEnablingArgs(Args, CmdArgs,
2386-
codegenoptions::DebugInfoConstructor,
2386+
codegenoptions::LimitedDebugInfo,
23872387
DwarfVersion, llvm::DebuggerKind::Default);
23882388
}
23892389
} else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") ||
@@ -3656,7 +3656,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
36563656
if (const Arg *A =
36573657
Args.getLastArg(options::OPT_g_Group, options::OPT_gsplit_dwarf,
36583658
options::OPT_gsplit_dwarf_EQ)) {
3659-
DebugInfoKind = codegenoptions::DebugInfoConstructor;
3659+
DebugInfoKind = codegenoptions::LimitedDebugInfo;
36603660

36613661
// If the last option explicitly specified a debug-info level, use it.
36623662
if (checkDebugInfoOption(A, Args, D, TC) &&
@@ -3761,7 +3761,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
37613761
if (checkDebugInfoOption(A, Args, D, TC)) {
37623762
if (DebugInfoKind != codegenoptions::DebugLineTablesOnly &&
37633763
DebugInfoKind != codegenoptions::DebugDirectivesOnly) {
3764-
DebugInfoKind = codegenoptions::DebugInfoConstructor;
3764+
DebugInfoKind = codegenoptions::LimitedDebugInfo;
37653765
CmdArgs.push_back("-dwarf-ext-refs");
37663766
CmdArgs.push_back("-fmodule-format=obj");
37673767
}
@@ -3781,9 +3781,7 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
37813781
TC.GetDefaultStandaloneDebug());
37823782
if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug))
37833783
(void)checkDebugInfoOption(A, Args, D, TC);
3784-
if ((DebugInfoKind == codegenoptions::LimitedDebugInfo ||
3785-
DebugInfoKind == codegenoptions::DebugInfoConstructor) &&
3786-
NeedFullDebug)
3784+
if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug)
37873785
DebugInfoKind = codegenoptions::FullDebugInfo;
37883786

37893787
if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source,
@@ -6569,7 +6567,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
65696567
options::OPT_gline_tables_only)) {
65706568
*EmitCodeView = true;
65716569
if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7))
6572-
*DebugInfoKind = codegenoptions::DebugInfoConstructor;
6570+
*DebugInfoKind = codegenoptions::LimitedDebugInfo;
65736571
else
65746572
*DebugInfoKind = codegenoptions::DebugLineTablesOnly;
65756573
} else {
@@ -6866,7 +6864,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
68666864
// the guard for source type, however there is a test which asserts
68676865
// that some assembler invocation receives no -debug-info-kind,
68686866
// and it's not clear whether that test is just overly restrictive.
6869-
DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor
6867+
DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo
68706868
: codegenoptions::NoDebugInfo);
68716869
// Add the -fdebug-compilation-dir flag if needed.
68726870
addDebugCompDirArg(Args, CmdArgs, C.getDriver().getVFS());

clang/test/Driver/cl-options.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,11 @@
524524

525525
// RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s
526526
// Zi: "-gcodeview"
527-
// Zi: "-debug-info-kind=constructor"
527+
// Zi: "-debug-info-kind=limited"
528528

529529
// RUN: %clang_cl /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7 %s
530530
// Z7: "-gcodeview"
531-
// Z7: "-debug-info-kind=constructor"
531+
// Z7: "-debug-info-kind=limited"
532532

533533
// RUN: %clang_cl /Zd /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7GMLT %s
534534
// Z7GMLT: "-gcodeview"
@@ -557,7 +557,7 @@
557557
// which made it "win". This test could not detect that bug.
558558
// RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s
559559
// Z7_gdwarf: "-gcodeview"
560-
// Z7_gdwarf: "-debug-info-kind=constructor"
560+
// Z7_gdwarf: "-debug-info-kind=limited"
561561
// Z7_gdwarf: "-dwarf-version=4"
562562

563563
// RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s

clang/test/Driver/clang-g-opts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
3232

3333
// CHECK-WITHOUT-G-NOT: -debug-info-kind
34-
// CHECK-WITH-G: "-debug-info-kind=constructor"
34+
// CHECK-WITH-G: "-debug-info-kind=limited"
3535
// CHECK-WITH-G: "-dwarf-version=4"
3636
// CHECK-WITH-G-DWARF2: "-dwarf-version=2"
3737

clang/test/Driver/cuda-dwarf-2.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
// HAS_DEBUG-NOT: warning: debug
5151
// HAS_DEBUG: "-fcuda-is-device"
52-
// HAS_DEBUG-SAME: "-debug-info-kind={{constructor|line-tables-only}}"
52+
// HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}"
5353
// HAS_DEBUG-SAME: "-dwarf-version=2"
5454
// HAS_DEBUG: ptxas
5555
// HAS_DEBUG-SAME: "-g"

clang/test/Driver/debug-options-as.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// RUN: | FileCheck %s
2424
//
2525
// CHECK: "-cc1as"
26-
// CHECK: "-debug-info-kind=constructor"
26+
// CHECK: "-debug-info-kind=limited"
2727

2828
// Check to make sure clang with -g on a .s file gets passed -dwarf-debug-producer.
2929
// rdar://12955296

clang/test/Driver/debug-options.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,18 @@
274274
// GLIO_ONLY_DWARF2: "-dwarf-version=2"
275275
//
276276
// G_ONLY: "-cc1"
277-
// G_ONLY: "-debug-info-kind=constructor"
277+
// G_ONLY: "-debug-info-kind=limited"
278278
//
279279
// These tests assert that "-gline-tables-only" "-g" uses the latter,
280280
// but otherwise not caring about the DebugInfoKind.
281281
// G_ONLY_DWARF2: "-cc1"
282-
// G_ONLY_DWARF2: "-debug-info-kind={{standalone|constructor}}"
282+
// G_ONLY_DWARF2: "-debug-info-kind={{standalone|limited}}"
283283
// G_ONLY_DWARF2: "-dwarf-version=2"
284284
//
285285
// G_STANDALONE: "-cc1"
286286
// G_STANDALONE: "-debug-info-kind=standalone"
287287
// G_LIMITED: "-cc1"
288-
// G_LIMITED: "-debug-info-kind=constructor"
288+
// G_LIMITED: "-debug-info-kind=limited"
289289
// G_DWARF2: "-dwarf-version=2"
290290
// G_DWARF4: "-dwarf-version=4"
291291
//
@@ -339,7 +339,7 @@
339339
// NOCI: "-gno-column-info"
340340
//
341341
// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"
342-
// GEXTREFS: "-debug-info-kind={{standalone|constructor}}"
342+
// GEXTREFS: "-debug-info-kind={{standalone|limited}}"
343343

344344
// RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s
345345
// BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind'

clang/test/Driver/integrated-as.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
// XA_INCLUDE2: "-Ifoo_dir"
2828

2929
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -gdwarf-4 -gdwarf-2 2>&1 | FileCheck --check-prefix=DWARF2 %s
30-
// DWARF2: "-debug-info-kind=constructor" "-dwarf-version=2"
30+
// DWARF2: "-debug-info-kind=limited" "-dwarf-version=2"
3131

3232
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -gdwarf-3 2>&1 | FileCheck --check-prefix=DWARF3 %s
33-
// DWARF3: "-debug-info-kind=constructor" "-dwarf-version=3"
33+
// DWARF3: "-debug-info-kind=limited" "-dwarf-version=3"
3434

3535
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -gdwarf-4 2>&1 | FileCheck --check-prefix=DWARF4 %s
36-
// DWARF4: "-debug-info-kind=constructor" "-dwarf-version=4"
36+
// DWARF4: "-debug-info-kind=limited" "-dwarf-version=4"
3737

3838
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Xassembler -gdwarf-2 2>&1 | FileCheck --check-prefix=DWARF2XASSEMBLER %s
39-
// DWARF2XASSEMBLER: "-debug-info-kind=constructor" "-dwarf-version=2"
39+
// DWARF2XASSEMBLER: "-debug-info-kind=limited" "-dwarf-version=2"
4040

4141
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Wa,-gdwarf-2 2>&1 | FileCheck --check-prefix=DWARF2WA %s
42-
// DWARF2WA: "-debug-info-kind=constructor" "-dwarf-version=2"
42+
// DWARF2WA: "-debug-info-kind=limited" "-dwarf-version=2"
4343

4444
// A dwarf version number that driver can't parse is just stuffed in.
4545
// RUN: %clang -### -target x86_64--- -c -integrated-as %s -Wa,-gdwarf-huh 2>&1 | FileCheck --check-prefix=BOGODWARF %s

clang/test/Driver/myriad-toolchain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
// NOSTDLIB-NOT: "-lc"
8484

8585
// RUN: %clang -### -c -g %s -target sparc-myriad 2>&1 | FileCheck -check-prefix=G_SPARC %s
86-
// G_SPARC: "-debug-info-kind=constructor" "-dwarf-version=2"
86+
// G_SPARC: "-debug-info-kind=limited" "-dwarf-version=2"
8787

8888
// RUN: %clang -### -c %s -target sparc-myriad-rtems -fuse-init-array 2>&1 \
8989
// RUN: | FileCheck -check-prefix=USE-INIT-ARRAY %s

clang/test/Driver/openmp-offload-gpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241

242242
// HAS_DEBUG-NOT: warning: debug
243243
// HAS_DEBUG: "-triple" "nvptx64-nvidia-cuda"
244-
// HAS_DEBUG-SAME: "-debug-info-kind={{constructor|line-tables-only}}"
244+
// HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}"
245245
// HAS_DEBUG-SAME: "-dwarf-version=2"
246246
// HAS_DEBUG-SAME: "-fopenmp-is-device"
247247
// HAS_DEBUG: ptxas

clang/test/Driver/split-debug.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@
6868
// RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
6969
//
7070
// CHECK-NOINLINE-WITHOUT-SPLIT: "-fno-split-dwarf-inlining"
71-
// CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=constructor"
71+
// CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=limited"
7272

7373
// RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
7474
// RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-GMLT < %t %s
7575
//
76-
// CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=constructor"
76+
// CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=limited"
7777
// CHECK-SPLIT-WITH-GMLT: "-split-dwarf-output"
7878

7979
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
8080
// RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
8181
//
82-
// CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=constructor"
82+
// CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=limited"
8383
// CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
8484

8585
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fsplit-dwarf-inlining -S -### %s 2> %t
@@ -92,7 +92,7 @@
9292
// RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
9393
// RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
9494
//
95-
// CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=constructor"
95+
// CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=limited"
9696
// CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
9797
// CHECK-SPLIT-OVER-GMLT: "-split-dwarf-output"
9898

@@ -117,6 +117,6 @@
117117
// RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
118118
// RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
119119
//
120-
// CHECK-SPLIT-OVER-G0: "-debug-info-kind=constructor"
120+
// CHECK-SPLIT-OVER-G0: "-debug-info-kind=limited"
121121
// CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
122122
// CHECK-SPLIT-OVER-G0: "-split-dwarf-output"

lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class Class : public Base { // Test base class.
106106
int main() {
107107
MemberTest::Base B1;
108108
B1.Get();
109-
MemberTest::Class C1;
110109
MemberTest::Class::StaticMemberFunc(1, 10, 2);
111110
return 0;
112111
}

0 commit comments

Comments
 (0)