mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[serialization] Diagnose loading modules from older Swifts.
...with a better message than the generic "older version of the compiler" one, when we know it's actually a different version of Swift proper. This still uses the same internal module version numbers to check if the module is compatible; the presentation of language versions is a diagnostic thing only. Speaking of module version numbers, this deliberately does NOT increment VERSION_MINOR; it's implemented in a backwards-compatible way. This will only work going forwards, of course; all existing modules don't have a short version string, and I don't feel comfortable assuming all older modules we might encounter are "Swift 2.2". rdar://problem/25680392
This commit is contained in:
@@ -48,6 +48,8 @@ static void printValidationInfo(llvm::StringRef data) {
|
||||
if (info.status != swift::serialization::Status::Valid)
|
||||
return;
|
||||
|
||||
if (!info.shortVersion.empty())
|
||||
llvm::outs() << "- Swift Version: " << info.shortVersion << "\n";
|
||||
llvm::outs() << "- Target: " << info.targetTriple << "\n";
|
||||
if (!extendedInfo.getSDKPath().empty())
|
||||
llvm::outs() << "- SDK path: " << extendedInfo.getSDKPath() << "\n";
|
||||
|
||||
Reference in New Issue
Block a user