From bc0df7240851f46f07c1a356aa7d1aee26115c31 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 2 Oct 2011 07:06:48 +0000 Subject: [PATCH] Consolidate the currently bizarre 32/64 multilib selection logic a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140964 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 91699c3d05..7fea2c0c18 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1554,26 +1554,7 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) llvm::Triple::ArchType Arch = llvm::Triple(getDriver().DefaultHostTriple).getArch(); - std::string Suffix32 = ""; - if (Arch == llvm::Triple::x86_64) - Suffix32 = "/32"; - - std::string Suffix64 = ""; - if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc) - Suffix64 = "/64"; - - std::string Lib32 = "lib"; - bool Exists; - if (!llvm::sys::fs::exists("/lib32", Exists) && Exists) - Lib32 = "lib32"; - - std::string Lib64 = "lib"; - bool Symlink; - if (!llvm::sys::fs::exists("/lib64", Exists) && Exists && - (llvm::sys::fs::is_symlink("/lib64", Symlink) || !Symlink)) - Lib64 = "lib64"; - std::string GccTriple = ""; if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) { if (!llvm::sys::fs::exists("/usr/lib/gcc/arm-linux-gnueabi", Exists) && @@ -1649,6 +1630,25 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple) bool Is32Bits = (getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::ppc); + std::string Suffix32 = ""; + if (Arch == llvm::Triple::x86_64) + Suffix32 = "/32"; + + std::string Suffix64 = ""; + if (Is32Bits) + Suffix64 = "/64"; + + std::string Lib32 = "lib"; + + if (!llvm::sys::fs::exists("/lib32", Exists) && Exists) + Lib32 = "lib32"; + + std::string Lib64 = "lib"; + bool Symlink; + if (!llvm::sys::fs::exists("/lib64", Exists) && Exists && + (llvm::sys::fs::is_symlink("/lib64", Symlink) || !Symlink)) + Lib64 = "lib64"; + std::string Suffix; std::string Lib; -- 2.40.0