From: Tim Northover Date: Tue, 20 Aug 2013 13:13:38 +0000 (+0000) Subject: ARM: default to arm1176jzf-s for hard-float platforms. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f16f2d057f5e0795ead9306a27b394d5a52e8b6;p=clang ARM: default to arm1176jzf-s for hard-float platforms. It makes no sense to try and compile for arm7tdmi when we're targeting something like gnueabihf. Although not strictly the most basic hardware conceivable, I believe arm1176jzf-s is a reasonable compromise (that can always be overridden explicitly if needed) since it's still in reasonably common use unlike earlier cores. Patch by Stephen Kelly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188796 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index ca74395955..ad8482d21d 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -180,7 +180,7 @@ static const char *getARMTargetCPU(const ArgList &Args, MArch = Triple.getArchName(); } - return llvm::StringSwitch(MArch) + const char *result = llvm::StringSwitch(MArch) .Cases("armv2", "armv2a","arm2") .Case("armv3", "arm6") .Case("armv3m", "arm7m") @@ -207,7 +207,15 @@ static const char *getARMTargetCPU(const ArgList &Args, .Case("xscale", "xscale") // If all else failed, return the most base CPU with thumb interworking // supported by LLVM. - .Default("arm7tdmi"); + .Default(0); + + if (result) + return result; + + return + Triple.getEnvironment() == llvm::Triple::GNUEABIHF + ? "arm1176jzf-s" + : "arm7tdmi"; } /// getLLVMArchSuffixForARM - Get the LLVM arch name to use for a particular