diff options
author | Bob Wilson <bob.wilson@apple.com> | 2011-02-04 17:59:28 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2011-02-04 17:59:28 +0000 |
commit | fc2bd7c3efed6756a030d58a5f6ae31947e7d451 (patch) | |
tree | cec11a40bad84db292c873bbb914218044f8892c /lib/Driver/Tools.cpp | |
parent | 2843c1900b6da763885f47d0999e923e7c67fd65 (diff) |
Add better support for ARM EABI triples.
Patch by Renato Golin!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2cbf43e0e6..f0a142fe0e 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -428,13 +428,16 @@ void Clang::AddARMTargetArgs(const ArgList &Args, ABIName = A->getValue(Args); } else { // Select the default based on the platform. - llvm::StringRef env = Triple.getEnvironmentName(); - if (env == "gnueabi") + switch(Triple.getEnvironment()) { + case llvm::Triple::GNUEABI: ABIName = "aapcs-linux"; - else if (env == "eabi") + break; + case llvm::Triple::EABI: ABIName = "aapcs"; - else + break; + default: ABIName = "apcs-gnu"; + } } CmdArgs.push_back("-target-abi"); CmdArgs.push_back(ABIName); @@ -481,8 +484,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args, } case llvm::Triple::Linux: { - llvm::StringRef Env = getToolChain().getTriple().getEnvironmentName(); - if (Env == "gnueabi") { + if (getToolChain().getTriple().getEnvironment() == llvm::Triple::GNUEABI) { FloatABI = "softfp"; break; } @@ -490,10 +492,20 @@ void Clang::AddARMTargetArgs(const ArgList &Args, // fall through default: - // Assume "soft", but warn the user we are guessing. - FloatABI = "soft"; - D.Diag(clang::diag::warn_drv_assuming_mfloat_abi_is) << "soft"; - break; + switch(Triple.getEnvironment()) { + case llvm::Triple::GNUEABI: + FloatABI = "softfp"; + break; + case llvm::Triple::EABI: + // EABI is always AAPCS, and if it was not marked 'hard', it's softfp + FloatABI = "softfp"; + break; + default: + // Assume "soft", but warn the user we are guessing. + FloatABI = "soft"; + D.Diag(clang::diag::warn_drv_assuming_mfloat_abi_is) << "soft"; + break; + } } } |