[lld-macho] Change constant std::vector to std::array (NFC)

This commit is contained in:
Daniel Bertalan 2022-09-04 22:43:02 +02:00
parent 8534f51474
commit 4f688d00f4
No known key found for this signature in database
2 changed files with 14 additions and 14 deletions

View File

@ -925,12 +925,12 @@ PlatformType macho::removeSimulator(PlatformType platform) {
}
static bool dataConstDefault(const InputArgList &args) {
static const std::vector<std::pair<PlatformType, VersionTuple>> minVersion = {
{PLATFORM_MACOS, VersionTuple(10, 15)},
{PLATFORM_IOS, VersionTuple(13, 0)},
{PLATFORM_TVOS, VersionTuple(13, 0)},
{PLATFORM_WATCHOS, VersionTuple(6, 0)},
{PLATFORM_BRIDGEOS, VersionTuple(4, 0)}};
static const std::array<std::pair<PlatformType, VersionTuple>, 5> minVersion =
{{{PLATFORM_MACOS, VersionTuple(10, 15)},
{PLATFORM_IOS, VersionTuple(13, 0)},
{PLATFORM_TVOS, VersionTuple(13, 0)},
{PLATFORM_WATCHOS, VersionTuple(6, 0)},
{PLATFORM_BRIDGEOS, VersionTuple(4, 0)}}};
PlatformType platform = removeSimulator(config->platformInfo.target.Platform);
auto it = llvm::find_if(minVersion,
[&](const auto &p) { return p.first == platform; });

View File

@ -680,14 +680,14 @@ void Writer::scanSymbols() {
// TODO: ld64 enforces the old load commands in a few other cases.
static bool useLCBuildVersion(const PlatformInfo &platformInfo) {
static const std::vector<std::pair<PlatformType, VersionTuple>> minVersion = {
{PLATFORM_MACOS, VersionTuple(10, 14)},
{PLATFORM_IOS, VersionTuple(12, 0)},
{PLATFORM_IOSSIMULATOR, VersionTuple(13, 0)},
{PLATFORM_TVOS, VersionTuple(12, 0)},
{PLATFORM_TVOSSIMULATOR, VersionTuple(13, 0)},
{PLATFORM_WATCHOS, VersionTuple(5, 0)},
{PLATFORM_WATCHOSSIMULATOR, VersionTuple(6, 0)}};
static const std::array<std::pair<PlatformType, VersionTuple>, 7> minVersion =
{{{PLATFORM_MACOS, VersionTuple(10, 14)},
{PLATFORM_IOS, VersionTuple(12, 0)},
{PLATFORM_IOSSIMULATOR, VersionTuple(13, 0)},
{PLATFORM_TVOS, VersionTuple(12, 0)},
{PLATFORM_TVOSSIMULATOR, VersionTuple(13, 0)},
{PLATFORM_WATCHOS, VersionTuple(5, 0)},
{PLATFORM_WATCHOSSIMULATOR, VersionTuple(6, 0)}}};
auto it = llvm::find_if(minVersion, [&](const auto &p) {
return p.first == platformInfo.target.Platform;
});