summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Option/OptionParsingTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix some ArgList uses after API change in r300135.Richard Smith2017-04-121-4/+4
| | | | llvm-svn: 300139
* Option parser: class for consuming a joined arg in addition to all remaining ↵Hans Wennborg2016-04-151-0/+51
| | | | | | args llvm-svn: 266394
* OptionParsingTest.cpp: reorder EXPECT_EQs to put expectation on the left. NFC.Hans Wennborg2016-04-151-25/+25
| | | | | | | This provides for better error messages from the framework when the expected and actual values don't match. llvm-svn: 266393
* [Option] Use an ArrayRef to store the Option Infos in OptTable. NFCCraig Topper2015-10-211-1/+1
| | | | llvm-svn: 250901
* Modify ParseArgs to return the InputArgList by value - there's no need for ↵David Blaikie2015-06-221-65/+64
| | | | | | | | | | | | dynamic allocation/ownership here The one caller that does anything other than keep this variable on the stack is the single use of DerivedArgList in Clang, which is a bit more interesting but can probably be cleaned up/simplified a bit further (have DerivedArgList take ownership of the InputArgList rather than needing to reference its Args indirectly) which I'll try to after this. llvm-svn: 240345
* ArrayRef-ify ParseArgsDavid Blaikie2015-06-211-19/+11
| | | | llvm-svn: 240233
* Option parsing: properly handle flag aliases for joined options (PR23394)Hans Wennborg2015-05-041-0/+14
| | | | | | | | | A joined option always needs to have an argument, even if it's an empty one. Clang would previously assert when trying to use --extra-warnings, which is a flag alias for -W, which is a joined option. llvm-svn: 236434
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-121-10/+10
| | | | | | While there make array_lengthof constexpr if we have support for it. llvm-svn: 206112
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-9/+15
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-281-3/+23
| | | | | | Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined. llvm-svn: 189501
* Revert "Option parsing: support case-insensitive option matching." as it ↵Rui Ueyama2013-08-281-23/+3
| | | | | | | | broke Windows buildbot. This reverts r189416. llvm-svn: 189424
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-271-3/+23
| | | | | | | | | | | | | | Link.exe's command line options are case-insensitive. This patch adds a new attribute to OptTable to let the option parser to compare options, ignoring case. Command lines are generally case-insensitive on Windows. CL.exe is an exception. So this new attribute should be useful for other commands running on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1485 llvm-svn: 189416
* Options: explicit handling of --Hans Wennborg2013-08-131-14/+1
| | | | | | | | | | | Clients of the option parsing library should handle it explicitly using a KIND_REMAINING_ARGS option. Clang and lld have been updated in r188316 and r188318, respectively. Also fix -Wsign-compare warning in the option parsing test. llvm-svn: 188323
* Options: Add new option kind that consumes remaining argumentsHans Wennborg2013-08-131-0/+27
| | | | | | | | | | | | | | | | This adds KIND_REMAINING_ARGS, a class of options that consume all remaining arguments on the command line. This will be used to support /link in clang-cl, which is used to forward all remaining arguments to the linker. It also allows us to remove the hard-coded handling of "--", allowing clients (clang and lld) to implement that functionality themselves with this new option class. Differential Revision: http://llvm-reviews.chandlerc.com/D1387 llvm-svn: 188314
* Option parsing: recognize the special -- tokenHans Wennborg2013-08-021-0/+13
| | | | | | | | | | | | | | Everything that comes after -- should be treated as a filename. This enables passing in filenames that would otherwise be conflated with command-line options. This is especially important for clang-cl which supports options starting with /, which are easily conflatable with Unix-style path names. Differential Revision: http://llvm-reviews.chandlerc.com/D1274 llvm-svn: 187675
* Option parsing: remove non-SUPPORT_ALIASARGS fall-backHans Wennborg2013-07-311-2/+0
| | | | | | | | The clients of this code have been updated to all support AliasArgs. This depends on Clang r187538 and lld r187541. llvm-svn: 187546
* Option parsing: add support for alias arguments.Hans Wennborg2013-07-311-3/+16
| | | | | | | | | | | | | | | | | | This makes option aliases more powerful by enabling them to pass along arguments to the option they're aliasing. For example, if we have a joined option "-foo=", we can now specify a flag option "-bar" to be an alias of that, with the argument "baz". This is especially useful for the cl.exe compatible clang driver, where many options are aliases. For example, this patch enables us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to "-Werror" (again, -W is a joined option). Differential Revision: http://llvm-reviews.chandlerc.com/D1245 llvm-svn: 187537
* Option parsing: allow aliases in groupsHans Wennborg2013-07-221-0/+9
| | | | | | | | | Option aliases in option groups were previously disallowed by an assert. As far as I can tell, there was no technical reason for this, and I would like to be able to put cl.exe compatible options in their own group for Clang, so let's change the assert. llvm-svn: 186838
* Add some flag exclusion tests.Reid Kleckner2013-07-191-7/+39
| | | | llvm-svn: 186704
* llvm/unittests: Use OwningPtr to fix --vg-leak.NAKAMURA Takumi2013-01-231-1/+6
| | | | llvm-svn: 173240
* Whitespace.NAKAMURA Takumi2013-01-231-1/+1
| | | | llvm-svn: 173234
* Sort a few more #include lines in tools/... unittests/... and utils/...Chandler Carruth2013-01-021-1/+0
| | | | llvm-svn: 171363
* Copy clang/Driver/<Option parsing stuff> to llvm.Michael J. Spencer2012-12-051-0/+102
llvm-svn: 169344
OpenPOWER on IntegriCloud