summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Unify Options.td and CC1Options.td, in a first step towards unifying the ↵James Molloy2012-05-011-1/+1
| | | | | | | | serialization logic in Frontend and Driver. Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/ llvm-svn: 155916
* [driver] Don't try to set the deployment target when there is no boundChad Rosier2012-04-271-3/+2
| | | | | | | | | architecture; this was happening for tools such as lipo and dsymutil. Also, if no -arch option has been specified, set the architecture based on the TC default. rdar://11329656 llvm-svn: 155730
* Fix logic such that we only call getToolChain once. No functional changeChad Rosier2012-04-271-1/+3
| | | | | | intended. llvm-svn: 155719
* Remove redundant calls to BAA->getArchName(). No functional changeChad Rosier2012-04-271-2/+3
| | | | | | intended. llvm-svn: 155718
* In r135308, -save-temps was modified to prevent a temporary file fromChad Rosier2012-04-201-7/+16
| | | | | | | | | | | | | | | | overwriting the input file. For example, clang -c foo.s -o foo.o -save-temps Unfortunately, the original patch didn't compare the paths of the input and output files. Thus, something like the following would fail to create foo.s. cd /tmp/obj clang -c ../src/foo.s -o foo.o -save-temps rdar://11252615 llvm-svn: 155224
* When generating the clang crash diagnostic script, strip out the -o flag.Chad Rosier2012-04-201-2/+3
| | | | | | | Add a FIXME comment. rdar://11283560 llvm-svn: 155207
* Add a little hack to emulate a clang crash, so the diagnostics generator can beChad Rosier2012-04-201-1/+1
| | | | | | tested. llvm-svn: 155205
* When generating the clang crash diagnostic script, strip out the -D, -F, and -IChad Rosier2012-04-201-0/+14
| | | | | | | | | | flags. We have preprocessed source, so we don't need these. No test case as it's fairly difficult to make the compiler crash on demand. I'll patiently wait for Ben to tell me how to do this in 2 lines of code. :) rdar://11283560 llvm-svn: 155180
* use DEFAULT_SYSROOTSebastian Pop2012-04-161-5/+3
| | | | llvm-svn: 154792
* Correct indentationDavid Blaikie2012-04-151-22/+22
| | | | llvm-svn: 154774
* [driver] In general, the driver claims redundant args and uses the last arg.Chad Rosier2012-04-071-0/+1
| | | | | | | | However, the '-x' option has special handling and wasn't following this paradigm. Fix it to do so by claiming the arg as we parse the '-x' option. rdar://11203340 llvm-svn: 154231
* Use -rewrite-legacy-objc as clang argument for translating Fariborz Jahanian2012-04-021-0/+3
| | | | | | | objective-c's fragile abi, Use -rewrite-objc for translating objective-c's modern abi. // rdar://11143173 llvm-svn: 153877
* Update FIXME.Bill Wendling2012-03-121-1/+1
| | | | llvm-svn: 152579
* [driver] Don't try to generate diagnostic information for linker crashes.Chad Rosier2012-03-071-0/+4
| | | | | | rdar://10993648 llvm-svn: 152180
* Whitespace.Chad Rosier2012-03-061-1/+1
| | | | llvm-svn: 152159
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-0/+3
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
* Revert part of r148839 and keep DefaultTargetTriple in the form adjustedJoerg Sonnenberger2012-02-221-0/+6
| | | | | | | | | | by -target and similar options. As discussed in PR 12026, the change broke support for target-prefixed tools, i.e. calling x86_64--linux-ld when compiling for x86_64--linux. Improve the test cases added originally in r149083 to not require execution, just executable files. Document the hack with appropiate FIXME comments. llvm-svn: 151185
* [driver] Add a warning for when -mcpu= is specified without an argument. ThereChad Rosier2012-02-221-0/+6
| | | | | | | are likely many other OPT_xxxx_EQ options that could/should be added here. rdar://10704648 llvm-svn: 151174
* Provide a way to disable auto-generation of preprocessed files during clang Chad Rosier2012-02-221-0/+3
| | | | | | | crash. This can speedup the process of generating a delta reduced test case. rdar://10905465 llvm-svn: 151109
* Fixing the working-directory option so that it stores the proper directory.Aaron Ballman2012-02-201-5/+7
| | | | llvm-svn: 150960
* Implement a -gcc-toolchain command line option that does the same asRafael Espindola2012-02-191-10/+10
| | | | | | | configure's --with-gcc-toolchain. The configure option is now just a default value for the command line one. llvm-svn: 150898
* First pass at Solaris toolchain support. This version compiles and links helloDavid Chisnall2012-02-151-0/+3
| | | | | | | | world on Solaris 11 for both x86 and x86-64 using the built-in assembler and Solaris (not GNU) ld, however it currently relies on a hard-coded GCC location to find crtbegin.o and crtend.o, as well as libgcc and libgcc_eh. llvm-svn: 150580
* include clang's config.h unconditionally (v2)Dylan Noblesmith2012-02-141-5/+2
| | | | | | | | | | And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. Reverts r149571/restores r149504, now that config.h is generated correctly by LLVM's configure in all build configurations. llvm-svn: 150487
* When generating diagnostic information due to a clang failure, allow multipleChad Rosier2012-02-131-9/+10
| | | | | | | | | -arch options if the're all the same. Patch by Jeremy Huddleston. rdar://10849701 llvm-svn: 150403
* Correct comment Clang C++ use in production.David Blaikie2012-02-091-1/+1
| | | | | | | | | | This was from way-back-when (r82583) when Clang's C++ support wasn't prime-time yet. Production quality C++ was tested experimentally from r100119 and turned on by default in r141063. Patch by Justin Bogner. llvm-svn: 150148
* Rewrite the debug action handling to take -verify into account.Eric Christopher2012-02-061-18/+16
| | | | | | | Add a quiet option for dwarfdump and move it out of NDEBUG only. Still requires an option as we don't want this on by default. llvm-svn: 149894
* Update the command line here and update the comment, we're just goingEric Christopher2012-02-061-3/+2
| | | | | | to leave this as a debug only option for now. llvm-svn: 149890
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-3/+3
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* back out r149504Dylan Noblesmith2012-02-021-2/+5
| | | | | | Too many weird build failures. llvm-svn: 149571
* include clang's config.h unconditionallyDylan Noblesmith2012-02-011-5/+2
| | | | | | | | | | | | | And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. (clang r149497 / llvm r149498) Also include the config.h header after all other headers, per the LLVM coding standards. It also turns out WindowsToolChain.cpp wasn't using the config header at all, so that include's just deleted now. llvm-svn: 149504
* Revert r149083 which is not the direction we're going in the ClangChandler Carruth2012-01-311-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | driver based on discussions with Doug Gregor. There are several issues: 1) The patch was not reviewed prior to commit and there were review comments. 2) The design of the functionality (triple-prefixed tool invocation) isn't the design we want for Clang going forward: it focuses on the "user triple" rather than on the "toolchain triple", and forces that bit of state into the API of every single toolchain instead of handling it automatically in the common base classes. 3) The tests provided are not stable. They fail on a few Linux variants (Gentoo among them) and on mingw32 and some other environments. I *am* interested in the Clang driver being able to invoke triple-prefixed tools, but we need to design that feature the right way. This patch just extends the previous hack without fixing the underlying problems with it. I'm working on a new design for this that I will mail for review by tomorrow. I am aware that this removes functionality that NetBSD relies on, but this is ToT, not a release. This functionality hasn't been properly designed, implemented, and tested yet. We can't "regress" until we get something that really works, both with the immediate use cases and with long term maintenance of the Clang driver. For reference, the original commit log: Keep track of the original target the user specified before normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. llvm-svn: 149337
* Keep track of the original target the user specified beforeJoerg Sonnenberger2012-01-261-22/+24
| | | | | | | | | | normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. llvm-svn: 149083
* Restore a tiny bit of functionality that I completely overlooked in theChandler Carruth2012-01-251-1/+4
| | | | | | | | | | Linux toolchain selection -- sorry folks. =] This should fix the Hexagon toolchain. However, I would point out that I see why my testing didn't catch this -- we have no tests for Hexagon. ;] llvm-svn: 148977
* Remove the 'ToolTriple' concept from the NetBSD toolchain along with myChandler Carruth2012-01-251-1/+1
| | | | | | | | | | | | | | | | gross hack to provide it from my previous patch removing HostInfo. This was enshrining (and hiding from my searches) the concept of storing and diff-ing the host and target triples. We don't have the host triple reliably available, so we need to merely inspect the target system. I've changed the logic in selecting library search paths for NetBSD to match what I provided for FreeBSD -- we include both search paths, but put the 32-bit-on-64-bit-host path first so it trumps. NetBSD maintainers, you may want to tweak this, or feel free to ask me to tweak it. I've left a FIXME here about the challeng I see in fixing this properly. llvm-svn: 148952
* Delete still more remnants of the now dead HostInfo. The janitoring willChandler Carruth2012-01-251-1/+0
| | | | | | continue until cleanliness improves. llvm-svn: 148951
* Delete the driver's HostInfo class. This abstraction just never reallyChandler Carruth2012-01-251-53/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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! llvm-svn: 148950
* Remove the TargetTriple object that I added to the Driver recently. ThisChandler Carruth2012-01-251-12/+12
| | | | | | | | | | | | | | | helped stage the refactoring of things a bit, but really isn't the right place for it. The driver may be responsible for compilations with many different targets. In those cases, having a target triple in the driver is actively misleading because for many of those compilations that is not actually the triple being targeted. This moves the last remaining users of the Driver's target triple to instead use the ToolChain's target triple. The toolchain has a single, concrete target it operates over, making this a more stable and natural home for it. llvm-svn: 148942
* Start hoisting the logic for computing the target triple into its ownChandler Carruth2012-01-241-8/+14
| | | | | | | | | | | | | | | | | | | | | | function. The logic for this, and I want to emphasize that this is the logic for computing the *target* triple, is currently scattered throughout various different HostInfo classes ToolChain factoring functions. Best part, it is largely *duplicated* there. The goal is to hoist all of that up to here where we can deal with it once, and in a consistent manner. Unfortunately, this uncovers more fun problems: the ToolChains assume that the *actual* target triple is the one passed into them by these factory functions, while the *host* triple is the one in the driver. This already was a lie, and a damn lie, when the '-target' flag was specified. It only really worked when the difference stemmed from '-m32' and '-m64' flags. I'll have to fix that (and remove all the FIXMEs I've introduced here to document the problem) before I can finish hoisting the target-calculation logic. It's bugs all the way down today it seems... llvm-svn: 148839
* Remove HostInfo::useDriverDriver(). This was only used in two placesChandler Carruth2012-01-241-4/+6
| | | | | | | | | | | | 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. llvm-svn: 148797
* Hoist the targeted triple object into an actual object in the Driver.Chandler Carruth2012-01-241-3/+7
| | | | | | | | | The Driver has a fixed target, whether we like it or not, the DefaultTargetTriple is not a default. This at least makes things more honest. I'll eventually get rid of most (if not all) of DefaultTargetTriple with this proper triple object. Bit of a WIP. llvm-svn: 148796
* rename -ccc-host-triple into -targetSebastian Pop2012-01-201-1/+1
| | | | llvm-svn: 148582
* Fix 80-column violation.Chad Rosier2012-01-141-1/+2
| | | | llvm-svn: 148162
* Revert r148138; it's causing test failures.Eli Friedman2012-01-131-1/+1
| | | | llvm-svn: 148141
* rename -ccc-host-triple into -targetSebastian Pop2012-01-131-1/+1
| | | | llvm-svn: 148138
* rename DefaultHostTriple into DefaultTargetTripleSebastian Pop2012-01-131-5/+5
| | | | llvm-svn: 148137
* [Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from ↵NAKAMURA Takumi2011-11-291-1/+7
| | | | | | | | | | | | the driver. clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused. llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value. Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception. llvm-svn: 145389
* Teach the driver about failure result files, which are compilationPeter Collingbourne2011-11-211-1/+6
| | | | | | | | output files that are valid regardless of whether the compilation succeeded or failed (but not if we crash). Add depfiles to the failure result file list. llvm-svn: 145018
* Driver: Remove the signal number from the "command failed" diagnostic.Benjamin Kramer2011-11-191-1/+1
| | | | | | | - With the current implementation of sys::Program this always printed "2". - The command execution code will output the right number anyway (including the signal name). llvm-svn: 144993
* [driver] If we're only linking, don't warn about unused arguments which areChad Rosier2011-11-051-2/+3
| | | | | | | obviously only used during compilation. rdar://10386708 llvm-svn: 143813
OpenPOWER on IntegriCloud