Skip to content

Commit fd36d4b

Browse files
author
git apple-llvm automerger
committed
Merge commit '5f744ee5c770' from llvm.org/release/19.x into stable/20240723
2 parents 4416ae4 + 5f744ee commit fd36d4b

File tree

2 files changed

+1182
-0
lines changed

2 files changed

+1182
-0
lines changed

llvm/lib/CodeGen/DwarfEHPrepare.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
293293
// Call the function.
294294
CallInst *CI =
295295
CallInst::Create(RewindFunction, RewindFunctionArgs, "", UnwindBB);
296+
// The verifier requires that all calls of debug-info-bearing functions
297+
// from debug-info-bearing functions have a debug location (for inlining
298+
// purposes). Assign a dummy location to satisfy the constraint.
299+
Function *RewindFn = dyn_cast<Function>(RewindFunction.getCallee());
300+
if (RewindFn && RewindFn->getSubprogram())
301+
if (DISubprogram *SP = F.getSubprogram())
302+
CI->setDebugLoc(DILocation::get(SP->getContext(), 0, 0, SP));
296303
CI->setCallingConv(RewindFunctionCallingConv);
297304

298305
// We never expect _Unwind_Resume to return.

0 commit comments

Comments
 (0)