[cfe-commits] r140964 - /cfe/trunk/lib/Driver/ToolChains.cpp
Chandler Carruth
chandlerc at gmail.com
Sun Oct 2 00:06:57 PDT 2011
Author: chandlerc
Date: Sun Oct 2 02:06:48 2011
New Revision: 140964
URL: http://llvm.org/viewvc/llvm-project?rev=140964&view=rev
Log:
Consolidate the currently bizarre 32/64 multilib selection logic a bit.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=140964&r1=140963&r2=140964&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sun Oct 2 02:06:48 2011
@@ -1554,26 +1554,7 @@
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 @@
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;
More information about the cfe-commits
mailing list