]> granicus.if.org Git - clang/commitdiff
Begin refactoring to use the newly added triple predicates for
authorChandler Carruth <chandlerc@gmail.com>
Sat, 11 Feb 2012 03:31:12 +0000 (03:31 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 11 Feb 2012 03:31:12 +0000 (03:31 +0000)
simplicity. Also addresses a FIXME, although not one that could be
observed.

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

lib/Driver/ToolChains.cpp
lib/Driver/ToolChains.h

index 716e78de286722a6890f22bb1bae6441e4644ba2..00f8c1be87a9cb2fdc2694b7ee044f41910f2670 100644 (file)
@@ -2001,12 +2001,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple)
   // to the link paths.
   path_list &Paths = getFilePaths();
 
-  const bool Is32Bits = (Arch == llvm::Triple::x86 ||
-                         Arch == llvm::Triple::mips ||
-                         Arch == llvm::Triple::mipsel ||
-                         Arch == llvm::Triple::ppc);
-
-  const std::string Multilib = Is32Bits ? "lib32" : "lib64";
+  const std::string Multilib = Triple.isArch32Bit() ? "lib32" : "lib64";
   const std::string MultiarchTriple = getMultiarchTriple(Triple, SysRoot);
 
   // Add the multilib suffixed paths where they are available.
index 071a36774d10feb2bcff05ac98b1d3740ced5092..c454db553bbb91df72b2b19c33d20554999ceb43 100644 (file)
@@ -134,13 +134,10 @@ protected:
   /// @{
 
   /// \brief Check whether the target triple's architecture is 64-bits.
-  bool isTarget64Bit() const {
-    return (getTriple().getArch() == llvm::Triple::x86_64 ||
-            getTriple().getArch() == llvm::Triple::ppc64);
-  }
+  bool isTarget64Bit() const { return getTriple().isArch64Bit(); }
+
   /// \brief Check whether the target triple's architecture is 32-bits.
-  /// FIXME: This should likely do more than just negate the 64-bit query.
-  bool isTarget32Bit() const { return !isTarget64Bit(); }
+  bool isTarget32Bit() const { return getTriple().isArch32Bit(); }
 
   /// @}
 };