Basic: default platform version to 0.0.0

The platform versions are really only used on Darwin platforms.
Simplify the path by defaulting to `0.0.0` on all platforms, and
handling the version number on supported platforms.
This commit is contained in:
Saleem Abdulrasool
2019-11-23 13:37:00 -08:00
parent 13eb4813ea
commit 851f877390

View File

@@ -296,20 +296,13 @@ namespace swift {
/// This is only implemented on certain OSs. If no target has been
/// configured, returns v0.0.0.
llvm::VersionTuple getMinPlatformVersion() const {
unsigned major, minor, revision;
unsigned major = 0, minor = 0, revision = 0;
if (Target.isMacOSX()) {
Target.getMacOSXVersion(major, minor, revision);
} else if (Target.isiOS()) {
Target.getiOSVersion(major, minor, revision);
} else if (Target.isWatchOS()) {
Target.getOSVersion(major, minor, revision);
} else if (Target.isOSLinux() || Target.isOSFreeBSD() ||
Target.isAndroid() || Target.isOSWindows() ||
Target.isPS4() || Target.isOSHaiku() ||
Target.getTriple().empty()) {
major = minor = revision = 0;
} else {
llvm_unreachable("Unsupported target OS");
}
return llvm::VersionTuple(major, minor, revision);
}