Skip to content

Commit 2a4300c

Browse files
committed
[debuginfo] Create -auto-upgrade-llvm-verify-fatal-errors flag
1 parent b326cb6 commit 2a4300c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ using namespace llvm;
5757
static cl::opt<bool>
5858
DisableAutoUpgradeDebugInfo("disable-auto-upgrade-debug-info",
5959
cl::desc("Disable autoupgrade of debug info"));
60+
static cl::opt<bool> LLVMVerifyFatalErrors(
61+
"auto-upgrade-llvm-verify-fatal-errors", cl::init(true),
62+
cl::desc("If true, report LLVM verify errors as fatal"));
6063

6164
static void rename(GlobalValue *GV) { GV->setName(GV->getName() + ".old"); }
6265

@@ -5005,7 +5008,8 @@ bool llvm::UpgradeDebugInfo(Module &M) {
50055008
if (Version == DEBUG_METADATA_VERSION) {
50065009
bool BrokenDebugInfo = false;
50075010
if (verifyModule(M, &llvm::errs(), &BrokenDebugInfo))
5008-
report_fatal_error("Broken module found, compilation aborted!");
5011+
if (LLVMVerifyFatalErrors)
5012+
report_fatal_error("Broken module found, compilation aborted!");
50095013
if (!BrokenDebugInfo)
50105014
// Everything is ok.
50115015
return false;

0 commit comments

Comments
 (0)