Skip to content

Set debug location to Coroutine call expression #81495

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

Conversation

rastogishubham
Copy link
Contributor

@rastogishubham rastogishubham commented May 14, 2025

cherry picked from commit 17e756b #81463

Explanation: This change makes sure that a debug location is attached to a coroutine call instruction to make sure there are no issues with invalid debug information in LTO. If LTO detects any invalid debug info, such as an instruction without a debug location, when compiled with debug info, the debug info for that translation unit will be stripped.

Scope: limited to swift.org toolchains

Risk: low, the change is additive and doesn't impact anything else

Testing: automated testing via github.com/swiftlang/swift-integration-tests

Issue: rdar://149574283

Reviewer: @adrian-prantl

If debug info generation is enabled, set debug location to the
coroutine call instruction to make sure there are no issues with invalid
debug information in LTO.

This happens because in LTO, if a call to a function doesn't contain a
debug location, we see the warning:

inlinable function call in a function with debug info must have a
!dbg location

ld: warning: Invalid debug info found, debug info will be stripped

Which then strips the debug info from the entire .o file linked into the
dylib.

(cherry picked from commit 17e756b)
@rastogishubham rastogishubham requested a review from a team as a code owner May 14, 2025 00:35
@rastogishubham
Copy link
Contributor Author

@swift-ci please test

@adrian-prantl adrian-prantl merged commit 6051867 into swiftlang:release/6.2 May 14, 2025
5 checks passed
@rastogishubham rastogishubham deleted the AttachDebugLoc6.2 branch May 14, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants