From: Daniel Dunbar Date: Tue, 26 Jan 2010 03:56:40 +0000 (+0000) Subject: Simplify. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=314cba02728c451c783b38bf6c00f220afb193c8;p=clang Simplify. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94503 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 89478d5f15..82fdf825d0 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -67,8 +67,6 @@ class VISIBILITY_HIDDEN Darwin : public ToolChain { /// The default iphoneos-version-min of this tool chain. std::string IPhoneOSVersionMin; - const char *getMacosxVersionMin() const; - public: Darwin(const HostInfo &Host, const llvm::Triple& Triple, const unsigned (&DarwinVersion)[3], bool IsIPhoneOS); @@ -112,14 +110,6 @@ public: return isMacosxVersionLT(A, B); } - const char *getMacosxVersionStr() const { - return MacosxVersionMin.c_str(); - } - - const char *getIPhoneOSVersionStr() const { - return IPhoneOSVersionMin.c_str(); - } - /// AddLinkSearchPathArgs - Add the linker search paths to \arg CmdArgs. /// /// \param Args - The input argument list. diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 61b4ee675e..edacafa49b 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1948,20 +1948,11 @@ void darwin::Link::AddLinkArgs(const ArgList &Args, Args.AddAllArgs(CmdArgs, options::OPT_image__base); Args.AddAllArgs(CmdArgs, options::OPT_init); - if (!Args.hasArg(options::OPT_mmacosx_version_min_EQ) && - !Args.hasArg(options::OPT_miphoneos_version_min_EQ)) { - // Add default version min. - if (!getDarwinToolChain().isIPhoneOS()) { - CmdArgs.push_back("-macosx_version_min"); - CmdArgs.push_back(getDarwinToolChain().getMacosxVersionStr()); - } else { - CmdArgs.push_back("-iphoneos_version_min"); - CmdArgs.push_back(getDarwinToolChain().getIPhoneOSVersionStr()); - } - } - - // Adding all arguments doesn't make sense here but this is what - // gcc does. + // Adding all arguments doesn't make sense here but this is what gcc does. One + // of this should always be present thanks to argument translation. + assert((Args.hasArg(options::OPT_mmacosx_version_min_EQ) || + Args.hasArg(options::OPT_miphoneos_version_min_EQ)) && + "Missing version argument (lost in translation)?"); Args.AddAllArgsTranslated(CmdArgs, options::OPT_mmacosx_version_min_EQ, "-macosx_version_min"); Args.AddAllArgsTranslated(CmdArgs, options::OPT_miphoneos_version_min_EQ,