aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/HostInfo.cpp
AgeCommit message (Collapse)Author
2012-01-25Delete the driver's HostInfo class. This abstraction just never reallyChandler Carruth
did anything. The two big pieces of functionality it tried to provide was to cache the ToolChain objects for each target, and to figure out the exact target based on the flag set coming in to an invocation. However, it had a lot of flaws even with those goals: - Neither of these have anything to do with the host, or its info. - The HostInfo class was setup as a full blown class *hierarchy* with a separate implementation for each "host" OS. This required dispatching just to create the objects in the first place. - The hierarchy claimed to represent the host, when in fact it was based on the target OS. - Each leaf in the hierarchy was responsible for implementing the flag processing and caching, resulting in a *lot* of copy-paste code and quite a few bugs. - The caching was consistently done based on architecture alone, even though *any* aspect of the targeted triple might change the behavior of the configured toolchain. - Flag processing was already being done in the Driver proper, separating the flag handling even more than it already is. Instead of this, we can simply have the dispatch logic in the Driver which previously created a HostInfo object create the ToolChain objects. Adding caching in the Driver layer is a tiny amount of code. Finally, pulling the flag processing into the Driver puts it where it belongs and consolidates it in one location. The result is that two functions, and maybe 100 lines of new code replace over 10 classes and 800 lines of code. Woot. This also paves the way to introduce more detailed ToolChain objects for various OSes without threading through a new HostInfo type as well, and the accompanying boiler plate. That, of course, was the yak I started to shave that began this entire refactoring escapade. Wheee! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148950 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25Switch the ToolChain types to all store a Driver reference rather thanChandler Carruth
a HostInfo reference. Nothing about the HostInfo was used by any toolchain except digging out the driver from it. This just makes that a lot more direct. The change was accomplished entirely mechanically. It's one step closer to removing the shim full of buggy copy/paste code that is HostInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148945 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24Remove HostInfo::useDriverDriver(). This was only used in two placesChandler Carruth
inside the innards of the Driver implementation, and only ever implemented to return 'true' for the Darwin OSes. Instead use a more direct query on the target triple and a comment to document why the target matters here. If anyone is worried about this predicate getting wider use or improper use, I can make it a local or private predicate in the driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Hexagon backend supportTony Linthicum
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Typo spotted by Ivan Krasin.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16Make the triple an explicit argument of FindTargetProgramPath.Joerg Sonnenberger
Preserve the original triple in the NetBSD toolchain when using -m32 or -m64 and the resulting effective target is different from the triple it started with. This allows -m32 to use the same assembler/linking in cross-compiling mode and avoids confusion about passing down target specific flags in that case like --32. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18Driver/Darwin: Kill the DarwinGCC toolchain.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02Add NetBSD target support. Patch by Joerg Sonnenberger.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124736 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01Remove stray emacs mode marker.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Reapply "Driver/Darwin: Time for another spin at switching to the DarwinClang",Daniel Dunbar
now that eprintf symbol issue is resolved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Revert "Driver/Darwin: Time for another spin at switching to the DarwinClangDaniel Dunbar
toolchain.", while I investigate the totally non-surprising ensuing breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Driver/Darwin: Time for another spin at switching to the DarwinClang toolchain.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26Driver/Darwin: Switch back to old toolchain, looks like new one isn't quiteDaniel Dunbar
ready yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26Driver: Fix thinko where I switched to always using the old toolchain, insteadDaniel Dunbar
of always using the new toolchain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23Driver/Darwin: Switch to using simplified tool chain by default -- what betterDaniel Dunbar
way to see what will break! :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21Visual Studio tools used on win32 hosts when targeting win32.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10Driver/FreeBSD: Infer the right arch name in the presence of -m32,-m64, for theDaniel Dunbar
cases we care about. - This is eventually going to be unified outside the host specific code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver/Darwin: Change where Darwin computes the host version, to normalize toolDaniel Dunbar
chain construction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver/Darwin: Inline some constants.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize toolDaniel Dunbar
chain construction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Move HostInfo::lookupTypeForExtension to ↵Daniel Dunbar
ToolChain::LookupTypeForExtension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07add driver support for minix, patch by Kees van ReeuwijkChris Lattner
from PR7583 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26Driver/Darwin: Support CCC_ENABLE_NEW_DARWIN_TOOLCHAIN as an environmentDaniel Dunbar
override to enable use of the DarwinClang tool chain on all platforms (not just ARM). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08Remove redundant semicolonDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04add TCE target support, patch by Pekka J!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27Driver/Darwin: Eliminate confusing IsIPhoneOS parameter -- this was actuallyDaniel Dunbar
just indicating whether the default target should be iPhoneOS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27Driver/Darwin: Track target platform more explicitly in tool chain, eventuallyDaniel Dunbar
this should just be part of the tool chain itself once we have eliminated argument translation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Use Option::matches instead of direct ID comparison.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07Revert r83443.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07Fixup pathnames.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18Split Darwin toolchain into Clang and GCC Darwin toolchains with a common base.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Change Darwin toolchain lookup to use llvm::Triple.Daniel Dunbar
- -2+1 FIXMEs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Rename HostInfo::getToolChain to HostInfo::CreateToolChain, and don't recreateDaniel Dunbar
the default tool chain when binding the default architecture. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Delete trailing whitespace.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04Darwin: Pass -iphoneos-version-min to ld when building for ARM.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-22Second half of, clang, AuroraUX toolchain support.Edward O'Callaghan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29OpenBSD support.Daniel Dunbar
- Patch by Jonathan Gray! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16Fix typo in prev commit.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16Darwin/Driver: Also look at -arch command line options when finding the defaultDaniel Dunbar
tool chain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03PR4308: Fix support for -m32/-m64 on Linux.Eli Friedman
I'll look into cleaning this up a bit as a followup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-28ARM is a legitimate Darwin architecture; don't assert.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-26Fix for PR4140: Add the start of a Linux toolchain (basically, just Eli Friedman
barely enough to get the given usage of -print-file-name working). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-23Fix use after free, found by Benjamin Kramer.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22(llvm up) Use llvm::Triple for storing target triples.Daniel Dunbar
- This commit has some messy stuff in it to extend string lifetimes, but that will go away once we switch to using the enum'd Triple interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02DragonFly ToolChain definition for driver.Daniel Dunbar
- Patch by Alex Hornung! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Quick and dirty (!) fix to make sure we use powerpc in triples.Daniel Dunbar
- PR3922 - I have a clean solution for this in flight, but it may take a while to come to fruition so we'll take a quick fix for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30Comment fix.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30Driver: Sketch FreeBSD tool chain.Daniel Dunbar
- Patch by Ed Schouten! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68061 91177308-0d34-0410-b5e6-96231b3b80d8