]> granicus.if.org Git - clang/commitdiff
Replace use of Triple::getEnvironmentName with the simpler
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 12 Dec 2013 21:29:27 +0000 (21:29 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 12 Dec 2013 21:29:27 +0000 (21:29 +0000)
Triple::getEnvironment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index c09a85bd3d54de34e0aa63a5f140b8cdc364490d..45f0096564bdb931f9f17623f4f3a42019aa45ac 100644 (file)
@@ -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;