summaryrefslogtreecommitdiff
path: root/lib/Driver/HostInfo.cpp
Commit message (Collapse)AuthorAge
* Delete the driver's HostInfo class. This abstraction just never reallyChandler Carruth2012-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch the ToolChain types to all store a Driver reference rather thanChandler Carruth2012-01-25
| | | | | | | | | | 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
* Remove HostInfo::useDriverDriver(). This was only used in two placesChandler Carruth2012-01-24
| | | | | | | | | | | | 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
* Hexagon backend supportTony Linthicum2011-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo spotted by Ivan Krasin.Chad Rosier2011-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138200 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the triple an explicit argument of FindTargetProgramPath.Joerg Sonnenberger2011-05-16
| | | | | | | | | | | 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
* Driver/Darwin: Kill the DarwinGCC toolchain.Daniel Dunbar2011-03-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127896 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NetBSD target support. Patch by Joerg Sonnenberger.Benjamin Kramer2011-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124736 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove stray emacs mode marker.Nick Lewycky2010-12-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120554 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "Driver/Darwin: Time for another spin at switching to the DarwinClang",Daniel Dunbar2010-09-17
| | | | | | now that eprintf symbol issue is resolved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114166 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Driver/Darwin: Time for another spin at switching to the DarwinClangDaniel Dunbar2010-09-17
| | | | | | 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
* Driver/Darwin: Time for another spin at switching to the DarwinClang toolchain.Daniel Dunbar2010-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114149 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/Darwin: Switch back to old toolchain, looks like new one isn't quiteDaniel Dunbar2010-08-26
| | | | | | ready yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112138 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Fix thinko where I switched to always using the old toolchain, insteadDaniel Dunbar2010-08-26
| | | | | | of always using the new toolchain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112125 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/Darwin: Switch to using simplified tool chain by default -- what betterDaniel Dunbar2010-08-23
| | | | | | way to see what will break! :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111840 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual Studio tools used on win32 hosts when targeting win32.Michael J. Spencer2010-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111748 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/FreeBSD: Infer the right arch name in the presence of -m32,-m64, for theDaniel Dunbar2010-08-10
| | | | | | | 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
* Driver/Darwin: Change where Darwin computes the host version, to normalize toolDaniel Dunbar2010-08-02
| | | | | | chain construction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110028 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/Darwin: Inline some constants.Daniel Dunbar2010-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110026 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize toolDaniel Dunbar2010-08-02
| | | | | | chain construction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110025 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Move HostInfo::lookupTypeForExtension to ↵Daniel Dunbar2010-08-02
| | | | | | ToolChain::LookupTypeForExtension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110024 91177308-0d34-0410-b5e6-96231b3b80d8
* add driver support for minix, patch by Kees van ReeuwijkChris Lattner2010-07-07
| | | | | | | from PR7583 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/Darwin: Support CCC_ENABLE_NEW_DARWIN_TOOLCHAIN as an environmentDaniel Dunbar2010-03-26
| | | | | | | 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
* Remove redundant semicolonDouglas Gregor2010-03-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97930 91177308-0d34-0410-b5e6-96231b3b80d8
* add TCE target support, patch by Pekka J!Chris Lattner2010-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97746 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/Darwin: Eliminate confusing IsIPhoneOS parameter -- this was actuallyDaniel Dunbar2010-01-27
| | | | | | 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
* Driver/Darwin: Track target platform more explicitly in tool chain, eventuallyDaniel Dunbar2010-01-27
| | | | | | | 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
* Use Option::matches instead of direct ID comparison.Daniel Dunbar2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89305 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r83443.Ted Kremenek2009-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83451 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup pathnames.Mike Stump2009-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8
* Split Darwin toolchain into Clang and GCC Darwin toolchains with a common base.Daniel Dunbar2009-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82213 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Darwin toolchain lookup to use llvm::Triple.Daniel Dunbar2009-09-08
| | | | | | - -2+1 FIXMEs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81282 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename HostInfo::getToolChain to HostInfo::CreateToolChain, and don't recreateDaniel Dunbar2009-09-08
| | | | | | 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
* Delete trailing whitespace.Daniel Dunbar2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81278 91177308-0d34-0410-b5e6-96231b3b80d8
* Darwin: Pass -iphoneos-version-min to ld when building for ARM.Daniel Dunbar2009-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81019 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.Daniel Dunbar2009-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81016 91177308-0d34-0410-b5e6-96231b3b80d8
* Second half of, clang, AuroraUX toolchain support.Edward O'Callaghan2009-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79713 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenBSD support.Daniel Dunbar2009-06-29
| | | | | | | - Patch by Jonathan Gray! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in prev commit.Daniel Dunbar2009-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73556 91177308-0d34-0410-b5e6-96231b3b80d8
* Darwin/Driver: Also look at -arch command line options when finding the defaultDaniel Dunbar2009-06-16
| | | | | | | tool chain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73555 91177308-0d34-0410-b5e6-96231b3b80d8
* PR4308: Fix support for -m32/-m64 on Linux.Eli Friedman2009-06-03
| | | | | | | | 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
* ARM is a legitimate Darwin architecture; don't assert.Eli Friedman2009-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72538 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR4140: Add the start of a Linux toolchain (basically, just Eli Friedman2009-05-26
| | | | | | | | 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
* Fix use after free, found by Benjamin Kramer.Daniel Dunbar2009-05-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72333 91177308-0d34-0410-b5e6-96231b3b80d8
* (llvm up) Use llvm::Triple for storing target triples.Daniel Dunbar2009-05-22
| | | | | | | | - 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
* DragonFly ToolChain definition for driver.Daniel Dunbar2009-05-02
| | | | | | | - Patch by Alex Hornung! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70635 91177308-0d34-0410-b5e6-96231b3b80d8
* Quick and dirty (!) fix to make sure we use powerpc in triples.Daniel Dunbar2009-04-01
| | | | | | | | | | - 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
* Comment fix.Daniel Dunbar2009-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68069 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Sketch FreeBSD tool chain.Daniel Dunbar2009-03-30
| | | | | | | - Patch by Ed Schouten! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68061 91177308-0d34-0410-b5e6-96231b3b80d8