Deserialize all modules with the default resilience strategy when in LLDB

This turns all resilient types into fixed layouts thus allowing LLDB
to query their size. The long-term plan is to use remote mirrors for
this unformation instead of swift IRGen, but the library is not yet up
to the task.

rdar://problem/36663932
This commit is contained in:
Adrian Prantl
2018-03-06 17:18:53 -08:00
parent e64d810f54
commit 39cda11752
2 changed files with 20 additions and 3 deletions

View File

@@ -200,7 +200,10 @@ FileUnit *SerializedModuleLoader::loadAST(
isFramework, loadedModuleFile,
&extendedInfo);
if (loadInfo.status == serialization::Status::Valid) {
M.setResilienceStrategy(extendedInfo.getResilienceStrategy());
// 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());
// We've loaded the file. Now try to bring it into the AST.
auto fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile,