diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-02-11 03:31:12 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-02-11 03:31:12 +0000 |
commit | d747efaad80117799ff7e2ab10608f18ee1348c1 (patch) | |
tree | 0f70c089add4727959ced9f109f47b55eaf417be | |
parent | cec5ebd4a6a89a7023d04cec728fd340b541ed61 (diff) |
Begin refactoring to use the newly added triple predicates for
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
-rw-r--r-- | lib/Driver/ToolChains.cpp | 7 | ||||
-rw-r--r-- | lib/Driver/ToolChains.h | 9 |
2 files changed, 4 insertions, 12 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 716e78de28..00f8c1be87 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -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. diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 071a36774d..c454db553b 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -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(); } /// @} }; |