Skip to content

Commit 40f9bb9

Browse files
authored
[DebugInfo][RemoveDIs] Eliminate another debug-info variation flag (#133917)
The "preserve input debug-info format" flag allowed some tooling to opt into not seeing the new debug records yet, and to not autoupgrade. This was good at the time, but un-necessary now that we'll be ditching intrinsics shortly. It also hides errors now: verify-uselistorder was hardcoding this flag to on, and as a result it hasn't seen debug records before. Thus, we missed a uselistorder variation: constant-expressions such as GEPs can be contained within debug records and completely isolated from the value hierachy, see the metadata-use-uselistorder.ll test. These Values didn't get ordered, but were legitimate uses of constants like "i64 0", and we now run into difficulty handling that. The patch to AsmWriter seeks Values to order even through debug-info now. Finally there are a few intrinsics-tests relying on this flag that we can just delete, such as one in llvm-reduce and another few in the LocalTest unit tests. For the fast-isel test, it was added in https://reviews.llvm.org/D67703 explicitly for checking the size of blocks without debug-info and in 1525abb the codepath it tests moved towards being sunsetted. It'll be totally redundant once RemoveDIs is on permanently. Note that there's now no explicit test for the textual-IR autoupgrade path. I submit that we can rely on the thousands of .ll files where we've only been bothered to update the outputs, not the inputs, to debug records.
1 parent 0eb560a commit 40f9bb9

File tree

18 files changed

+64
-238
lines changed

18 files changed

+64
-238
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ static cl::opt<bool> AllowIncompleteIR(
6464
"metadata will be dropped)"));
6565

6666
extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
67-
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
6867

