Skip to content

[DwarfEhPrepare] Assign dummy debug location for more inserted _Unwind_Resume calls #105513

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 1 commit into from
Aug 22, 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
7 changes: 7 additions & 0 deletions llvm/lib/CodeGen/DwarfEHPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
// Call the function.
CallInst *CI =
CallInst::Create(RewindFunction, RewindFunctionArgs, "", UnwindBB);
// The verifier requires that all calls of debug-info-bearing functions
// from debug-info-bearing functions have a debug location (for inlining
// purposes). Assign a dummy location to satisfy the constraint.
Function *RewindFn = dyn_cast<Function>(RewindFunction.getCallee());
if (RewindFn && RewindFn->getSubprogram())
if (DISubprogram *SP = F.getSubprogram())
CI->setDebugLoc(DILocation::get(SP->getContext(), 0, 0, SP));
CI->setCallingConv(RewindFunctionCallingConv);

// We never expect _Unwind_Resume to return.
Expand Down
Loading
Loading