[next] Use new VersionTuple API

The `VersionTuple` API was changed llvm/llvm-project
219672b8dd06c4765185fa3161c98437d49b4a1b to return `VersionTuple`
from `get*Version` rather than pass in major, minor, and subminor output
parameters. Update uses to the new API.

Note that `getMacOSXVersion` is slightly different in that it returns a
boolean while taking a `VersionTuple` output parameter to match its
previous behaviour. There doesn't seem to be any use that actually
checks this value though, so we should either update the API to return
an `Optional` and actually check it *or* remove the "failure" case and
return a `VersionTuple` like all the others.
This commit is contained in:
Ben Barham
2022-04-25 17:00:51 -07:00
parent 68296c9037
commit 114b4d96e4
8 changed files with 71 additions and 85 deletions

View File

@@ -852,12 +852,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
// 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);
else
triple.getOSVersion(major, minor, patch);
return llvm::VersionTuple(major, minor, patch);
if (triple.isMacOSX()) {
llvm::VersionTuple OSVersion;
triple.getMacOSXVersion(OSVersion);
return OSVersion;
}
return triple.getOSVersion();
};
Opts.MinimumInliningTargetVersion =
@@ -2365,9 +2365,8 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
// silently override "auto" to "never" when back-deploying. This approach
// sacrifices async backtraces when back-deploying but prevents crashes in
// older tools that cannot handle the async frame bit in the frame pointer.
unsigned major, minor, micro;
Triple.getWatchOSVersion(major, minor, micro);
if (major < 8)
llvm::VersionTuple OSVersion = Triple.getWatchOSVersion();
if (OSVersion.getMajor() < 8)
Opts.SwiftAsyncFramePointer = SwiftAsyncFramePointerKind::Never;
}