[clang/mac] Make -mmacos-version-min the canonical spelling over -mmacosx-version-min

This was promised 5 years ago in https://reviews.llvm.org/D32796,
let's do it.

Both flags are still accepted. No behavior change except for which
form shows up in --help output and in dumps of internal state
(such as with RC_DEBUG_OPTIONS).

Differential Revision: https://reviews.llvm.org/D129226
This commit is contained in:
Nico Weber 2022-07-06 22:43:48 +02:00
parent 9ff10a0d62
commit d489268392
3 changed files with 9 additions and 9 deletions

View File

@ -3354,10 +3354,10 @@ def mmlir : Separate<["-"], "mmlir">, Flags<[CoreOption,FC1Option,FlangOption]>,
def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">, def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">, Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>; MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">, def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
Group<m_Group>, Alias<mmacosx_version_min_EQ>; Group<m_Group>, HelpText<"Set macOS deployment target">;
def : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, Alias<mmacos_version_min_EQ>;
def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>, def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">, HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">,
MarshallingInfoFlag<LangOpts<"MSBitfields">>; MarshallingInfoFlag<LangOpts<"MSBitfields">>;

View File

@ -1551,7 +1551,7 @@ struct DarwinPlatform {
options::ID Opt; options::ID Opt;
switch (Platform) { switch (Platform) {
case DarwinPlatformKind::MacOS: case DarwinPlatformKind::MacOS:
Opt = options::OPT_mmacosx_version_min_EQ; Opt = options::OPT_mmacos_version_min_EQ;
break; break;
case DarwinPlatformKind::IPhoneOS: case DarwinPlatformKind::IPhoneOS:
Opt = options::OPT_miphoneos_version_min_EQ; Opt = options::OPT_miphoneos_version_min_EQ;
@ -1727,7 +1727,7 @@ private:
Optional<DarwinPlatform> Optional<DarwinPlatform>
getDeploymentTargetFromOSVersionArg(DerivedArgList &Args, getDeploymentTargetFromOSVersionArg(DerivedArgList &Args,
const Driver &TheDriver) { const Driver &TheDriver) {
Arg *OSXVersion = Args.getLastArg(options::OPT_mmacosx_version_min_EQ); Arg *macOSVersion = Args.getLastArg(options::OPT_mmacos_version_min_EQ);
Arg *iOSVersion = Args.getLastArg(options::OPT_miphoneos_version_min_EQ, Arg *iOSVersion = Args.getLastArg(options::OPT_miphoneos_version_min_EQ,
options::OPT_mios_simulator_version_min_EQ); options::OPT_mios_simulator_version_min_EQ);
Arg *TvOSVersion = Arg *TvOSVersion =
@ -1736,15 +1736,15 @@ getDeploymentTargetFromOSVersionArg(DerivedArgList &Args,
Arg *WatchOSVersion = Arg *WatchOSVersion =
Args.getLastArg(options::OPT_mwatchos_version_min_EQ, Args.getLastArg(options::OPT_mwatchos_version_min_EQ,
options::OPT_mwatchos_simulator_version_min_EQ); options::OPT_mwatchos_simulator_version_min_EQ);
if (OSXVersion) { if (macOSVersion) {
if (iOSVersion || TvOSVersion || WatchOSVersion) { if (iOSVersion || TvOSVersion || WatchOSVersion) {
TheDriver.Diag(diag::err_drv_argument_not_allowed_with) TheDriver.Diag(diag::err_drv_argument_not_allowed_with)
<< OSXVersion->getAsString(Args) << macOSVersion->getAsString(Args)
<< (iOSVersion ? iOSVersion << (iOSVersion ? iOSVersion
: TvOSVersion ? TvOSVersion : WatchOSVersion) : TvOSVersion ? TvOSVersion : WatchOSVersion)
->getAsString(Args); ->getAsString(Args);
} }
return DarwinPlatform::createOSVersionArg(Darwin::MacOS, OSXVersion); return DarwinPlatform::createOSVersionArg(Darwin::MacOS, macOSVersion);
} else if (iOSVersion) { } else if (iOSVersion) {
if (TvOSVersion || WatchOSVersion) { if (TvOSVersion || WatchOSVersion) {
TheDriver.Diag(diag::err_drv_argument_not_allowed_with) TheDriver.Diag(diag::err_drv_argument_not_allowed_with)

View File

@ -9,7 +9,7 @@
// CHECK-SAME: flags: // CHECK-SAME: flags:
// CHECK-SAME: -I path\\ with\\ \\\\spaces // CHECK-SAME: -I path\\ with\\ \\\\spaces
// CHECK-SAME: -g -Os // CHECK-SAME: -g -Os
// CHECK-SAME: -mmacosx-version-min=10.5.0 // CHECK-SAME: -mmacos-version-min=10.5.0
int x; int x;