summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove unused functions.Eli Friedman2013-09-101-30/+0
| | | | llvm-svn: 190442
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-281-21/+41
| | | | | | 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-48/+34
| | | | | | | | broke Windows buildbot. This reverts r189416. llvm-svn: 189424
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-271-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
* Options: explicit handling of --Hans Wennborg2013-08-131-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
* Options: Add new option kind that consumes remaining argumentsHans Wennborg2013-08-132-0/+14
| | | | | | | | | | | | | | | | 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/CMakeLists.txt: Don't use target_link_libraries. LLVMBuild knows ↵NAKAMURA Takumi2013-08-061-2/+0
| | | | | | dependencies. llvm-svn: 187777
* Option parsing: recognize the special -- tokenHans Wennborg2013-08-021-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
* Option parsing: add support for alias arguments.Hans Wennborg2013-07-311-2/+20
| | | | | | | | | | | | | | | | | | 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
* Silence gcc warning.Richard Trieu2013-07-221-1/+1
| | | | llvm-svn: 186879
* Option parsing: allow aliases in groupsHans Wennborg2013-07-221-6/+4
| | | | | | | | | 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
* [Option] Add inclusion and exclusion flags to option parsingReid Kleckner2013-07-191-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
* Revert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"Reid Kleckner2013-07-151-11/+2
| | | | | | | | | This broke clang's crash-report.c test, and I haven't been able to figure it out yet. This reverts commit r186319. llvm-svn: 186329
* [Option] Store arg strings in a set backed by a BumpPtrAllocatorReid Kleckner2013-07-151-2/+11
| | | | | | | | | | | No functionality change. This is preparing to move response file parsing into lib/Option so it can be shared between clang and lld. This change isn't just a micro-optimization. Clang's driver uses a std::set<std::string> to unique arguments while parsing response files, so this matches that. llvm-svn: 186319
* Fix a crash bug in dumping options with groupsReid Kleckner2013-06-261-4/+6
| | | | | | | | Option groups don't have prefixes. Option dumping is basically dead code unless there is something wrong with the option table, so this isn't an important crasher. llvm-svn: 185031
* Merge changes to clang's Driver code into LLVM's Option libraryReid Kleckner2013-06-132-7/+29
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud