diff options
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 87927f8fb65..73105355f82 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -31,8 +31,7 @@ Darwin_X86::Darwin_X86(const HostInfo &Host, const char *Arch, const char *Platform, const char *OS, const unsigned (&_DarwinVersion)[3], const unsigned (&_GCCVersion)[3]) - : ToolChain(Host, Arch, Platform, OS) -{ + : ToolChain(Host, Arch, Platform, OS) { DarwinVersion[0] = _DarwinVersion[0]; DarwinVersion[1] = _DarwinVersion[1]; DarwinVersion[2] = _DarwinVersion[2]; @@ -422,3 +421,43 @@ Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA) const { return *T; } + +/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly. + +DragonFly::DragonFly(const HostInfo &Host, const char *Arch, + const char *Platform, const char *OS) + : Generic_GCC(Host, Arch, Platform, OS) { + + // Path mangling to find libexec + std::string Path(getHost().getDriver().Dir); + + Path += "/../libexec"; + getProgramPaths().push_back(Path); + getProgramPaths().push_back(getHost().getDriver().Dir); + + getFilePaths().push_back(getHost().getDriver().Dir + "/../lib"); + getFilePaths().push_back("/usr/lib"); + getFilePaths().push_back("/usr/lib/gcc41"); +} + +Tool &DragonFly::SelectTool(const Compilation &C, const JobAction &JA) const { + Action::ActionClass Key; + if (getHost().getDriver().ShouldUseClangCompiler(C, JA, getArchName())) + Key = Action::AnalyzeJobClass; + else + Key = JA.getKind(); + + Tool *&T = Tools[Key]; + if (!T) { + switch (Key) { + case Action::AssembleJobClass: + T = new tools::dragonfly::Assemble(*this); break; + case Action::LinkJobClass: + T = new tools::dragonfly::Link(*this); break; + default: + T = &Generic_GCC::SelectTool(C, JA); + } + } + + return *T; +} |

