[llvm] r197332 - Replace string matching with a switch on Triple::getEnvironment.

Joerg Sonnenberger joerg at bec.de
Sat Dec 14 16:12:53 PST 2013


Author: joerg
Date: Sat Dec 14 18:12:52 2013
New Revision: 197332

URL: http://llvm.org/viewvc/llvm-project?rev=197332&view=rev
Log:
Replace string matching with a switch on Triple::getEnvironment.

Modified:
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=197332&r1=197331&r2=197332&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Sat Dec 14 18:12:52 2013
@@ -189,11 +189,17 @@ void ARMSubtarget::resetSubtargetFeature
   // Initialize scheduling itinerary for the specified CPU.
   InstrItins = getInstrItineraryForCPU(CPUString);
 
-  if ((TargetTriple.getTriple().find("eabi") != std::string::npos) ||
-      (isTargetIOS() && isMClass()))
-    // FIXME: We might want to separate AAPCS and EABI. Some systems, e.g.
-    // Darwin-EABI conforms to AACPS but not the rest of EABI.
+  switch (TargetTriple.getEnvironment()) {
+  case Triple::EABI:
+  case Triple::GNUEABI:
+  case Triple::GNUEABIHF:
     TargetABI = ARM_ABI_AAPCS;
+    break;
+  default:
+    if (isTargetIOS() && isMClass())
+      TargetABI = ARM_ABI_AAPCS;
+    break;
+  }
 
   if (isAAPCS_ABI())
     stackAlignment = 8;





More information about the llvm-commits mailing list