Skip to content

Commit 3c7fa26

Browse files
committed
FreeBSD: No availability OS version
Transparent and inlinable declarations had the OS version availability applied to them. This broke some declarations coming from the standard library, specifically `_checkExpectedExecutor`. Rather than crashing, SILGen silently omits the check, resulting in failing tests, and unchecked code. FreeBSD is not one of the platforms where availability is set up, so clear the availability version number like what is done for all non-Apple platforms.
1 parent 95dfa3d commit 3c7fa26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ getVersionTuple(const llvm::Triple &triple) {
6464
triple.getMacOSXVersion(OSVersion);
6565
return OSVersion;
6666
}
67+
if (triple.isOSFreeBSD()) {
68+
// FreeBSD keeps the version number as part of the version tuple.
69+
// We should not use this triple for availability checking, which only works
70+
// with Apple platforms.
71+
return llvm::VersionTuple();
72+
}
6773
return triple.getOSVersion();
6874
}
6975

0 commit comments

Comments
 (0)