mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: New way of bypassing resilience for LLDB
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>.
This commit is contained in:
@@ -200,10 +200,7 @@ FileUnit *SerializedModuleLoader::loadAST(
|
||||
isFramework, loadedModuleFile,
|
||||
&extendedInfo);
|
||||
if (loadInfo.status == serialization::Status::Valid) {
|
||||
// In LLDB always use the default resilience strategy, so IRGen can query
|
||||
// the size of resilient types.
|
||||
if (!Ctx.LangOpts.DebuggerSupport)
|
||||
M.setResilienceStrategy(extendedInfo.getResilienceStrategy());
|
||||
M.setResilienceStrategy(extendedInfo.getResilienceStrategy());
|
||||
|
||||
// We've loaded the file. Now try to bring it into the AST.
|
||||
auto fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile,
|
||||
|
||||
Reference in New Issue
Block a user