summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/CommandLineTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[Support] Promote cl::StringSaver to a separate utility"Sean Silva2014-08-151-2/+9
| | | | | | | | | This reverts commit r215784 / 3f8a26f6fe16cc76c98ab21db2c600bd7defbbaa. LLD has 3 StringSaver's, one of which takes a lock when saving the string... Need to investigate more closely. llvm-svn: 215790
* [Support] Promote cl::StringSaver to a separate utilitySean Silva2014-08-151-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is generally useful. In breaking it out, the primary change is that it has been made non-virtual. It seems like being abstract led to there being 3 different (2 in llvm + 1 in clang) concrete implementations which disagreed about the ownership of the saved strings (see the manual call to free() in the unittest StrDupSaver; yes this is different from the CommandLine.cpp StrDupSaver which owns the stored strings; which is different from Clang's StringSetSaver which just holds a reference to a std::set<std::string> which owns the strings). I've identified 2 other places in the codebase that are open-coding this pattern: memcpy(Alloc.Allocate<char>(strlen(S)+1), S, strlen(S)+1) I'll be switching them over. They are * llvm::sys::Process::GetArgumentVector * The StringAllocator member of YAMLIO's Input class This also will allow simplifying Clang's driver.cpp quite a bit. Let me know if there are any other places that could benefit from StringSaver. I'm also thinking of adding a saveStringRef member for getting a stable StringRef. llvm-svn: 215784
* Support: Fix option handling when using cl::Required with aliasoptJustin Bogner2014-07-141-0/+19
| | | | | | | | | | | | | | | | Until now, attempting to create an alias of a required option would complain if the user supplied the alias, because the required option didn't have a value. Similarly, if you said the alias was required, then using the base option would complain that the alias wasn't supplied. Lastly, if you put required on both, *neither* option would work. By changning alias to overload addOccurrence and setting cl::Required on the original option, we can get this to behave in a more useful way. I've also added a test and updated a user that was getting this wrong. llvm-svn: 212986
* [C++11] Use 'nullptr'.Craig Topper2014-06-081-1/+1
| | | | llvm-svn: 210442
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202621
* Remove C++11ism from r200407.Jordan Rose2014-01-291-1/+1
| | | | | | Oops! llvm-svn: 200412
* [CommandLine] Aliases require an value if their target requires a value.Jordan Rose2014-01-291-2/+53
| | | | | | | | | This can still be overridden by explicitly setting a value requirement on the alias option, but by default it should be the same. PR18649 llvm-svn: 200407
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Implement TokenizeWindowsCommandLine.Rui Ueyama2013-07-301-9/+28
| | | | | | | | | | This is a follow up patch for r187390 to implement the parser for the Windows-style command line. This should follow the rule as described at http://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx Differential Revision: http://llvm-reviews.chandlerc.com/D1235 llvm-svn: 187430
* [Support] Beef up and expose the response file parsing in llvm::clReid Kleckner2013-07-181-0/+24
| | | | | | | | | | | | | | | | | | | The plan is to use it for clang and lld. Major behavior changes: - We can now parse UTF-16 files that have a byte order mark. - PR16209: Don't drop backslashes on the floor if they don't escape anything. The actual parsing loop was based on code from Clang's driver.cpp, although it's been rewritten to track its state with control flow rather than state variables. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1170 llvm-svn: 186587
* Implemented public interface for modifying registered (not positional or ↵Andrew Trick2013-05-061-3/+47
| | | | | | | | sink options) command line options at runtime. Patch by Dan Liew! llvm-svn: 181254
* Support command line option categories.Andrew Trick2013-05-061-0/+8
| | | | | | Patch by Dan Liew! llvm-svn: 181253
* Sort the #include lines for unittest/...Chandler Carruth2012-12-041-3/+1
| | | | llvm-svn: 169250
* Added test for non-static use of cl::opt (fixed in r160170)Alexander Kornienko2012-08-131-0/+11
| | | | llvm-svn: 161751
* Fix a compile failure introduced by r82675 on MinGW which doesn't haveJeffrey Yasskin2009-09-251-0/+12
| | | | | | | setenv(). This patch just disables the test rather than getting putenv() to work. Thanks to Sandeep Patel for reporting the problem. llvm-svn: 82797
* Roll back r82348, which introduced an infinite loop in ParseCStringVector() thatJeffrey Yasskin2009-09-241-0/+48
a trivial unittest would have caught. This revision also adds the trivial unittest. llvm-svn: 82675
OpenPOWER on IntegriCloud