Use getArch instead of getArchName + string compare.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165370 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 54f8c42..7b6e208 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -713,11 +713,11 @@
     if (A->getOption().matches(options::OPT_Xarch__)) {
       // Skip this argument unless the architecture matches either the toolchain
       // triple arch, or the arch being bound.
-      //
-      // FIXME: Canonicalize name.
-      StringRef XarchArch = A->getValue(Args, 0);
-      if (!(XarchArch == getArchName()  ||
-            (BoundArch && XarchArch == BoundArch)))
+      llvm::Triple::ArchType XarchArch =
+        llvm::Triple::getArchTypeForDarwinArchName(A->getValue(Args, 0));
+      if (!(XarchArch == getArch()  ||
+            (BoundArch && XarchArch ==
+             llvm::Triple::getArchTypeForDarwinArchName(BoundArch))))
         continue;
 
       Arg *OriginalArg = A;
@@ -975,14 +975,14 @@
 }
 
 const char *Darwin::GetForcedPicModel() const {
-  if (getArchName() == "x86_64")
+  if (getArch() == llvm::Triple::x86_64)
     return "pic";
   return 0;
 }
 
 bool Darwin::SupportsProfiling() const {
   // Profiling instrumentation is only supported on x86.
-  return getArchName() == "i386" || getArchName() == "x86_64";
+  return getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::x86_64;
 }
 
 bool Darwin::SupportsObjCGC() const {