summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Speculatively fix GCC 4.7 build after r219938Hans Wennborg2014-10-161-1/+1
| | | | llvm-svn: 219941
* Use iterators and algorithms to possibly make this code a bit tidierDavid Blaikie2014-10-161-16/+12
| | | | | | | | | | | | | (also, the code executed once the element was found was split half inside the loop and half after it - now put it all together after the find operation) I'm a bit concerned that this code is rather untested (commenting out this whole function and running check-clang doesn't fail any tests)... And I wish I had polymorphic lambdas. llvm-svn: 219938
* Use array_lengthof; NFC.Hans Wennborg2014-10-161-1/+1
| | | | llvm-svn: 219935
* driver: Map closed standard file descriptors to /dev/nullDavid Majnemer2014-10-061-0/+3
| | | | | | | | Utilize Process::FixupStandardFileDescriptors, introduced in r219170, to guard against files from being treated as one of the standard file descriptors. llvm-svn: 219174
* Use the simpler version of llvm::sys::fs::exists.Rafael Espindola2014-09-111-2/+1
| | | | | | | In all these cases it looks like the intention was to handle error in a similar way to the file not existing. llvm-svn: 217614
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-301-1/+1
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216824
* Fix PR17239 by changing the semantics of the RemainingArgsClass Option kindReid Kleckner2014-08-221-2/+27
| | | | | | | | | | | | | | | | | | | | | | | This patch aims at fixing PR17239. This bug happens because the /link (clang-cl.exe argument) is marked as "consume all remaining arguments". However, when inside a response file, /link should only consume all remaining arguments inside the response file where it is located, not the entire command line after expansion. The LLVM side of the patch will change the semantics of the RemainingArgsClass kind to always consume only until the end of the response file when the option originally came from a response file. There are only two options in this class: dash dash (--) and /link. This is the Clang side of the patch in http://reviews.llvm.org/D4899 Reviewered By: rafael, rnk Differential Revision: http://reviews.llvm.org/D4900 Patch by Rafael Auler! llvm-svn: 216281
* Revert "Update for LLVM change (StringSaver)"Sean Silva2014-08-151-2/+13
| | | | | | | | | This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97. LLD has some StringSavers that need to be updated. One of which takes a lock and I need to investigate that more closely. llvm-svn: 215791
* Update for LLVM change (StringSaver)Sean Silva2014-08-151-13/+2
| | | | | | | | There is more cleanup to be done here. Once llvm::sys::Process::GetArgumentVector is switched over to StringSaver, we can simplify this code a fair amount. llvm-svn: 215785
* Rename as suggested by dblaikieSean Silva2014-08-151-2/+2
| | | | llvm-svn: 215774
* ArrayRef'izeSean Silva2014-08-151-9/+8
| | | | | | | I've shied away from ArrayRef'izing CompilerInvocation::CreateFromArgs in this commit because that is a less localized change. llvm-svn: 215773
* Rename this function to better reflect its purposeSean Silva2014-08-151-2/+2
| | | | | | Thanks to dblaikie for the impetus to look for a better name. llvm-svn: 215767
* [cleanup] Rename this function to better reflect its purpose. NFC.Sean Silva2014-08-151-9/+9
| | | | | | | | | | This also suggests some refactoring to simplify this code. Basically, a ton of complexity in this argument handling code comes from the need to save const char *'s in stable storage for pushing onto argv. It seems like llvm::cl::StringSaver can be improved to cover all the needs here. llvm-svn: 215761
* [cleanup] Range-for'ify this loop. NFC.Sean Silva2014-08-151-4/+3
| | | | llvm-svn: 215760
* [cleanup] Factor out handling CC1 tools. NFC.Sean Silva2014-08-151-14/+15
| | | | llvm-svn: 215759
* [cleanup] Factor out setting the driver's install dir. NFC.Sean Silva2014-08-151-20/+22
| | | | llvm-svn: 215756
* [cleanup] Factor out initializing the DianosticOptions. NFC.Sean Silva2014-08-151-13/+19
| | | | llvm-svn: 215755
* [cleanup] Factor out adjusting "cl.exe" to "clang-cl.exe". NFC.Sean Silva2014-08-151-7/+11
| | | | llvm-svn: 215754
* [cleanup] Factor out some checks. NFC.Sean Silva2014-08-151-14/+18
| | | | | | | | | | | The core logic in main() is actually pretty simple, but there's lots of stuff that has been added over time which obscures the flow of the code. In upcoming patches, I'll be pulling more stuff out of the main codepath. I'm open to naming suggestions for these helper functions. llvm-svn: 215751
* Driver: Produce crash diagnostics more often on WindowsReid Kleckner2014-07-071-2/+7
| | | | | | | | | | | | | Assertion failures call abort(), which return an exit code of 3 on Windows. The 'not' utility has the same check. Unfortunately, the crash-report.c test requires a shell, so it does not run for me locally, so I can only test this manually. There's still more work to be done here: we should generate a batch script instead of a shell script on Windows. llvm-svn: 212481
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-1/+1
| | | | llvm-svn: 211987
* Include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210802
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210780
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-081-5/+5
| | | | llvm-svn: 210422
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-041-1/+1
| | | | | | | | | | | | 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. llvm-svn: 210145
* Eliminate DefaultImageName from the Driver constructorAlp Toker2014-05-151-1/+1
| | | | | | | | | | | | 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. llvm-svn: 208926
* Check for LLVM_ON_WIN32 instead of _WIN32.Hans Wennborg2014-03-121-2/+3
| | | | | | This is a follow-up to r203624 to address Anton's comment. llvm-svn: 203668
* Be case sensitive when determining driver mode based on argv[0] except on ↵Hans Wennborg2014-03-111-0/+3
| | | | | | | | | 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'. llvm-svn: 203624
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-5/+4
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* Remove support for the QA_OVERRIDE_GCC3_OPTIONS environment variable.Bob Wilson2014-02-231-5/+1
| | | | | | | | | | 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> llvm-svn: 201962
* Rename QA_OVERRIDE_GCC3_OPTIONS to CCC_OVERRIDE_OPTIONS. <rdar://14578381>Bob Wilson2014-01-151-4/+8
| | | | | | | Continue to accept the old name for a while to make it an easier transition for people who rely on this. llvm-svn: 199283
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | 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. llvm-svn: 198686
* This patch modified ExeBasename as clang-cl.exe to match the preceding comment.Yaron Keren2013-11-061-1/+1
| | | | llvm-svn: 194170
* Driver: Use the canonical command line arguments.David Majnemer2013-10-071-1/+10
| | | | | | | | | | | | | | | 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 llvm-svn: 192091
* clang-cl: Use "clang cl.exe" when disambiguating the diagnostic prefix.Reid Kleckner2013-09-041-2/+2
| | | | llvm-svn: 189909
* clang-cl: Avoid confusing diagnostics when clang-cl is called just cl.exeReid Kleckner2013-09-041-1/+8
| | | | llvm-svn: 189901
* Fix iterator invalidation. PR16935.Eli Friedman2013-08-201-3/+4
| | | | llvm-svn: 188835
* Look at lowercase version of argv[0] when determining driver modeHans Wennborg2013-08-201-0/+2
| | | | llvm-svn: 188833
* Remove misleading comment about using cc1 option table.Hans Wennborg2013-08-081-4/+4
| | | | | | There hasn't been a separate cc1 option table since r155916. llvm-svn: 187993
* Remove support for CCC_ADD_ARGS. QA_OVERRIDE_GCC3_OPTIONS supersedes it.Rafael Espindola2013-07-231-19/+0
| | | | llvm-svn: 186983
* Add a cl.exe compatible driver modeHans Wennborg2013-07-191-0/+2
| | | | | | | The mode doesn't actually do anything yet, but this provides a way to get into it. llvm-svn: 186720
* Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,Hans Wennborg2013-07-181-16/+16
| | | | | | | | | | | | 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. llvm-svn: 186605
* [Driver] Use LLVM's response file parser because it can read UTF-16Reid Kleckner2013-07-181-75/+16
| | | | | | | | | | | | 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 llvm-svn: 186603
* Revert 186302 to fix build bots.Craig Topper2013-07-151-1/+1
| | | | llvm-svn: 186305
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-1/+2
| | | | llvm-svn: 186302
* Remove unused header.Rafael Espindola2013-06-261-1/+0
| | | | llvm-svn: 184937
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-261-7/+6
| | | | llvm-svn: 184915
* Include PathV1.h only where it is used.Rafael Espindola2013-06-171-0/+1
| | | | llvm-svn: 184090
OpenPOWER on IntegriCloud