Skip to content

Commit bc5b570

Browse files
author
Amirhossein Pashaeehir
committed
Change unnessary assert to warning
1 parent 6a38936 commit bc5b570

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/DWARFCFIChecker/DWARFCFIAnalysis.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,12 @@ void DWARFCFIAnalysis::checkRegDiff(
187187

188188
auto MaybeLLVMReg = MCRI->getLLVMRegNum(Reg, IsEH);
189189
if (!MaybeLLVMReg) {
190-
assert(PrevLoc == NextLoc &&
191-
"The dwarf register does not have a LLVM number, so the unwind info "
192-
"for it should not change");
190+
if (!(PrevLoc == NextLoc))
191+
Context->reportWarning(
192+
Inst.getLoc(),
193+
formatv("the dwarf register {0} does not have a LLVM number, but its "
194+
"unwind info changed. Ignoring this change",
195+
Reg));
193196
return;
194197
}
195198
const char *RegName = MCRI->getName(*MaybeLLVMReg);

0 commit comments

Comments
 (0)