Skip to content

[RemoveDIs] Add flag to preserve the debug info format of input IR #87379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/include/llvm/AsmParser/LLParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ namespace llvm {

// Top-Level Entities
bool parseTopLevelEntities();
bool finalizeDebugInfoFormat(Module *M);
void dropUnknownMetadataReferences();
bool validateEndOfModule(bool UpgradeDebugInfo);
bool validateEndOfIndex();
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/IR/AutoUpgrade.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace llvm {
/// for upgrading, and returns true if it requires upgrading. It may return
/// null in NewFn if the all calls to the original intrinsic function
/// should be transformed to non-function-call instructions.
bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn);
bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn,
bool CanUpgradeDebugIntrinsicsToRecords = true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaked in from another pull request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this part is used in this patch in BitcodeReader.cpp:3789, to avoid upgrading debug intrinsics to records specifically when we have the preserve flag enabled.


/// This is the complement to the above, replacing a specific call to an
/// intrinsic function with a call to the specified new function.
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/IR/BasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
/// in the new format (\p NewFlag == true), converting to the desired format
/// if necessary.
void setIsNewDbgInfoFormat(bool NewFlag);
void setNewDbgInfoFormatFlag(bool NewFlag);

/// Record that the collection of DbgRecords in \p M "trails" after the last
/// instruction of this block. These are equivalent to dbg.value intrinsics
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/IR/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
void convertFromNewDbgValues();

void setIsNewDbgInfoFormat(bool NewVal);
void setNewDbgInfoFormatFlag(bool NewVal);

private:
friend class TargetLibraryInfoImpl;
Expand Down
6 changes: 6 additions & 0 deletions llvm/include/llvm/IR/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ class LLVM_EXTERNAL_VISIBILITY Module {
else if (!UseNewFormat && IsNewDbgInfoFormat)
convertFromNewDbgValues();
}
void setNewDbgInfoFormatFlag(bool NewFlag) {
for (auto &F : *this) {
F.setNewDbgInfoFormatFlag(NewFlag);
}
IsNewDbgInfoFormat = NewFlag;
}

/// The Module constructor. Note that there is no default constructor. You
/// must provide a name for the module upon construction.
Expand Down
27 changes: 20 additions & 7 deletions llvm/lib/AsmParser/LLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ static cl::opt<bool> AllowIncompleteIR(
"metadata will be dropped)"));

extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
extern bool WriteNewDbgInfoFormatToBitcode;
extern cl::opt<bool> WriteNewDbgInfoFormat;

