Deserialize Swift compatibility version in CompilerInvocation::loadFromSerializedAST()

LLDB needs the -swift-version because the -D__swift__ macro affects
how Clang modules are built. This currently has the really odd effect
that when debugging a Swift program that is not using the very latest
Swift version, the first "po" takes several seconds, because the
module cache needs to be rebuilt.

rdar://problem/40241256
This commit is contained in:
Adrian Prantl
2018-08-28 13:01:56 -07:00
parent ad7bbdfbd6
commit 97cbd3b1cf
3 changed files with 15 additions and 4 deletions

View File

@@ -1203,6 +1203,7 @@ CompilerInvocation::loadFromSerializedAST(StringRef data) {
if (info.status != serialization::Status::Valid)
return info.status;
LangOpts.EffectiveLanguageVersion = info.compatibilityVersion;
setTargetTriple(info.targetTriple);
if (!extendedInfo.getSDKPath().empty())
setSDKPath(extendedInfo.getSDKPath());