summaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
Commit message (Collapse)AuthorAge
* Include system_error directly.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210802 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210780 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210422 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-04
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210145 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate DefaultImageName from the Driver constructorAlp Toker2014-05-15
| | | | | | | | | | | | All callers were passing in "a.out" or garbage so a sensible default works fine here as a cleanup. This also brings about the possibility of adapting the value based on the driver's compatibility mode in future. The setting can still be changed via Driver::DefaultImageName as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208926 91177308-0d34-0410-b5e6-96231b3b80d8
* Check for LLVM_ON_WIN32 instead of _WIN32.Hans Wennborg2014-03-12
| | | | | | This is a follow-up to r203624 to address Anton's comment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203668 91177308-0d34-0410-b5e6-96231b3b80d8
* Be case sensitive when determining driver mode based on argv[0] except on ↵Hans Wennborg2014-03-11
| | | | | | | | | Windows This narrows the impact of r188833 after Dimitry pointed out that it's good to be able to tell the difference between 'cc' and 'CC'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203624 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203389 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-07
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202625 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for the QA_OVERRIDE_GCC3_OPTIONS environment variable.Bob Wilson2014-02-23
| | | | | | | | | | In r199283 I switched the name of this variable to CCC_OVERRIDE_OPTIONS, but I kept some code to continue recognizing the old name temporarily. As far as I know, the only use of this was for some internal testing at Apple, and we've now switched to use the new name. If anyone else is still using this and needs more time to switch names, I guess we'll find out! <rdar://problem/15821425> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201962 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename QA_OVERRIDE_GCC3_OPTIONS to CCC_OVERRIDE_OPTIONS. <rdar://14578381>Bob Wilson2014-01-15
| | | | | | | Continue to accept the old name for a while to make it an easier transition for people who rely on this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199283 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-07
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch modified ExeBasename as clang-cl.exe to match the preceding comment.Yaron Keren2013-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194170 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Use the canonical command line arguments.David Majnemer2013-10-07
| | | | | | | | | | | | | | | Summary: Use the arguments given to the OS at process creation-time instead of the arguments passed into main() by the C runtime environment. The ones that main() received may not be suitable (e.g. not Unicode). Depends on D1834 CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1835 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192091 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Use "clang cl.exe" when disambiguating the diagnostic prefix.Reid Kleckner2013-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189909 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Avoid confusing diagnostics when clang-cl is called just cl.exeReid Kleckner2013-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189901 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix iterator invalidation. PR16935.Eli Friedman2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188835 91177308-0d34-0410-b5e6-96231b3b80d8
* Look at lowercase version of argv[0] when determining driver modeHans Wennborg2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188833 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove misleading comment about using cc1 option table.Hans Wennborg2013-08-08
| | | | | | There hasn't been a separate cc1 option table since r155916. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187993 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.Rafael Espindola2013-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186983 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a cl.exe compatible driver modeHans Wennborg2013-07-19
| | | | | | | The mode doesn't actually do anything yet, but this provides a way to get into it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186720 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,Hans Wennborg2013-07-18
| | | | | | | | | | | | and add a new option --driver-mode= to control it explicitly. The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there are currently really three modes that Clang can run in: gcc, g++ or cpp, so it makes sense to represent them as an enum. Having a command line flag to control it helps testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186605 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Use LLVM's response file parser because it can read UTF-16Reid Kleckner2013-07-18
| | | | | | | | | | | | MSBuild writes response files as UTF-16 little endian with a byte order mark. With this change, clang will be able to read them, although we still can't parse any of their flags. Adds a UTF-16-LE response file with a BOM for testing. Differential Revision: http://llvm-reviews.chandlerc.com/D1137 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186603 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 186302 to fix build bots.Craig Topper2013-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186305 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186302 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused header.Rafael Espindola2013-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184937 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184915 91177308-0d34-0410-b5e6-96231b3b80d8
* Include PathV1.h only where it is used.Rafael Espindola2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184090 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-14
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183989 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm change.Rafael Espindola2013-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183930 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the global functions instead of the Program methods.Rafael Espindola2013-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183861 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a FIXME that's not planned to be fixed. We only generated crashChad Rosier2013-03-26
| | | | | | | diagnostics for the first failing command. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178086 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: do not strip file extensions when printing diagnostics.Benjamin Kramer2013-03-10
| | | | | | | | | | Before: clang-3: error: no input files After: clang-3.3: error: no input files This means that we'll also print clang.exe on windows, but I don't see a problem with that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176788 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Handle the processing of the QA_OVERRIDE_GCC3_OPTIONS and CCC_ADD_ARGSChad Rosier2013-02-21
| | | | | | | | before the DiagnosticsEngine is instantiated. Otherwise, warning options are not handled correctly. rdar://13254743 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175779 91177308-0d34-0410-b5e6-96231b3b80d8
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-08
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Refactor the driver so that a failing commands doesn't preventChad Rosier2013-01-29
| | | | | | | | | | | subsequent commands from being executed. The diagnostics generation isn't designed for this use case, so add a note to fix this in the very near future. For now, just generated the diagnostics for the first failing command. Part of rdar://12984531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173825 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier2013-01-15
| | | | | | | | | | driver needs to process the warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172497 91177308-0d34-0410-b5e6-96231b3b80d8
* Produce an actual error before attempting to attach notes to it when bailing outRichard Smith2012-12-25
| | | | | | | due to FORCE_CLANG_DIAGNOSTICS_CRASH=1. Also add a test for that env var. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171074 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | Completely automated with sort_includes.py git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag andRafael Espindola2012-11-27
| | | | | | is not used in any #ifdef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168703 91177308-0d34-0410-b5e6-96231b3b80d8
* If we encounter a fatal error, exit with status 70. For BSD systems this isChad Rosier2012-11-12
| | | | | | | | | defined as an internal software error. This notifies the driver to report diagnostics information. rdar://11951540 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167754 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-23
| | | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
* Just revert r163605 for now. It broke the build and had someChandler Carruth2012-09-11
| | | | | | questionable elements to the patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163609 91177308-0d34-0410-b5e6-96231b3b80d8
* Select the correct, or, failing that, compatible, dialect when invoked as cc,David Chisnall2012-09-11
| | | | | | | | | c89, c99, and so on. No change to the default dialect when invoked as clang / clang++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163605 91177308-0d34-0410-b5e6-96231b3b80d8
* [Win32] Rework crash-report since r145389.NAKAMURA Takumi2012-07-17
| | | | | | | | | | | - lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions. - test/Driver/crash-report.c: Add REQUIRES:shell for now. FIXME: setenv should work also on Lit.InternalShellRunner. - test/Driver/crash-report.c: Remove XFAIL. Thanks to Chad, To point out the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160343 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify Options.td and CC1Options.td, in a first step towards unifying the ↵James Molloy2012-05-01
| | | | | | | | | | serialization logic in Frontend and Driver. Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155916 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a little hack to emulate a clang crash, so the diagnostics generator can beChad Rosier2012-04-20
| | | | | | tested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155205 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Parse diagnostic args in the driver.Chad Rosier2012-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only diagnostics thrown by the cc1 process were actually honoring the diagnostic options given on the command line, like -Werror. Reuse the existing code in Frontend currently used for cc1, adjusting it to not interpret -Wl, linker flags as warnings. Also fix a faulty test exposed by this change. It wasn't actually testing anything, and was giving this warning: clang-3: warning: argument unused during compilation: '-verify' Which -Werror didn't turn into an error because it was output by the driver, not the cc1 process, and diagnostic options weren't parsed by the driver. And you couldn't see the warning when running the test suite. Fixes PR12181. Patch by Dylan Noblesmith <nobled@dreamwidth.org>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-20
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8