[Serialization] Use effective language version for "module too old".

People were getting confused when it said "module compiled with Swift
3.1 cannot be imported into Swift 4.0" when they were passing
"-swift-version 3".

rdar://problem/32187112
This commit is contained in:
Jordan Rose
2017-05-18 11:41:26 -07:00
parent f023fcefac
commit c56ee3d6e1
2 changed files with 15 additions and 2 deletions

View File

@@ -232,7 +232,7 @@ FileUnit *SerializedModuleLoader::loadAST(
SmallString<32> versionBuf;
llvm::raw_svector_ostream versionString(versionBuf);
versionString << version::Version::getCurrentLanguageVersion();
versionString << Ctx.LangOpts.EffectiveLanguageVersion;
if (versionString.str() == shortVersion)
return false;