static std::string getTypeString(Type *T) {
std::string Result;
Expand All @@ -71,12 +74,20 @@ static std::string getTypeString(Type *T) {
return Tmp.str();
}

// Currently, we should always process modules in the old debug info format by
// default regardless of the module's format in IR; convert it to the old format
// here.
bool finalizeDebugInfoFormat(Module *M) {
if (M)
// Whatever debug info format we parsed, we should convert to the expected debug
// info format immediately afterwards.
bool LLParser::finalizeDebugInfoFormat(Module *M) {
// We should have already returned an error if we observed both intrinsics and
// records in this IR.
assert(!(SeenNewDbgInfoFormat && SeenOldDbgInfoFormat) &&
"Mixed debug intrinsics/records seen without a parsing error?");
if (PreserveInputDbgFormat == cl::boolOrDefault::BOU_TRUE) {
UseNewDbgInfoFormat = SeenNewDbgInfoFormat;
WriteNewDbgInfoFormatToBitcode = SeenNewDbgInfoFormat;
WriteNewDbgInfoFormat = SeenNewDbgInfoFormat;
} else if (M) {
M->setIsNewDbgInfoFormat(false);
}
return false;
}

Expand Down Expand Up @@ -6507,10 +6518,10 @@ bool LLParser::parseBasicBlock(PerFunctionState &PFS) {
if (SeenOldDbgInfoFormat)
return error(Lex.getLoc(), "debug record should not appear in a module "
"containing debug info intrinsics");
if (!SeenNewDbgInfoFormat)
M->setNewDbgInfoFormatFlag(true);
SeenNewDbgInfoFormat = true;
Lex.Lex();
if (!M->IsNewDbgInfoFormat)
M->convertToNewDbgValues();

DbgRecord *DR;
if (parseDebugRecord(DR, PFS))
Expand Down Expand Up @@ -7912,6 +7923,8 @@ bool LLParser::parseCall(Instruction *&Inst, PerFunctionState &PFS,
return error(CallLoc, "llvm.dbg intrinsic should not appear in a module "
"using non-intrinsic debug info");
}
if (!SeenOldDbgInfoFormat)
M->setNewDbgInfoFormatFlag(false);
SeenOldDbgInfoFormat = true;
}
CI->setAttributes(PAL);
Expand Down
72 changes: 59 additions & 13 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat(
"load-bitcode-into-experimental-debuginfo-iterators", cl::Hidden,
cl::desc("Load bitcode directly into the new debug info format (regardless "
"of input format)"));
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
extern bool WriteNewDbgInfoFormatToBitcode;
extern cl::opt<bool> WriteNewDbgInfoFormat;

namespace {

Expand Down Expand Up @@ -682,6 +685,11 @@ class BitcodeReader : public BitcodeReaderBase, public GVMaterializer {
/// (e.g.) blockaddress forward references.
bool WillMaterializeAllForwardRefs = false;

/// Tracks whether we have seen debug intrinsics or records in this bitcode;
/// seeing both in a single module is currently a fatal error.
bool SeenDebugIntrinsic = false;
bool SeenDebugRecord = false;

bool StripDebugInfo = false;
TBAAVerifier TBAAVerifyHelper;

Expand Down Expand Up @@ -3774,7 +3782,11 @@ Error BitcodeReader::globalCleanup() {
for (Function &F : *TheModule) {
MDLoader->upgradeDebugIntrinsics(F);
Function *NewFn;
if (UpgradeIntrinsicFunction(&F, NewFn))
// If PreserveInputDbgFormat=true, then we don't know whether we want
// intrinsics or records, and we won't perform any conversions in either
// case, so don't upgrade intrinsics to records.
if (UpgradeIntrinsicFunction(
&F, NewFn, PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE))
UpgradedIntrinsics[&F] = NewFn;
// Look for functions that rely on old function attribute behavior.
UpgradeFunctionAttributes(F);
Expand Down Expand Up @@ -4301,10 +4313,13 @@ Error BitcodeReader::parseModule(uint64_t ResumeBit,
bool ShouldLazyLoadMetadata,
ParserCallbacks Callbacks) {
// Load directly into RemoveDIs format if LoadBitcodeIntoNewDbgInfoFormat
// has been set to true (default action: load into the old debug format).
TheModule->IsNewDbgInfoFormat =
UseNewDbgInfoFormat &&
LoadBitcodeIntoNewDbgInfoFormat == cl::boolOrDefault::BOU_TRUE;
// has been set to true and we aren't attempting to preserve the existing
// format in the bitcode (default action: load into the old debug format).
if (PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this == cl::boolOrDefault::BOU_TRUE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent is that if we're preserving the input format, then we don't want to update TheModule->IsNewDbgInfoFormat according to the rule below. It could all be folded into a boolean expression, but I think that might obfuscate the meaning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I see where my confusion comes in, TheModule->IsNewDbgInfoFormat is currently always false. Is this patch intended to land after the "set IsNewDbgInfoFormat in Module ctor based on UseNewDbgInfoFormat" patch (alternatively: is your reply above intended to be true after that patch lands, even if this one lands first)?

Otherwise, without the module-ctor-patch, the default behaviour becomes convert all inputs into intrinsic mode (because of the code down on line 6842). Or am I misreading this situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't require the ctor change; the behaviour is that:

  • If we aren't preserving inputs, then we follow the existing behaviour - we set IsNewDbgInfoFormat according to the UseNewDbgInfoFormat and LoadBitcodeIntoNewDbgInfoFormat flags, and then when we materialize the function we either 1) convert any existing records to intrinsics via the call to setIsNewDbgInfoFormat on line 6849, or 2) convert any existing intrinsics to records during autoupgrading, depending on whether we're loading into the new format or not.
  • If we are preserving inputs, then we never convert between intrinsics and records at any point - we insert records/intrinsics as we materialize the function, and then we set the IsNewDbgInfoFormat flag on the module and its functions once we've determined what format the input was in.

TheModule->IsNewDbgInfoFormat =
UseNewDbgInfoFormat &&
LoadBitcodeIntoNewDbgInfoFormat == cl::boolOrDefault::BOU_TRUE;
}

this->ValueTypeCallback = std::move(Callbacks.ValueType);
if (ResumeBit) {
Expand Down Expand Up @@ -6443,6 +6458,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
case bitc::FUNC_CODE_DEBUG_RECORD_ASSIGN: {
// DbgVariableRecords are placed after the Instructions that they are
// attached to.
SeenDebugRecord = true;
Instruction *Inst = getLastInstruction();
if (!Inst)
return error("Invalid dbg record: missing instruction");
Expand Down Expand Up @@ -6603,6 +6619,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
TCK = CallInst::TCK_NoTail;
cast<CallInst>(I)->setTailCallKind(TCK);
cast<CallInst>(I)->setAttributes(PAL);
if (isa<DbgInfoIntrinsic>(I))
SeenDebugIntrinsic = true;
if (Error Err = propagateAttributeTypes(cast<CallBase>(I), ArgTyIDs)) {
I->deleteValue();
return Err;
Expand Down Expand Up @@ -6791,20 +6809,48 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
if (Error JumpFailed = Stream.JumpToBit(DFII->second))
return JumpFailed;

// Set the debug info mode to "new", possibly creating a mismatch between
// module and function debug modes. This is okay because we'll convert
// everything back to the old mode after parsing if needed.
// FIXME: Remove this once all tools support RemoveDIs.
// Regardless of the debug info format we want to end up in, we need
// IsNewDbgInfoFormat=true to construct any debug records seen in the bitcode.
F->IsNewDbgInfoFormat = true;

if (Error Err = parseFunctionBody(F))
return Err;
F->setIsMaterializable(false);

// Convert new debug info records into intrinsics.
// FIXME: Remove this once all tools support RemoveDIs.
if (!F->getParent()->IsNewDbgInfoFormat)
F->convertFromNewDbgValues();
// All parsed Functions should load into the debug info format dictated by the
// Module, unless we're attempting to preserve the input debug info format.
if (SeenDebugIntrinsic && SeenDebugRecord)
return error("Mixed debug intrinsics and debug records in bitcode module!");
if (PreserveInputDbgFormat == cl::boolOrDefault::BOU_TRUE) {
bool SeenAnyDebugInfo = SeenDebugIntrinsic || SeenDebugRecord;
bool NewDbgInfoFormatDesired =
SeenAnyDebugInfo ? SeenDebugRecord : F->getParent()->IsNewDbgInfoFormat;
if (SeenAnyDebugInfo) {
UseNewDbgInfoFormat = SeenDebugRecord;
WriteNewDbgInfoFormatToBitcode = SeenDebugRecord;
WriteNewDbgInfoFormat = SeenDebugRecord;
}
// If the module's debug info format doesn't match the observed input
// format, then set its format now; we don't need to call the conversion
// function because there must be no existing intrinsics to convert.
// Otherwise, just set the format on this function now.
if (NewDbgInfoFormatDesired != F->getParent()->IsNewDbgInfoFormat)
F->getParent()->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired);
else
F->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired);
} else {
// If we aren't preserving formats, we use the Module flag to get our
// desired format instead of reading flags, in case we are lazy-loading and
// the format of the module has been changed since it was set by the flags.
// We only need to convert debug info here if we have debug records but
// desire the intrinsic format; everything else is a no-op or handled by the
// autoupgrader.
bool ModuleIsNewDbgInfoFormat = F->getParent()->IsNewDbgInfoFormat;
if (ModuleIsNewDbgInfoFormat || !SeenDebugRecord)
F->setNewDbgInfoFormatFlag(ModuleIsNewDbgInfoFormat);
else
F->setIsNewDbgInfoFormat(ModuleIsNewDbgInfoFormat);
}

if (StripDebugInfo)
stripDebugInfo(*F);
Expand Down
12 changes: 8 additions & 4 deletions llvm/lib/IR/AutoUpgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,8 @@ static Intrinsic::ID shouldUpgradeNVPTXBF16Intrinsic(StringRef Name) {
return Intrinsic::not_intrinsic;
}

static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
bool CanUpgradeDebugIntrinsicsToRecords) {
assert(F && "Illegal to upgrade a non-existent Function.");

StringRef Name = F->getName();
Expand Down Expand Up @@ -1057,7 +1058,8 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
case 'd':
if (Name.consume_front("dbg.")) {
// Mark debug intrinsics for upgrade to new debug format.
if (F->getParent()->IsNewDbgInfoFormat) {
if (CanUpgradeDebugIntrinsicsToRecords &&
F->getParent()->IsNewDbgInfoFormat) {
if (Name == "addr" || Name == "value" || Name == "assign" ||
Name == "declare" || Name == "label") {
// There's no function to replace these with.
Expand Down Expand Up @@ -1413,9 +1415,11 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
return false;
}

bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn,
bool CanUpgradeDebugIntrinsicsToRecords) {
NewFn = nullptr;
bool Upgraded = upgradeIntrinsicFunction1(F, NewFn);
bool Upgraded =
upgradeIntrinsicFunction1(F, NewFn, CanUpgradeDebugIntrinsicsToRecords);
assert(F != NewFn && "Intrinsic function upgraded to the same function");

// Upgrade intrinsic attributes. This does not change the function.
Expand Down
21 changes: 16 additions & 5 deletions llvm/lib/IR/BasicBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ using namespace llvm;
#define DEBUG_TYPE "ir"
STATISTIC(NumInstrRenumberings, "Number of renumberings across all blocks");

cl::opt<bool>
UseNewDbgInfoFormat("experimental-debuginfo-iterators",
cl::desc("Enable communicating debuginfo positions "
"through iterators, eliminating intrinsics"),
cl::init(true));
cl::opt<bool> UseNewDbgInfoFormat(
"experimental-debuginfo-iterators",
cl::desc("Enable communicating debuginfo positions through iterators, "
"eliminating intrinsics. Has no effect if "
"--preserve-input-debuginfo-format=true."),
cl::init(true));
cl::opt<cl::boolOrDefault> PreserveInputDbgFormat(
"preserve-input-debuginfo-format", cl::Hidden,
cl::desc("When set to true, IR files will be processed and printed in "
"their current debug info format, regardless of default behaviour "
"or other flags passed. Has no effect if input IR does not "
"contain debug records or intrinsics. Ignored in llvm-link, "
"llvm-lto, and llvm-lto2."));

bool WriteNewDbgInfoFormatToBitcode /*set default value in cl::init() below*/;
cl::opt<bool, true> WriteNewDbgInfoFormatToBitcode2(
Expand Down Expand Up @@ -147,6 +155,9 @@ void BasicBlock::setIsNewDbgInfoFormat(bool NewFlag) {
else if (!NewFlag && IsNewDbgInfoFormat)
convertFromNewDbgValues();
}
void BasicBlock::setNewDbgInfoFormatFlag(bool NewFlag) {
IsNewDbgInfoFormat = NewFlag;
}

ValueSymbolTable *BasicBlock::getValueSymbolTable() {
if (Function *F = getParent())
Expand Down
6 changes: 6 additions & 0 deletions llvm/lib/IR/Function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ void Function::setIsNewDbgInfoFormat(bool NewFlag) {
else if (!NewFlag && IsNewDbgInfoFormat)
convertFromNewDbgValues();
}
void Function::setNewDbgInfoFormatFlag(bool NewFlag) {
for (auto &BB : *this) {
BB.setNewDbgInfoFormatFlag(NewFlag);
}
IsNewDbgInfoFormat = NewFlag;
}

//===----------------------------------------------------------------------===//
// Argument Implementation
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/IR/IRPrintingPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ using namespace llvm;

cl::opt<bool> WriteNewDbgInfoFormat(
"write-experimental-debuginfo",
cl::desc("Write debug info in the new non-intrinsic format"),
cl::desc("Write debug info in the new non-intrinsic format. Has no effect "
"if --preserve-input-debuginfo-format=true."),
cl::init(false));

namespace {
Expand Down
10 changes: 10 additions & 0 deletions llvm/test/Bitcode/dbg-record-roundtrip.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
; RUN: | llvm-dis --load-bitcode-into-experimental-debuginfo-iterators=true --write-experimental-debuginfo=true \
; RUN: | FileCheck %s --check-prefixes=RECORDS

;; When preserving, we should output the format the bitcode was written in
;; regardless of the value of the write flag.
; RUN: llvm-as --write-experimental-debuginfo-iterators-to-bitcode=true %s -o - \
; RUN: | llvm-dis --preserve-input-debuginfo-format=true --write-experimental-debuginfo=false \
; RUN: | FileCheck %s --check-prefixes=RECORDS

; RUN: llvm-as --write-experimental-debuginfo-iterators-to-bitcode=false %s -o - \
; RUN: | llvm-dis --preserve-input-debuginfo-format=true --write-experimental-debuginfo=true \
; RUN: | FileCheck %s

;; Check that verify-uselistorder passes regardless of input format.
; RUN: llvm-as %s --write-experimental-debuginfo-iterators-to-bitcode=true -o - | verify-uselistorder
; RUN: verify-uselistorder %s
Expand Down
8 changes: 8 additions & 0 deletions llvm/test/DebugInfo/roundtrip-non-instruction-debug-info.ll
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
; RUN: opt --passes=verify -S --try-experimental-debuginfo-iterators --write-experimental-debuginfo=true < %s \
; RUN: | FileCheck %s --check-prefixes=CHECK,NEWDBG --implicit-check-not=llvm.dbg --implicit-check-not=#dbg

;; Test that the preserving flag overrides the write flag.
; RUN: opt --passes=verify -S --preserve-input-debuginfo-format=true --write-experimental-debuginfo=true < %s \
; RUN: | FileCheck %s --check-prefixes=CHECK,OLDDBG --implicit-check-not=llvm.dbg --implicit-check-not=#dbg

; RUN: opt --passes=verify -S --write-experimental-debuginfo=true < %s \
; RUN: | opt --passes=verify -S --preserve-input-debuginfo-format=true --write-experimental-debuginfo=false \
; RUN: | FileCheck %s --check-prefixes=CHECK,NEWDBG --implicit-check-not=llvm.dbg --implicit-check-not=#dbg

; CHECK: @f(i32 %[[VAL_A:[0-9a-zA-Z]+]])
; CHECK-NEXT: entry:
; OLDDBG-NEXT: call void @llvm.dbg.value(metadata i32 %[[VAL_A]], metadata ![[VAR_A:[0-9]+]], metadata !DIExpression()), !dbg ![[LOC_1:[0-9]+]]
Expand Down
5 changes: 5 additions & 0 deletions llvm/tools/llvm-link/llvm-link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static cl::opt<bool> TryUseNewDbgInfoFormat(
cl::init(false));

extern cl::opt<bool> UseNewDbgInfoFormat;
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;

static ExitOnError ExitOnErr;

Expand Down Expand Up @@ -486,6 +487,10 @@ int main(int argc, char **argv) {
// Turn the new debug-info format on.
UseNewDbgInfoFormat = true;
}
// Since llvm-link collects multiple IR modules together, for simplicity's
// sake we disable the "PreserveInputDbgFormat" flag to enforce a single
// debug info format.
PreserveInputDbgFormat = cl::boolOrDefault::BOU_FALSE;

LLVMContext Context;
Context.setDiagnosticHandler(std::make_unique<LLVMLinkDiagnosticHandler>(),
Expand Down
5 changes: 5 additions & 0 deletions llvm/tools/llvm-lto/llvm-lto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ static cl::opt<bool> TryUseNewDbgInfoFormat(

extern cl::opt<bool> UseNewDbgInfoFormat;
extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;

namespace {

Expand Down Expand Up @@ -954,6 +955,10 @@ int main(int argc, char **argv) {
// Turn the new debug-info format on.
UseNewDbgInfoFormat = true;
}
// Since llvm-lto collects multiple IR modules together, for simplicity's sake
// we disable the "PreserveInputDbgFormat" flag to enforce a single debug info
// format.
PreserveInputDbgFormat = cl::boolOrDefault::BOU_FALSE;

if (OptLevel < '0' || OptLevel > '3')
error("optimization level must be between 0 and 3");
Expand Down
Loading