From e13e3bbf3d31b755050c62c0c66cc53cab498670 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Mon, 16 Dec 2013 19:16:04 +0000 Subject: [PATCH] Support EABIHF environment on ARM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197406 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/TargetInfo.cpp | 13 ++++++++++++- lib/Driver/Tools.cpp | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 7879207a2c..6b756457e8 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3074,6 +3074,7 @@ public: switch (getTarget().getTriple().getEnvironment()) { case llvm::Triple::Android: case llvm::Triple::EABI: + case llvm::Triple::EABIHF: case llvm::Triple::GNUEABI: case llvm::Triple::GNUEABIHF: return true; @@ -3082,6 +3083,16 @@ public: } } + bool isEABIHF() const { + switch (getTarget().getTriple().getEnvironment()) { + case llvm::Triple::EABIHF: + case llvm::Triple::GNUEABIHF: + return true; + default: + return false; + } + } + ABIKind getABIKind() const { return Kind; } private: @@ -3215,7 +3226,7 @@ void ARMABIInfo::computeInfo(CGFunctionInfo &FI) const { /// Return the default calling convention that LLVM will use. llvm::CallingConv::ID ARMABIInfo::getLLVMDefaultCC() const { // The default calling convention that LLVM will infer. - if (getTarget().getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) + if (isEABIHF()) return llvm::CallingConv::ARM_AAPCS_VFP; else if (isEABI()) return llvm::CallingConv::ARM_AAPCS; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index d32a422adb..bd0d864ed7 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -652,6 +652,9 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args, case llvm::Triple::GNUEABI: FloatABI = "softfp"; break; + case llvm::Triple::EABIHF: + FloatABI = "hard"; + break; case llvm::Triple::EABI: // EABI is always AAPCS, and if it was not marked 'hard', it's softfp FloatABI = "softfp"; @@ -757,6 +760,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args, case llvm::Triple::GNUEABIHF: ABIName = "aapcs-linux"; break; + case llvm::Triple::EABIHF: case llvm::Triple::EABI: ABIName = "aapcs"; break; -- 2.40.0