aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-10-02 07:06:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-10-02 07:06:48 +0000
commitbc0df7240851f46f07c1a356aa7d1aee26115c31 (patch)
tree54d494790071e69e7c543071e5d2c07c77bb842d /lib/Driver/ToolChains.cpp
parent3c2b5f7d6102bd1878c4ce7fcdd8f67ec9c37064 (diff)
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
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r--lib/Driver/ToolChains.cpp38
1 files 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;