summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option
Commit message (Collapse)AuthorAgeFilesLines
* [Bash-autocompletion] Show flags which has HelpText or GroupIDYuka Takahashi2017-07-051-1/+1
| | | | | | | | Summary: Otherwise internal flags will be also completed. Differential Revision: https://reviews.llvm.org/D34930 llvm-svn: 307116
* [GSoC] Flag value completion for clangYuka Takahashi2017-06-202-0/+35
| | | | | | | | | | | | This is patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. In this patch, Options.td was mainly changed in order to add value class in Options.inc. llvm-svn: 305805
* [BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and ↵Eugene Zelenko2017-06-164-32/+49
| | | | | | Include What You Use warnings; other minor fixes (NFC). llvm-svn: 305537
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* [GSoC] Shell autocompletion for clangYuka Takahashi2017-05-231-0/+14
| | | | | | | | | | | | | | | | | Summary: This is a first patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. Simple flag completion and path completion is available in this patch. Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33237 llvm-svn: 303670
* ArgList: cache index ranges containing arguments with each IDRichard Smith2017-04-121-193/+33
| | | | | | | | | | | | | | | | | | Improve performance of argument list parsing with large numbers of IDs and large numbers of arguments, by tracking a conservative range of indexes within the argument list that might contain an argument with each ID. In the worst case (when the first and last argument with a given ID are at the opposite ends of the argument list), this still results in a linear-time walk of the list, but it helps substantially in the common case where each ID occurs only once, or a few times close together in the list. This gives a ~10x speedup to clang's `test/Driver/response-file.c`, which constructs a very large set of command line arguments and feeds them to the clang driver. Differential Revision: https://reviews.llvm.org/D30130 llvm-svn: 300135
* Cleanup dump() functions.Matthias Braun2017-01-283-0/+6
| | | | | | | | | | | | | | | | | | We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
* Generalize ArgList::AddAllArgs moreDouglas Katzman2016-09-291-5/+22
| | | | llvm-svn: 282755
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-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
* Use the range variant of remove_if instead of unpacking begin/endDavid Majnemer2016-08-121-3/+3
| | | | | | No functionality change is intended. llvm-svn: 278475
* Use the range variant of find instead of unpacking begin/endDavid Majnemer2016-08-111-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
* Option parser: class for consuming a joined arg in addition to all remaining ↵Hans Wennborg2016-04-152-1/+15
| | | | | | args llvm-svn: 266394
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-291-1/+1
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* Remove autoconf supportChris Bieneman2016-01-261-14/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Convert Arg, ArgList, and Option to dump() to dbgs() rather than errs().Eric Christopher2015-12-183-26/+35
| | | | | | | | Also add print() functions. Patch by Justin Lebar! llvm-svn: 256010
* Add a dump method for ArgList.Eric Christopher2015-12-181-0/+7
| | | | | | Patch by Justin Lebar! llvm-svn: 256009
* Revert "[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs"Vedant Kumar2015-12-181-12/+9
| | | | | | | This reverts commit r255977. This is part of http://reviews.llvm.org/D15634. llvm-svn: 255978
* [Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgsVedant Kumar2015-12-181-9/+12
| | | | llvm-svn: 255977
* [Option] Use an ArrayRef to store the Option Infos in OptTable. NFCCraig Topper2015-10-211-7/+5
| | | | llvm-svn: 250901
* Add an ArgList::AddAllArgs that accepts a vector of OptSpecifier.Douglas Katzman2015-07-291-0/+15
| | | | | | | | This lifts the somewhat arbitrary restriction on 3 OptSpecifiers. Differential Revision: http://reviews.llvm.org/D11597 llvm-svn: 243539
* [Option] Plug a leak when move-assigning an InputArgList.Benjamin Kramer2015-06-231-6/+6
| | | | | | | | The class has a non-trivial dtor so we have to clean up before we move in new members. Remove misleading comment as a default move assignment operator will never be synthesized for this class. llvm-svn: 240417
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-2/+2
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Code cleanup: Remove std::move() around xvalue (NFC)Logan Chien2015-06-221-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
* Modify ParseArgs to return the InputArgList by value - there's no need for ↵David Blaikie2015-06-221-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
* Devirtualize ArgList's dtor now that -Wvirtual-dtor and C++11 allow a better ↵David Blaikie2015-06-211-5/+0
| | | | | | way to describe this situation llvm-svn: 240238
* ArrayRef-ify ParseArgsDavid Blaikie2015-06-211-4/+3
| | | | llvm-svn: 240233
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-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
* Option parsing: properly handle flag aliases for joined options (PR23394)Hans Wennborg2015-05-041-0/+5
| | | | | | | | | 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
* Remove more superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-301-1/+1
| | | | | | Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev. llvm-svn: 233555
* Make getLastArgNoClaim work for up to 4 arguments.Filipe Cabecinhas2015-03-201-0/+20
| | | | | | | | | | | | | | Summary: This is needed for http://reviews.llvm.org/D8507 I have no idea what stand-alone tests could be done, if needed. Reviewers: Bigcheese, craig.topper, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8508 llvm-svn: 232859
* Teach Twine to support SmallString.Yaron Keren2015-03-171-7/+2
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie2015-03-163-25/+19
| | | | | | | | | 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
* Remove explicit no-op dtor in favor of the implicit dtor so as not to ↵David Blaikie2015-03-031-3/+0
| | | | | | disable/deprecate the copy operations. llvm-svn: 231113
* Prefer SmallVector::append/insert over push_back loops.Benjamin Kramer2015-02-172-10/+6
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229500
* Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects.Zachary Turner2015-02-111-0/+3
| | | | | | | | | | This allows IDEs to recognize the entire set of header files for each of the core LLVM projects. Differential Revision: http://reviews.llvm.org/D7526 Reviewed By: Chris Bieneman llvm-svn: 228798
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+1
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* Add an overload of getLastArgNoClaim taking two OptSpecifiers.Ehsan Akhgari2014-09-121-0/+9
| | | | | | | | | | | | | | Summary: This will be used in clang. Test Plan: Will be tested on the clang side. Reviewers: hansw Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5337 llvm-svn: 217702
* Fix PR17239 by changing the semantics of the RemainingArgsClass Option kindReid Kleckner2014-08-222-4/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* [Option] Support MultiArg in --helpNick Kledzik2014-08-151-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
* Generic: add range-adapter for option parsing.Tim Northover2014-07-091-17/+13
| | | | | | I want to use it in lld, but while I'm here I'll update LLVM uses. llvm-svn: 212615
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-2/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-4/+2
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* ArgList: use MakeArgList overloads in subclasses and clean up some calls.Justin Bogner2014-06-201-15/+11
| | | | llvm-svn: 211340
* Options: Use erase_if to remove Args from the list.Benjamin Kramer2014-05-181-8/+3
| | | | | | | While there make getOption return a const reference so we don't have to put it on the stack when calling methods on it. No functionality change. llvm-svn: 209088
* Protect the ArgList dtorDavid Blaikie2014-04-201-5/+0
| | | | | | | | | | | | | It could even be made non-virtual if it weren't for bad compiler warnings. This demonstrates that ArgList objects aren't destroyed polymorphically and possibly that they aren't even used polymorphically. If that's the case, it might be possible to refactor the two ArgList types more separately and simplify the Arg ownership model. *continues experimenting* llvm-svn: 206727
* Use unique_ptr to handle ownership of synthesized args in DerivedArgListDavid Blaikie2014-04-201-27/+26
| | | | | | | | This might be able to be simplified further by using Arg as a value type in a linked list (to maintain pointer validity), but here's something simple to start with. llvm-svn: 206724
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-153-24/+24
| | | | | | instead of comparing to nullptr. llvm-svn: 206252
* Avoid buffer copies when a Twine already is a StringRef.David Blaikie2013-12-031-2/+1
| | | | llvm-svn: 196301
* Use startswith_lower() where possible.Jakub Staszak2013-11-041-8/+1
| | | | llvm-svn: 194007
* Fix another mistake in r190442.Eli Friedman2013-09-101-0/+29
| | | | | | Sorry about that; I'll try to be more careful about DEBUG mode. llvm-svn: 190449
OpenPOWER on IntegriCloud