-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add debug info support for function arguments in async functions. #35028
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
Conversation
lib/IRGen/IRGenDebugInfo.cpp
Outdated
// give CoroSplit.cpp license to emit a shadow copy for them pointing inside | ||
// the Swift Context argument that is valid throughout the function. | ||
auto &EntryBlock = BB->getParent()->getEntryBlock(); | ||
if (auto *InsertBefore = EntryBlock.getFirstNonPHIOrDbg()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be simplified using entryBlock.getFirstInsertionPt() ("Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction.")?
lib/IRGen/IRGenDebugInfo.h
Outdated
DirectValue, | ||
IndirectValue, | ||
InCoroContext, | ||
InCoroContextIndirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total nitpick: wdyt of replacing {'InCoroContext', 'InCoroContextIndirect'} with {'CoroDirectValue' and 'CoroIndirectValue'}? Naming might feel a bit more similar that way. Another option might be an enum class, then you could spell 'IndirectionKind::Direct', 'IndirectionKind::CoroDirect' etc.
4a5a32b
to
2219595
Compare
@swift-ci test |
This commit depends on changes to the coroutine-splitting pass in LLVM. Shadow copies are also turned off for async function arguments, because they make it impossible to track debug info during coroutine splitting. Instead we are relying on LLVM's CoroSplit.cpp to emit shadow copies. The Swift frontend gives CoroSplit license to move do this by describing the arguments using a dbg.declare intrinsic, even though it points to chain of load/GEP/bitcase instructions into the Swift context function argument. rdar://71866936
2219595
to
0e6a0b8
Compare
@swift-ci test |
Build failed |
@swift-ci test |
This commit depends on changes to the coroutine-splitting pass in LLVM. Shadow
copies are also turned off for async function arguments, because they make it
impossible to track debug info during coroutine splitting. Instead we are
relying on LLVM's CoroSplit.cpp to emit shadow copies. The Swift frontend gives
CoroSplit license to move do this by describing the arguments using a
dbg.declare intrinsic, even though it points to chain of load/GEP/bitcase
instructions into the Swift context function argument.
rdar://71866936