Frontend: Replace the abi magic value accepted by -target-min-inlining-version with a min magic value instead. The new value corresponds to the OS versions in which Swift was introduced. The introduction OS is a better floor for availability checking than the OS in which Swift became ABI stable because inlinable functions may reference clang declarations which have availability between Swift's introduction and ABI stability and framework developers ought to get diagnostics for unguarded use of those APIs in inlinable code.

This commit is contained in:
Allan Shortlidge
2022-03-14 11:23:26 -07:00
parent f807ef92e6
commit b563dc0736
4 changed files with 64 additions and 27 deletions

View File

@@ -55,8 +55,10 @@ namespace swift {
bool triplesAreValidForZippering(const llvm::Triple &target,
const llvm::Triple &targetVariant);
/// Returns the VersionTuple at which Swift first became available for the OS
/// represented by `triple`.
const Optional<llvm::VersionTuple>
minimumABIStableOSVersionForTriple(const llvm::Triple &triple);
minimumAvailableOSVersionForTriple(const llvm::Triple &triple);
/// Returns true if the given triple represents an OS that has all the
/// "built-in" ABI-stable libraries (stdlib and _Concurrency)