[PATCH] D41035: [driver][darwin] Refactor the target selection code, NFC
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 8 15:01:33 PST 2017
dexonsmith added a comment.
This seems correct to me. I wouldn't mind having someone else back me up though.
Also, I have a suggestion for a `static_assert`.
================
Comment at: lib/Driver/ToolChains/Darwin.cpp:1334-1339
+ const char *EnvVars[Darwin::LastDarwinPlatform + 1] = {
+ "MACOSX_DEPLOYMENT_TARGET",
+ "IPHONEOS_DEPLOYMENT_TARGET",
+ "TVOS_DEPLOYMENT_TARGET",
+ "WATCHOS_DEPLOYMENT_TARGET",
+ };
----------------
It would be nice to have a `static_assert` that `EnvVars` has the right number of elements. Perhaps something like this would work:
```
const char *EnvVars[] = { /* etc. */ };
static_assert(std::end(EnvVars) - std::begin(EndVars) == Darwin::LastDarwinPlatform + 1,
"missing platform");
```
Repository:
rC Clang
https://reviews.llvm.org/D41035
More information about the cfe-commits
mailing list