]> granicus.if.org Git - clang/commitdiff
Delete a simplistic helper function now that llvm::Triple can provide
authorChandler Carruth <chandlerc@gmail.com>
Mon, 13 Feb 2012 02:02:09 +0000 (02:02 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 13 Feb 2012 02:02:09 +0000 (02:02 +0000)
this functionality.

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

lib/Driver/ToolChains.cpp

index 00f8c1be87a9cb2fdc2694b7ee044f41910f2670..8c7158f0bffae5d03f42ea698fbaa3cfe304688b 100644 (file)
@@ -1091,18 +1091,6 @@ bool Generic_GCC::GCCVersion::operator<(const GCCVersion &RHS) const {
   return false;
 }
 
-// FIXME: Factor this helper into llvm::Triple itself.
-static llvm::Triple getMultiarchAlternateTriple(llvm::Triple Triple) {
-  switch (Triple.getArch()) {
-  default: break;
-  case llvm::Triple::x86:    Triple.setArchName("x86_64");    break;
-  case llvm::Triple::x86_64: Triple.setArchName("i386");      break;
-  case llvm::Triple::ppc:    Triple.setArchName("powerpc64"); break;
-  case llvm::Triple::ppc64:  Triple.setArchName("powerpc");   break;
-  }
-  return Triple;
-}
-
 /// \brief Construct a GCCInstallationDetector from the driver.
 ///
 /// This performs all of the autodetection and sets up the various paths.
@@ -1116,7 +1104,9 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(
     const Driver &D,
     const llvm::Triple &TargetTriple)
     : IsValid(false) {
-  llvm::Triple MultiarchTriple = getMultiarchAlternateTriple(TargetTriple);
+  llvm::Triple MultiarchTriple
+    = TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant()
+                                 : TargetTriple.get32BitArchVariant();
   llvm::Triple::ArchType TargetArch = TargetTriple.getArch();
   // The library directories which may contain GCC installations.
   SmallVector<StringRef, 4> CandidateLibDirs, CandidateMultiarchLibDirs;