mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #41940 from tshortli/target-min-inlining-version-min-by-default
Assume `-target-min-inlining-version min` for `-library-level api` modules
This commit is contained in:
@@ -804,17 +804,15 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
// First, set up default minimum inlining target versions.
|
||||
auto getDefaultMinimumInliningTargetVersion =
|
||||
[&](const llvm::Triple &triple) -> llvm::VersionTuple {
|
||||
#if SWIFT_DEFAULT_TARGET_MIN_INLINING_VERSION_TO_MIN
|
||||
// In ABI-stable modules, default to the version when Swift first became
|
||||
// available.
|
||||
if (FrontendOpts.EnableLibraryEvolution)
|
||||
// In API modules, default to the version when Swift first became available.
|
||||
if (Opts.LibraryLevel == LibraryLevel::API)
|
||||
if (auto minTriple = minimumAvailableOSVersionForTriple(triple))
|
||||
return minTriple;
|
||||
#endif
|
||||
return *minTriple;
|
||||
|
||||
// In ABI-unstable modules, we will never have to interoperate with
|
||||
// older versions of the module, so we should default to the minimum
|
||||
// deployment target.
|
||||
// In other modules, assume that availability is used less consistently
|
||||
// and that library clients will generally raise deployment targets as the
|
||||
// library evolves so the min inlining version should be the deployment
|
||||
// target by default.
|
||||
unsigned major, minor, patch;
|
||||
if (triple.isMacOSX())
|
||||
triple.getMacOSXVersion(major, minor, patch);
|
||||
|
||||
Reference in New Issue
Block a user