mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -79,15 +79,15 @@ static bool areCompatibleOSs(const llvm::Triple &moduleTarget,
|
||||
|
||||
static bool isTargetTooNew(const llvm::Triple &moduleTarget,
|
||||
const llvm::Triple &ctxTarget) {
|
||||
unsigned major, minor, micro;
|
||||
|
||||
if (moduleTarget.isMacOSX()) {
|
||||
moduleTarget.getMacOSXVersion(major, minor, micro);
|
||||
return ctxTarget.isMacOSXVersionLT(major, minor, micro);
|
||||
llvm::VersionTuple osVersion;
|
||||
moduleTarget.getMacOSXVersion(osVersion);
|
||||
// TODO: Add isMacOSXVersionLT(Triple) API (or taking a VersionTuple)
|
||||
return ctxTarget.isMacOSXVersionLT(osVersion.getMajor(),
|
||||
osVersion.getMinor().getValueOr(0),
|
||||
osVersion.getSubminor().getValueOr(0));
|
||||
}
|
||||
|
||||
moduleTarget.getOSVersion(major, minor, micro);
|
||||
return ctxTarget.isOSVersionLT(major, minor, micro);
|
||||
return ctxTarget.isOSVersionLT(moduleTarget);
|
||||
}
|
||||
|
||||
ModuleFile::ModuleFile(std::shared_ptr<const ModuleFileSharedCore> core)
|
||||
|
||||
Reference in New Issue
Block a user