From e43cfa1fdbf5b404a76e31f31b1505c7852a1967 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 29 Oct 2010 20:14:02 +0000 Subject: [PATCH] Switch to using the integrated assembler by default on x86 and x86-64 ELF systems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117697 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 8 ++++---- lib/Driver/ToolChains.h | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 9417a99786..126e3fd959 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1031,7 +1031,7 @@ Tool &TCEToolChain::SelectTool(const Compilation &C, /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly. OpenBSD::OpenBSD(const HostInfo &Host, const llvm::Triple& Triple) - : Generic_GCC(Host, Triple) { + : Generic_ELF(Host, Triple) { getFilePaths().push_back(getDriver().Dir + "/../lib"); getFilePaths().push_back("/usr/lib"); } @@ -1061,7 +1061,7 @@ Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA) const { /// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly. FreeBSD::FreeBSD(const HostInfo &Host, const llvm::Triple& Triple) - : Generic_GCC(Host, Triple) { + : Generic_ELF(Host, Triple) { // Determine if we are compiling 32-bit code on an x86_64 platform. bool Lib32 = false; @@ -1178,7 +1178,7 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA) const { /// Linux toolchain (very bare-bones at the moment). Linux::Linux(const HostInfo &Host, const llvm::Triple& Triple) - : Generic_GCC(Host, Triple) { + : Generic_ELF(Host, Triple) { getFilePaths().push_back(getDriver().Dir + "/../lib/clang/" CLANG_VERSION_STRING "/"); getFilePaths().push_back("/lib/"); @@ -1224,7 +1224,7 @@ Tool &Linux::SelectTool(const Compilation &C, const JobAction &JA) const { /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly. DragonFly::DragonFly(const HostInfo &Host, const llvm::Triple& Triple) - : Generic_GCC(Host, Triple) { + : Generic_ELF(Host, Triple) { // Path mangling to find libexec getProgramPaths().push_back(getDriver().getInstalledDir()); diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h index 3993cd2d3e..b98f1769c6 100644 --- a/lib/Driver/ToolChains.h +++ b/lib/Driver/ToolChains.h @@ -266,6 +266,18 @@ public: virtual const char *GetDefaultRelocationModel() const { return "pic"; } }; +class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Generic_GCC { + public: + Generic_ELF(const HostInfo &Host, const llvm::Triple& Triple) + : Generic_GCC(Host, Triple) {} + + virtual bool IsIntegratedAssemblerDefault() const { + // Default integrated assembler to on for x86. + return (getTriple().getArch() == llvm::Triple::x86 || + getTriple().getArch() == llvm::Triple::x86_64); + } +}; + class LLVM_LIBRARY_VISIBILITY AuroraUX : public Generic_GCC { public: AuroraUX(const HostInfo &Host, const llvm::Triple& Triple); @@ -273,14 +285,14 @@ public: virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; }; -class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_GCC { +class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF { public: OpenBSD(const HostInfo &Host, const llvm::Triple& Triple); virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; }; -class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_GCC { +class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF { public: FreeBSD(const HostInfo &Host, const llvm::Triple& Triple); @@ -294,14 +306,14 @@ public: virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; }; -class LLVM_LIBRARY_VISIBILITY DragonFly : public Generic_GCC { +class LLVM_LIBRARY_VISIBILITY DragonFly : public Generic_ELF { public: DragonFly(const HostInfo &Host, const llvm::Triple& Triple); virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; }; -class LLVM_LIBRARY_VISIBILITY Linux : public Generic_GCC { +class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF { public: Linux(const HostInfo &Host, const llvm::Triple& Triple); -- 2.40.0