Change the test for which ABI/CC to use on ARM to be base on the environment
(the last argument of the triple).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106131 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 0a88d9f..ae197fb 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -394,20 +394,13 @@
     ABIName = A->getValue(Args);
   } else {
     // Select the default based on the platform.
-    switch (getToolChain().getTriple().getOS()) {
-      // FIXME: Is this right for non-Darwin and non-Linux?
-    default:
-      ABIName = "aapcs";
-      break;
-
-    case llvm::Triple::Darwin:
-      ABIName = "apcs-gnu";
-      break;
-
-    case llvm::Triple::Linux:
+    llvm::StringRef env = getToolChain().getTriple().getEnvironmentName();
+    if (env == "gnueabi")
       ABIName = "aapcs-linux";
-      break;
-    }
+    else if (env == "eabi")
+      ABIName = "aapcs";
+    else
+      ABIName = "apcs-gnu";
   }
   CmdArgs.push_back("-target-abi");
   CmdArgs.push_back(ABIName);