r197181 - Replace use of Triple::getEnvironmentName with the simpler

Joerg Sonnenberger joerg at bec.de
Thu Dec 12 13:29:28 PST 2013


Author: joerg
Date: Thu Dec 12 15:29:27 2013
New Revision: 197181

URL: http://llvm.org/viewvc/llvm-project?rev=197181&view=rev
Log:
Replace use of Triple::getEnvironmentName with the simpler
Triple::getEnvironment.

Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=197181&r1=197180&r2=197181&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Thu Dec 12 15:29:27 2013
@@ -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(CGFunctionI
 /// 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;





More information about the cfe-commits mailing list