Skip to content

[irgen] Add support to IRGenDebugInfo for emitting an llvm.dbg.addr instead of llvm.dbg.declare. #41379

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

gottesmm
Copy link
Contributor

By default, we still use llvm.dbg.declare, so this is an NFC commit. But this
sets us up for using this in the future.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

The macOS hit a known failure on the smoke test bots. I am going to wait for #41378 to land and then I am going to add a bit more into this PR including a full end to end test that shows that we get the correct debug info.

…nstead of llvm.dbg.declare.

By default, we still use llvm.dbg.declare, so this is an NFC commit. But this
sets us up for using this in the future.
@gottesmm gottesmm force-pushed the pr-aa7d71cdb8ea8518b4d7e9b78a9f99d91639c1c0 branch from 498d39d to 2597c56 Compare February 15, 2022 20:47
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

The extra commit is 2597c56. The patch makes sure that the debug_value undef that we insert uses the exact location as the original value that we are moving. Otherwise, LLVM doesn't seem to handle this correctly. I also included an end to end test that checks that we handle debug info for move of let/var for copyable/address only correctly. In the process I discovered that the let object works as expected but the address only let/copyable & address only var are not working for some reason. I am looking into it now, but I decided to upstream the test with the file check lines for the let case but not the other ones. I am going to fix that in a subsequent PR.

…riginal DbgVarCarryingInst we found.

LLVM wants the debug_value undef to be /exactly/ the same as the original
debug_value including the loc. If we don't match, LLVM won't invalidate the
value.

Also now that things actually work (at least for copyable lets), lets add some
basic tests that debug info works as expected. NOTE: With this patch it seems
that address only move is still broken. I am looking into it and will fix it in
a forthcoming PR.
@gottesmm gottesmm force-pushed the pr-aa7d71cdb8ea8518b4d7e9b78a9f99d91639c1c0 branch from 2597c56 to 504fe52 Compare February 17, 2022 02:16
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm merged commit dc597b8 into swiftlang:main Feb 17, 2022
@gottesmm gottesmm deleted the pr-aa7d71cdb8ea8518b4d7e9b78a9f99d91639c1c0 branch February 17, 2022 07:55
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.

1 participant