Skip to content

Commit 851f877

Browse files
committed
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.
1 parent 13eb481 commit 851f877

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,13 @@ namespace swift {
296296
/// This is only implemented on certain OSs. If no target has been
297297
/// configured, returns v0.0.0.
298298
llvm::VersionTuple getMinPlatformVersion() const {
299-
unsigned major, minor, revision;
299+
unsigned major = 0, minor = 0, revision = 0;
300300
if (Target.isMacOSX()) {
301301
Target.getMacOSXVersion(major, minor, revision);
302302
} else if (Target.isiOS()) {
303303
Target.getiOSVersion(major, minor, revision);
304304
} else if (Target.isWatchOS()) {
305305
Target.getOSVersion(major, minor, revision);
306-
} else if (Target.isOSLinux() || Target.isOSFreeBSD() ||
307-
Target.isAndroid() || Target.isOSWindows() ||
308-
Target.isPS4() || Target.isOSHaiku() ||
309-
Target.getTriple().empty()) {
310-
major = minor = revision = 0;
311-
} else {
312-
llvm_unreachable("Unsupported target OS");
313306
}
314307
return llvm::VersionTuple(major, minor, revision);
315308
}

0 commit comments

Comments
 (0)