aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Option/OptTable.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-17Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner1-1/+1
This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
2016-08-11Use the range variant of find instead of unpacking begin/endDavid Majnemer1-2/+2
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
2016-04-15Option parser: class for consuming a joined arg in addition to all remaining ↵Hans Wennborg1-1/+1
args llvm-svn: 266394
2015-10-21[Option] Use an ArrayRef to store the Option Infos in OptTable. NFCCraig Topper1-7/+5
llvm-svn: 250901
2015-06-23Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko1-2/+2
Apparently, the style needs to be agreed upon first. llvm-svn: 240390
2015-06-22Code cleanup: Remove std::move() around xvalue (NFC)Logan Chien1-1/+1
Remove std::move() around xvalue so that copy elision is eligible. In case that copy elision is not appliable, the c++ standard also guarantees the move semantics on xvalue. Thus, it is not necessary to wrap Args with std::move. This also silence a warning since r240345. llvm-svn: 240355
2015-06-22Modify ParseArgs to return the InputArgList by value - there's no need for ↵David Blaikie1-11/+11
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
2015-06-21ArrayRef-ify ParseArgsDavid Blaikie1-4/+3
llvm-svn: 240233
2015-06-19Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-2/+2
The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
2015-03-16Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie1-9/+5
uppercase letter This covers essentially all of llvm's headers and libs. One or two weird cases I wasn't sure were worth/appropriate to fix. llvm-svn: 232394
2014-08-22Fix PR17239 by changing the semantics of the RemainingArgsClass Option kindReid Kleckner1-0/+5
This patch contains the LLVM side of the fix of PR17239. This bug that 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. My 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. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4899 Patch by Rafael Auler! llvm-svn: 216280
2014-08-15[Option] Support MultiArg in --helpNick Kledzik1-1/+12
Currently, if you use a MultiArg<> option, then printing out the help/usage message will cause an assert. This fixes getOptionHelpName() to work with MultiArg Options. llvm-svn: 215770
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-5/+5
instead of comparing to nullptr. llvm-svn: 206252
2013-11-04Use startswith_lower() where possible.Jakub Staszak1-8/+1
llvm-svn: 194007
2013-09-10Fix another mistake in r190442.Eli Friedman1-0/+29
Sorry about that; I'll try to be more careful about DEBUG mode. llvm-svn: 190449
2013-09-10Remove unused functions.Eli Friedman1-30/+0
llvm-svn: 190442
2013-08-28Option parsing: support case-insensitive option matching.Rui Ueyama1-21/+41
Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined. llvm-svn: 189501
2013-08-28Revert "Option parsing: support case-insensitive option matching." as it ↵Rui Ueyama1-48/+34
broke Windows buildbot. This reverts r189416. llvm-svn: 189424
2013-08-27Option parsing: support case-insensitive option matching.Rui Ueyama1-34/+48
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
2013-08-13Options: explicit handling of --Hans Wennborg1-16/+0
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
2013-08-13Options: Add new option kind that consumes remaining argumentsHans Wennborg1-0/+3
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
2013-08-02Option parsing: recognize the special -- tokenHans Wennborg1-1/+16
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
2013-07-19[Option] Add inclusion and exclusion flags to option parsingReid Kleckner1-6/+22
Summary: This allows the clang driver to put MSVC compatible options in the same enumerator space as its normal options but exclude them from normal option parsing. Also changes the standard ParseArgs() method to consider unknown arguments with a leading slash as being inputs rather than flags. High level discussion for clang-cl is here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-June/030404.html CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1049 llvm-svn: 186703
2013-06-13Merge changes to clang's Driver code into LLVM's Option libraryReid Kleckner1-7/+14
This is in preparation for switching the clang driver over to using LLVM's Option library. Richard Smith introduced most of these changes to the clang driver in r167638. Reviewers: espindola on IRC Differential Revision: http://llvm-reviews.chandlerc.com/D970 llvm-svn: 183925
2013-01-02Resort the #include lines in include/... and lib/... with theChandler Carruth1-2/+1
utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
2012-12-05Copy clang/Driver/<Option parsing stuff> to llvm.Michael J. Spencer1-0/+388
llvm-svn: 169344