"/../../.."));
}
+void Darwin::getMacosxVersionMin(const ArgList &Args,
+ unsigned (&Res)[3]) const {
+ if (Arg *A = Args.getLastArg(options::OPT_mmacosx_version_min_EQ)) {
+ bool HadExtra;
+ if (!Driver::GetReleaseVersion(A->getValue(Args), Res[0], Res[1], Res[2],
+ HadExtra) ||
+ HadExtra) {
+ const Driver &D = getHost().getDriver();
+ D.Diag(clang::diag::err_drv_invalid_version_number)
+ << A->getAsString(Args);
+ }
+ } else
+ return getMacosxVersion(Res);
+}
+
DerivedArgList *Darwin::TranslateArgs(InputArgList &Args,
const char *BoundArch) const {
DerivedArgList *DAL = new DerivedArgList(Args, false);
Res[2] = DarwinVersion[1];
}
+ /// getMacosxVersionMin - Get the effective -mmacosx-version-min, which is
+ /// either the -mmacosx-version-min, or the current version if unspecified.
+ void getMacosxVersionMin(const ArgList &Args, unsigned (&Res)[3]) const;
+
const char *getMacosxVersionStr() const {
return MacosxVersionMin.c_str();
}
CmdArgs.push_back(Output.getFilename());
unsigned MacosxVersionMin[3];
- if (Arg *A = Args.getLastArg(options::OPT_mmacosx_version_min_EQ)) {
- bool HadExtra;
- if (!Driver::GetReleaseVersion(A->getValue(Args), MacosxVersionMin[0],
- MacosxVersionMin[1], MacosxVersionMin[2],
- HadExtra) ||
- HadExtra) {
- const Driver &D = getToolChain().getHost().getDriver();
- D.Diag(clang::diag::err_drv_invalid_version_number)
- << A->getAsString(Args);
- }
- } else {
- getDarwinToolChain().getMacosxVersion(MacosxVersionMin);
- }
+ getDarwinToolChain().getMacosxVersionMin(Args, MacosxVersionMin);
if (!Args.hasArg(options::OPT_A) &&
!Args.hasArg(options::OPT_nostdlib) &&