diff options
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index ad1c362b5f..4e34dc5e18 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -45,8 +45,9 @@ using namespace clang; /// Darwin - Darwin tool chain for i386 and x86_64. -Darwin::Darwin(const Driver &D, const llvm::Triple& Triple) - : ToolChain(D, Triple), TargetInitialized(false), +Darwin::Darwin(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : ToolChain(D, Triple, UserTriple), TargetInitialized(false), ARCRuntimeForSimulator(ARCSimulator_None), LibCXXForSimulator(LibCXXSimulator_None) { @@ -250,8 +251,9 @@ Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA, } -DarwinClang::DarwinClang(const Driver &D, const llvm::Triple& Triple) - : Darwin(D, Triple) +DarwinClang::DarwinClang(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Darwin(D, Triple, UserTriple) { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) @@ -1387,8 +1389,9 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( } } -Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple) - : ToolChain(D, Triple), GCCInstallation(getDriver(), Triple) { +Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : ToolChain(D, Triple, UserTriple), GCCInstallation(getDriver(), Triple) { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); @@ -1458,8 +1461,9 @@ const char *Generic_GCC::GetForcedPicModel() const { } /// Hexagon Toolchain -Hexagon_TC::Hexagon_TC(const Driver &D, const llvm::Triple& Triple) - : ToolChain(D, Triple) { +Hexagon_TC::Hexagon_TC(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : ToolChain(D, Triple, UserTriple) { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir.c_str()) getProgramPaths().push_back(getDriver().Dir); @@ -1528,8 +1532,9 @@ const char *Hexagon_TC::GetForcedPicModel() const { /// all subcommands. See http://tce.cs.tut.fi for our peculiar target. /// Currently does not support anything else but compilation. -TCEToolChain::TCEToolChain(const Driver &D, const llvm::Triple& Triple) - : ToolChain(D, Triple) { +TCEToolChain::TCEToolChain(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : ToolChain(D, Triple, UserTriple) { // Path mangling to find libexec std::string Path(getDriver().Dir); @@ -1581,8 +1586,9 @@ Tool &TCEToolChain::SelectTool(const Compilation &C, /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly. -OpenBSD::OpenBSD(const Driver &D, const llvm::Triple& Triple) - : Generic_ELF(D, Triple) { +OpenBSD::OpenBSD(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { getFilePaths().push_back(getDriver().Dir + "/../lib"); getFilePaths().push_back("/usr/lib"); } @@ -1621,8 +1627,9 @@ Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA, /// FreeBSD - FreeBSD tool chain which can call as(1) and ld(1) directly. -FreeBSD::FreeBSD(const Driver &D, const llvm::Triple& Triple) - : Generic_ELF(D, Triple) { +FreeBSD::FreeBSD(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall // back to '/usr/lib' if it doesn't exist. @@ -1667,8 +1674,9 @@ Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA, /// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly. -NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple) - : Generic_ELF(D, Triple) { +NetBSD::NetBSD(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { if (getDriver().UseStdLib) { // When targeting a 32-bit platform, try the special directory used on @@ -1718,8 +1726,9 @@ Tool &NetBSD::SelectTool(const Compilation &C, const JobAction &JA, /// Minix - Minix tool chain which can call as(1) and ld(1) directly. -Minix::Minix(const Driver &D, const llvm::Triple& Triple) - : Generic_ELF(D, Triple) { +Minix::Minix(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { getFilePaths().push_back(getDriver().Dir + "/../lib"); getFilePaths().push_back("/usr/lib"); } @@ -1749,8 +1758,9 @@ Tool &Minix::SelectTool(const Compilation &C, const JobAction &JA, /// AuroraUX - AuroraUX tool chain which can call as(1) and ld(1) directly. -AuroraUX::AuroraUX(const Driver &D, const llvm::Triple& Triple) - : Generic_GCC(D, Triple) { +AuroraUX::AuroraUX(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_GCC(D, Triple, UserTriple) { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) @@ -1965,8 +1975,9 @@ static void addPathIfExists(Twine Path, ToolChain::path_list &Paths) { if (llvm::sys::fs::exists(Path)) Paths.push_back(Path.str()); } -Linux::Linux(const Driver &D, const llvm::Triple &Triple) - : Generic_ELF(D, Triple) { +Linux::Linux(const Driver &D, const llvm::Triple &Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { llvm::Triple::ArchType Arch = Triple.getArch(); const std::string &SysRoot = getDriver().SysRoot; @@ -2274,8 +2285,9 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly. -DragonFly::DragonFly(const Driver &D, const llvm::Triple& Triple) - : Generic_ELF(D, Triple) { +DragonFly::DragonFly(const Driver &D, const llvm::Triple& Triple, + const std::string &UserTriple) + : Generic_ELF(D, Triple, UserTriple) { // Path mangling to find libexec getProgramPaths().push_back(getDriver().getInstalledDir()); |