6968
static std::string getTypeString(Type *T) {
7069
std::string Result;
@@ -209,10 +208,6 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
209208
// records in this IR.
210209
assert(!(SeenNewDbgInfoFormat && SeenOldDbgInfoFormat) &&
211210
"Mixed debug intrinsics/records seen without a parsing error?");
212-
if (PreserveInputDbgFormat == cl::boolOrDefault::BOU_TRUE) {
213-
UseNewDbgInfoFormat = SeenNewDbgInfoFormat;
214-
M->setNewDbgInfoFormatFlag(SeenNewDbgInfoFormat);
215-
}
216211

217212
// Handle any function attribute group forward references.
218213
for (const auto &RAG : ForwardRefAttrGroups) {
@@ -447,8 +442,7 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
447442
UpgradeNVVMAnnotations(*M);
448443
UpgradeSectionAttributes(*M);
449444

450-
if (PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE)
451-
M->setIsNewDbgInfoFormat(UseNewDbgInfoFormat);
445+
M->setIsNewDbgInfoFormat(UseNewDbgInfoFormat);
452446

453447
if (!Slots)
454448
return false;

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ static cl::opt<bool> ExpandConstantExprs(
103103
"Expand constant expressions to instructions for testing purposes"));
104104

105105
extern cl::opt<bool> UseNewDbgInfoFormat;
106-
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
107106

108107
namespace {
109108

@@ -3953,11 +3952,7 @@ Error BitcodeReader::globalCleanup() {
39533952
for (Function &F : *TheModule) {
39543953
MDLoader->upgradeDebugIntrinsics(F);
39553954
Function *NewFn;
3956-
// If PreserveInputDbgFormat=true, then we don't know whether we want
3957-
// intrinsics or records, and we won't perform any conversions in either
3958-
// case, so don't upgrade intrinsics to records.
3959-
if (UpgradeIntrinsicFunction(
3960-
&F, NewFn, PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE))
3955+
if (UpgradeIntrinsicFunction(&F, NewFn))
39613956
UpgradedIntrinsics[&F] = NewFn;
39623957
// Look for functions that rely on old function attribute behavior.
39633958
UpgradeFunctionAttributes(F);
@@ -7002,37 +6997,9 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
70026997
F->setIsMaterializable(false);
70036998

70046999
// All parsed Functions should load into the debug info format dictated by the
7005-
// Module, unless we're attempting to preserve the input debug info format.
7000+
// Module.
70067001
if (SeenDebugIntrinsic && SeenDebugRecord)
70077002
return error("Mixed debug intrinsics and debug records in bitcode module!");
7008-
if (PreserveInputDbgFormat == cl::boolOrDefault::BOU_TRUE) {
7009-
bool SeenAnyDebugInfo = SeenDebugIntrinsic || SeenDebugRecord;
7010-
bool NewDbgInfoFormatDesired =
7011-
SeenAnyDebugInfo ? SeenDebugRecord : F->getParent()->IsNewDbgInfoFormat;
7012-
if (SeenAnyDebugInfo) {
7013-
UseNewDbgInfoFormat = SeenDebugRecord;
7014-
}
7015-
// If the module's debug info format doesn't match the observed input
7016-
// format, then set its format now; we don't need to call the conversion
7017-
// function because there must be no existing intrinsics to convert.
7018-
// Otherwise, just set the format on this function now.
7019-
if (NewDbgInfoFormatDesired != F->getParent()->IsNewDbgInfoFormat)
7020-
F->getParent()->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired);
7021-
else
7022-
F->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired);
7023-
} else {
7024-
// If we aren't preserving formats, we use the Module flag to get our
7025-
// desired format instead of reading flags, in case we are lazy-loading and
7026-
// the format of the module has been changed since it was set by the flags.
7027-
// We only need to convert debug info here if we have debug records but
7028-
// desire the intrinsic format; everything else is a no-op or handled by the
7029-
// autoupgrader.
7030-
bool ModuleIsNewDbgInfoFormat = F->getParent()->IsNewDbgInfoFormat;
7031-
if (ModuleIsNewDbgInfoFormat || !SeenDebugRecord)
7032-
F->setNewDbgInfoFormatFlag(ModuleIsNewDbgInfoFormat);
7033-
else
7034-
F->setIsNewDbgInfoFormat(ModuleIsNewDbgInfoFormat);
7035-
}
70367003

70377004
if (StripDebugInfo)
70387005
stripDebugInfo(*F);

llvm/lib/IR/AsmWriter.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,20 @@ static void orderValue(const Value *V, OrderMap &OM) {
140140
static OrderMap orderModule(const Module *M) {
141141
OrderMap OM;
142142

143+
auto orderConstantValue = [&OM](const Value *V) {
144+
if (isa<Constant>(V) || isa<InlineAsm>(V))
145+
orderValue(V, OM);
146+
};
147+
148+
auto OrderConstantFromMetadata = [&](Metadata *MD) {
149+
if (const auto *VAM = dyn_cast<ValueAsMetadata>(MD)) {
150+
orderConstantValue(VAM->getValue());
151+
} else if (const auto *AL = dyn_cast<DIArgList>(MD)) {
152+
for (const auto *VAM : AL->getArgs())
153+
orderConstantValue(VAM->getValue());
154+
}
155+
};
156+
143157
for (const GlobalVariable &G : M->globals()) {
144158
if (G.hasInitializer())
145159
if (!isa<GlobalValue>(G.getInitializer()))
@@ -171,6 +185,16 @@ static OrderMap orderModule(const Module *M) {
171185
for (const BasicBlock &BB : F) {
172186
orderValue(&BB, OM);
173187
for (const Instruction &I : BB) {
188+
// Debug records can contain Value references, that can then contain
189+
// Values disconnected from the rest of the Value hierachy, if wrapped
190+
// in some kind of constant-expression. Find and order any Values that
191+
// are wrapped in debug-info.
192+
for (DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) {
193+
OrderConstantFromMetadata(DVR.getRawLocation());
194+
if (DVR.isDbgAssign())
195+
OrderConstantFromMetadata(DVR.getRawAddress());
196+
}
197+
174198
for (const Value *Op : I.operands()) {
175199
Op = skipMetadataWrapper(Op);
176200
if ((isa<Constant>(*Op) && !isa<GlobalValue>(*Op)) ||

llvm/lib/IR/BasicBlock.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ cl::opt<bool> UseNewDbgInfoFormat(
3636
"eliminating intrinsics. Has no effect if "
3737
"--preserve-input-debuginfo-format=true."),
3838
cl::init(true));
39-
cl::opt<cl::boolOrDefault> PreserveInputDbgFormat(
40-
"preserve-input-debuginfo-format", cl::Hidden,
41-
cl::desc("When set to true, IR files will be processed and printed in "
42-
"their current debug info format, regardless of default behaviour "
43-
"or other flags passed. Has no effect if input IR does not "
44-
"contain debug records or intrinsics. Ignored in llvm-link, "
45-
"llvm-lto, and llvm-lto2."));
4639

4740
DbgMarker *BasicBlock::createMarker(Instruction *I) {
4841
assert(IsNewDbgInfoFormat &&

llvm/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ target triple = "x86_64-apple-darwin10.2"
1313
define i32 @main() nounwind readonly !dbg !1 {
1414
%diff1 = alloca i64 ; <ptr> [#uses=2]
1515
; CHECK: #dbg_value(i64 72,
16-
call void @llvm.dbg.declare(metadata ptr %diff1, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
16+
#dbg_declare(ptr %diff1, !0, !DIExpression(), !DILocation(scope: !1))
1717
store i64 72, ptr %diff1, align 8
1818
%v1 = load ptr, ptr @TestArrayPtr, align 8 ; <ptr> [#uses=1]
1919
%v2 = ptrtoint ptr %v1 to i64 ; <i64> [#uses=1]

llvm/test/Assembler/DIDefaultTemplateParam.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ entry:
1515
%f1 = alloca %class.foo, align 1
1616
%f2 = alloca %class.foo.0, align 1
1717
store i32 0, ptr %retval, align 4
18-
call void @llvm.dbg.declare(metadata ptr %f1, metadata !11, metadata !DIExpression()), !dbg !16
19-
call void @llvm.dbg.declare(metadata ptr %f2, metadata !17, metadata !DIExpression()), !dbg !23
18+
#dbg_declare(ptr %f1, !11, !DIExpression(), !16)
19+
#dbg_declare(ptr %f2, !17, !DIExpression(), !23)
2020
ret i32 0, !dbg !24
2121
}
2222
; Function Attrs: nounwind readnone speculatable willreturn

llvm/test/Assembler/metadata-use-uselistorder.ll

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
; correctly preserved due to the uses in the dbg.value contant expressions not
88
; being considered, since they are wrapped in metadata.
99

10+
; With debug records (i.e., not with intrinsics) there's less chance of
11+
; debug-info affecting use-list order as it exists outside of the Value
12+
; hierachy. However, debug records still use ValueAsMetadata nodes, so this
13+
; test remains worthwhile.
14+
1015
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1116
target triple = "x86_64-unknown-linux-gnu"
1217

@@ -16,21 +21,19 @@ target triple = "x86_64-unknown-linux-gnu"
1621
define void @foo() local_unnamed_addr !dbg !6 {
1722
entry:
1823
%0 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 4), align 16
19-
call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 5), metadata !10, metadata !DIExpression()), !dbg !13
24+
#dbg_value(ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 5), !10, !DIExpression(), !13)
2025
%1 = load i64, ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), align 16
21-
call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), metadata !10, metadata !DIExpression()), !dbg !14
26+
#dbg_value(ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), !10, !DIExpression(), !14)
27+
#dbg_assign(i32 0, !10, !DIExpression(), !19, ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 6), !DIExpression(), !14)
2228
ret void
2329
}
2430

2531
define void @bar() local_unnamed_addr !dbg !15 {
2632
entry:
27-
call void @llvm.dbg.value(metadata ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 7), metadata !17, metadata !DIExpression()), !dbg !18
33+
#dbg_value(ptr getelementptr inbounds ([10 x i64], ptr @global_arr, i64 0, i64 7), !17, !DIExpression(), !18)
2834
ret void
2935
}
3036

31-
; Function Attrs: nounwind readnone speculatable
32-
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
33-
3437
attributes #0 = { nounwind readnone speculatable }
3538

3639
!llvm.dbg.cu = !{!0}
@@ -56,3 +59,4 @@ attributes #0 = { nounwind readnone speculatable }
5659
!16 = !{!17}
5760
!17 = !DILocalVariable(name: "local2", scope: !15, file: !1, line: 13, type: !11)
5861
!18 = !DILocation(line: 14, column: 1, scope: !15)
62+
!19 = distinct !DIAssignID()

llvm/test/Bitcode/dbg-record-roundtrip.ll

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
;; Roundtrip tests.
22

3-
;; Tests that bitcode can be printed and interpreted by llvm-dis with non-intrinsic
4-
;; debug records -- llvm-as will autoupgrade.
53
; RUN: llvm-as %s -o - \
64
; RUN: | llvm-dis \
75
; RUN: | FileCheck %s --check-prefixes=RECORDS
86

9-
;; Check that verify-uselistorder passes regardless of input format.
7+
;; Check that verify-uselistorder passes with bitcode and textual IR.
108
; RUN: llvm-as %s -o - | verify-uselistorder
119
; RUN: verify-uselistorder %s
1210

@@ -31,17 +29,18 @@ entry:
3129
; RECORDS-NEXT: dbg_value(![[empty:[0-9]+]], ![[e]], !DIExpression(), ![[dbg]])
3230
; RECORDS-NEXT: dbg_value(i32 poison, ![[e]], !DIExpression(), ![[dbg]])
3331
; RECORDS-NEXT: dbg_value(i32 1, ![[f:[0-9]+]], !DIExpression(), ![[dbg]])
34-
tail call void @llvm.dbg.value(metadata i32 %p, metadata !32, metadata !DIExpression()), !dbg !19
35-
tail call void @llvm.dbg.value(metadata !29, metadata !32, metadata !DIExpression()), !dbg !19
36-
tail call void @llvm.dbg.value(metadata i32 poison, metadata !32, metadata !DIExpression()), !dbg !19
37-
tail call void @llvm.dbg.value(metadata i32 1, metadata !33, metadata !DIExpression()), !dbg !19
32+
#dbg_value(i32 %p, !32, !DIExpression(), !19)
33+
#dbg_value(!29, !32, !DIExpression(), !19)
34+
#dbg_value(i32 poison, !32, !DIExpression(), !19)
35+
#dbg_value(i32 1, !33, !DIExpression(), !19)
3836
;; Arglist with an argument, constant, local use before def, poison.
3937
; RECORDS-NEXT: dbg_value(!DIArgList(i32 %p, i32 0, i32 %0, i32 poison), ![[f]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_LLVM_arg, 2, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_minus), ![[dbg]])
40-
tail call void @llvm.dbg.value(metadata !DIArgList(i32 %p, i32 0, i32 %0, i32 poison), metadata !33, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_LLVM_arg, 2, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_minus)), !dbg !19
38+
#dbg_value(!DIArgList(i32 %p, i32 0, i32 %0, i32 poison), !33, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_LLVM_arg, 2, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_minus), !19)
39+
4140
;; Check dbg.assign use before def (value, addr and ID). Check expression order too.
4241
; RECORDS: dbg_assign(i32 %0, ![[i:[0-9]+]], !DIExpression(DW_OP_plus_uconst, 0),
4342
; RECORDS-SAME: ![[ID:[0-9]+]], ptr %a, !DIExpression(DW_OP_plus_uconst, 1), ![[dbg]])
44-
tail call void @llvm.dbg.assign(metadata i32 %0, metadata !36, metadata !DIExpression(DW_OP_plus_uconst, 0), metadata !37, metadata ptr %a, metadata !DIExpression(DW_OP_plus_uconst, 1)), !dbg !19
43+
#dbg_assign(i32 %0, !36, !DIExpression(DW_OP_plus_uconst, 0), !37, ptr %a, !DIExpression(DW_OP_plus_uconst, 1), !19)
4544
%a = alloca i32, align 4, !DIAssignID !37
4645
; CHECK: %a = alloca i32, align 4, !DIAssignID ![[ID]]
4746
;; Check dbg.declare configurations.
@@ -51,25 +50,25 @@ entry:
5150
; RECORDS-NEXT: dbg_declare(ptr poison, ![[c:[0-9]+]], !DIExpression(), ![[dbg]])
5251
; RECORDS-NEXT: dbg_declare(ptr null, ![[d:[0-9]+]], !DIExpression(), ![[dbg]])
5352
; RECORDS-NEXT: dbg_declare(ptr @g, ![[h:[0-9]+]], !DIExpression(), ![[dbg]])
54-
tail call void @llvm.dbg.declare(metadata ptr %a, metadata !17, metadata !DIExpression()), !dbg !19
55-
tail call void @llvm.dbg.declare(metadata !29, metadata !28, metadata !DIExpression()), !dbg !19
56-
tail call void @llvm.dbg.declare(metadata ptr poison, metadata !30, metadata !DIExpression()), !dbg !19
57-
tail call void @llvm.dbg.declare(metadata ptr null, metadata !31, metadata !DIExpression()), !dbg !19
58-
tail call void @llvm.dbg.declare(metadata ptr @g, metadata !35, metadata !DIExpression()), !dbg !19
53+
#dbg_declare(ptr %a, !17, !DIExpression(), !19)
54+
#dbg_declare(!29, !28, !DIExpression(), !19)
55+
#dbg_declare(ptr poison, !30, !DIExpression(), !19)
56+
#dbg_declare(ptr null, !31, !DIExpression(), !19)
57+
#dbg_declare(ptr @g, !35, !DIExpression(), !19)
5958
;; Argument value dbg.declare.
6059
; RECORDS: dbg_declare(ptr %storage, ![[g:[0-9]+]], !DIExpression(), ![[dbg]])
61-
tail call void @llvm.dbg.declare(metadata ptr %storage, metadata !34, metadata !DIExpression()), !dbg !19
60+
#dbg_declare(ptr %storage, !34, !DIExpression(), !19)
6261
;; Use before def dbg.value.
6362
; RECORDS: dbg_value(i32 %0, ![[e]], !DIExpression(), ![[dbg]])
64-
tail call void @llvm.dbg.value(metadata i32 %0, metadata !32, metadata !DIExpression()), !dbg !19
63+
#dbg_value(i32 %0, !32, !DIExpression(), !19)
6564
%0 = load i32, ptr @g, align 4, !dbg !20
6665
;; Non-argument local value dbg.value.
6766
; RECORDS: dbg_value(i32 %0, ![[e]], !DIExpression(), ![[dbg]])
68-
tail call void @llvm.dbg.value(metadata i32 %0, metadata !32, metadata !DIExpression()), !dbg !19
67+
#dbg_value(i32 %0, !32, !DIExpression(), !19)
6968
store i32 %0, ptr %a, align 4, !dbg !19
7069
%1 = load i32, ptr %a, align 4, !dbg !25
7170
; RECORDS: dbg_label(![[label:[0-9]+]], ![[dbg]])
72-
tail call void @llvm.dbg.label(metadata !38), !dbg !19
71+
#dbg_label(!38, !19)
7372
ret i32 %1, !dbg !27
7473
}
7574

llvm/test/CodeGen/AArch64/fast-isel-branch-uncond-debug.ll

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

llvm/test/tools/llvm-reduce/debug-metadata-verifier.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; RUN: llvm-reduce %s -o %t --delta-passes=metadata --test %python --test-arg %p/Inputs/remove-metadata.py --abort-on-invalid-reduction
22
; RUN: FileCheck %s --input-file %t
33

4-
; CHECK: call void @llvm.dbg.declare{{.*}}, !dbg
4+
; CHECK: #dbg_declare
55
; CHECK: !llvm.dbg.cu = !{!0}
66
; CHECK-NOT: uninteresting
77

llvm/test/tools/llvm-reduce/remove-args-dbg-intrinsics.ll

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

llvm/tools/llvm-link/llvm-link.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ static cl::opt<bool> IgnoreNonBitcode(
130130
cl::Hidden);
131131

132132
extern cl::opt<bool> UseNewDbgInfoFormat;
133-
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
134133

135134
static ExitOnError ExitOnErr;
136135

@@ -479,11 +478,6 @@ int main(int argc, char **argv) {
479478
cl::HideUnrelatedOptions({&LinkCategory, &getColorCategory()});
480479
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
481480

482-
// Since llvm-link collects multiple IR modules together, for simplicity's
483-
// sake we disable the "PreserveInputDbgFormat" flag to enforce a single
484-
// debug info format.
485-
PreserveInputDbgFormat = cl::boolOrDefault::BOU_FALSE;
486-
487481
LLVMContext Context;
488482
Context.setDiagnosticHandler(std::make_unique<LLVMLinkDiagnosticHandler>(),
489483
true);

llvm/tools/llvm-lto/llvm-lto.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ static cl::opt<bool>
264264
LTOSaveBeforeOpt("lto-save-before-opt", cl::init(false),
265265
cl::desc("Save the IR before running optimizations"));
266266

267-
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
268-
269267
namespace {
270268

271269
struct ModuleInfo {
@@ -1001,11 +999,6 @@ int main(int argc, char **argv) {
1001999
cl::HideUnrelatedOptions({&LTOCategory, &getColorCategory()});
10021000
cl::ParseCommandLineOptions(argc, argv, "llvm LTO linker\n");
10031001

1004-
// Since llvm-lto collects multiple IR modules together, for simplicity's sake
1005-
// we disable the "PreserveInputDbgFormat" flag to enforce a single debug info
1006-
// format.
1007-
PreserveInputDbgFormat = cl::boolOrDefault::BOU_FALSE;
1008-
10091002
if (OptLevel < '0' || OptLevel > '3')
10101003
error("optimization level must be between 0 and 3");
10111004

0 commit comments

Comments
 (0)