diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
commit | 1928da94b55683957759d5c5ff4593a118773394 (patch) | |
tree | 48b44512b5db8ced345df4a1a56b5065cf2a14d9 /lib/Driver/HostInfo.cpp | |
parent | 53992adde3eda3ccf9da63bc7e45673f043de18f (diff) | |
download | FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.zip FreeBSD-src-1928da94b55683957759d5c5ff4593a118773394.tar.gz |
Update clang to r108243.
Diffstat (limited to 'lib/Driver/HostInfo.cpp')
-rw-r--r-- | lib/Driver/HostInfo.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/Driver/HostInfo.cpp b/lib/Driver/HostInfo.cpp index d9e2e37..0636d9e 100644 --- a/lib/Driver/HostInfo.cpp +++ b/lib/Driver/HostInfo.cpp @@ -425,6 +425,58 @@ ToolChain *FreeBSDHostInfo::CreateToolChain(const ArgList &Args, return TC; } +// Minix Host Info + +/// MinixHostInfo - Minix host information implementation. +class MinixHostInfo : public HostInfo { + /// Cache of tool chains we have created. + mutable llvm::StringMap<ToolChain*> ToolChains; + +public: + MinixHostInfo(const Driver &D, const llvm::Triple& Triple) + : HostInfo(D, Triple) {} + ~MinixHostInfo(); + + virtual bool useDriverDriver() const; + + virtual types::ID lookupTypeForExtension(const char *Ext) const { + return types::lookupTypeForExtension(Ext); + } + + virtual ToolChain *CreateToolChain(const ArgList &Args, + const char *ArchName) const; +}; + +MinixHostInfo::~MinixHostInfo() { + for (llvm::StringMap<ToolChain*>::iterator + it = ToolChains.begin(), ie = ToolChains.end(); it != ie; ++it){ + delete it->second; + } +} + +bool MinixHostInfo::useDriverDriver() const { + return false; +} + +ToolChain *MinixHostInfo::CreateToolChain(const ArgList &Args, + const char *ArchName) const { + assert(!ArchName && + "Unexpected arch name on platform without driver driver support."); + + std::string Arch = getArchName(); + ArchName = Arch.c_str(); + + ToolChain *&TC = ToolChains[ArchName]; + if (!TC) { + llvm::Triple TCTriple(getTriple()); + TCTriple.setArchName(ArchName); + + TC = new toolchains::Minix(*this, TCTriple); + } + + return TC; +} + // DragonFly Host Info /// DragonFlyHostInfo - DragonFly host information implementation. @@ -566,6 +618,12 @@ clang::driver::createFreeBSDHostInfo(const Driver &D, } const HostInfo * +clang::driver::createMinixHostInfo(const Driver &D, + const llvm::Triple& Triple) { + return new MinixHostInfo(D, Triple); +} + +const HostInfo * clang::driver::createDragonFlyHostInfo(const Driver &D, const llvm::Triple& Triple) { return new DragonFlyHostInfo(D, Triple); |