-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: New way of bypassing resilience for LLDB #16000
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
IRGen: New way of bypassing resilience for LLDB #16000
Conversation
@swift-ci Please smoke test |
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.
Thanks! Could you do a full test instead of a smoke test, so it also runs the LLDB tests?
lib/IRGen/GenType.cpp
Outdated
FirstProtocol(invalidProtocolInfo()) {} | ||
FirstProtocol(invalidProtocolInfo()) { | ||
// In LLDB, everything is completely fragile, so that IRGen can query | ||
// the size of resilient types. Of course this is not the right long term |
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.
Maybe spell this out even more explicitly:
FIXME: This won't work once the swiftmodule ...
@swift-ci Please test |
test/DebugInfo/resilience.swift
Outdated
|
||
// CHECK-LLDB: ![[V1]] = !DILocalVariable(name: "s1", {{.*}}type: ![[TY:[0-9]+]]) | ||
// CHECK-LLDB: ![[TY]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Size", | ||
// CHECK-LLDB: = |
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.
What's up with this check line, and the one above for non-LLDB?
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.
I don't know, I'll remove it unless @adrian-prantl objects.
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.
The CHECK: =
line ensures that whatever CHECK comes next doesn't match the same line. If there is no (longer a) CHECK following that one then it can safely be removed.
Build failed |
Build failed |
21eb82f
to
617b0cf
Compare
apple/swift-lldb#540 |
Build failed |
Build failed |
617b0cf
to
b0a7e62
Compare
apple/swift-lldb#542 |
apple/swift-lldb#542 |
Build failed |
Build failed |
When running Swift from within LLDB, we need to bypass resilience since LLDB does not support resilience yet. However, the bypass was done too early as part of the module loader, which had the effect of disabling resilience altogether. We still want resilience at the SIL level so that function types lower the same with debugger support turned on and off. Only IRGen needs to bypass resilience, so that LLDB can calculate fragile layouts of types. Also, the DebuggerSupport flag is not always set in the ASTContexts created by LLDB. So replace it with a new flag that only controls this behavior and nothing else, and make it part of IRGenOptions to make it totally clear that it only impacts IRGen. Together with the paired LLDB change, fixes <rdar://problem/38719739> and <rdar://problem/38483762>.
apple/swift-lldb#542 |
Build failed |
b0a7e62
to
55633e8
Compare
@swift-ci Please smoke test |
Build failed |
apple/swift-lldb#542 |
When running Swift from within LLDB, we bypass resilience since LLDB does
not support resilience yet. However, the bypass was done too early, disabling
resilience altogether.
We still want resilience at the SIL level so that function types lower the
same with debugger support turned on and off. Only IRGen needs to bypass
resilience, so that LLDB can calculate fragile layouts of types.
Fixes rdar://problem/38719739 and rdar://problem/38483762.