diff options
| author | Joerg Sonnenberger <joerg@bec.de> | 2013-12-12 21:29:27 +0000 |
|---|---|---|
| committer | Joerg Sonnenberger <joerg@bec.de> | 2013-12-12 21:29:27 +0000 |
| commit | 28d70e0cc4cd64a53f5a587cc79d70cbe571cfab (patch) | |
| tree | 971c4b557145e50f0ee655823c516fb9566743b3 /lib/CodeGen/TargetInfo.cpp | |
| parent | 0e869433eb6182be9f12d98632f48bc75084df71 (diff) | |
| download | clang-28d70e0cc4cd64a53f5a587cc79d70cbe571cfab.tar.gz clang-28d70e0cc4cd64a53f5a587cc79d70cbe571cfab.tar.bz2 clang-28d70e0cc4cd64a53f5a587cc79d70cbe571cfab.tar.xz | |
Replace use of Triple::getEnvironmentName with the simpler
Triple::getEnvironment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
| -rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index c09a85bd3d..45f0096564 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3071,9 +3071,14 @@ public: } bool isEABI() const { - StringRef Env = getTarget().getTriple().getEnvironmentName(); - return (Env == "gnueabi" || Env == "eabi" || - Env == "android" || Env == "androideabi"); + switch (getTarget().getTriple().getEnvironment()) { + case llvm::Triple::Android: + case llvm::Triple::EABI: + case llvm::Triple::GNUEABI: + return true; + default: + return false; + } } ABIKind getABIKind() const { return Kind; } @@ -3209,7 +3214,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().getEnvironmentName()=="gnueabihf") + if (getTarget().getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) return llvm::CallingConv::ARM_AAPCS_VFP; else if (isEABI()) return llvm::CallingConv::ARM_AAPCS; |
