summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option/ArgList.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-4/+4
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Make AddLastArg() variadic and use it more. No behavior change.Nico Weber2019-06-261-15/+0
| | | | llvm-svn: 364453
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* Reverting r315590; it did not include changes for llvm-tblgen, which is ↵Aaron Ballman2017-10-151-1/+1
| | | | | | | | causing link errors for several people. Error LNK2019 unresolved external symbol "public: void __cdecl `anonymous namespace'::MatchableInfo::dump(void)const " (?dump@MatchableInfo@?A0xf4f1c304@@QEBAXXZ) referenced in function "public: void __cdecl `anonymous namespace'::AsmMatcherEmitter::run(class llvm::raw_ostream &)" (?run@AsmMatcherEmitter@?A0xf4f1c304@@QEAAXAEAVraw_ostream@llvm@@@Z) llvm-tblgen D:\llvm\2017\utils\TableGen\AsmMatcherEmitter.obj 1 llvm-svn: 315854
* [dump] Remove NDEBUG from test to enable dump methods [NFC]Don Hinton2017-10-121-1/+1
| | | | | | | | | | | | | | | Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 llvm-svn: 315590
* [BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and ↵Eugene Zelenko2017-06-161-7/+14
| | | | | | Include What You Use warnings; other minor fixes (NFC). llvm-svn: 305537
* 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-281-0/+2
| | | | | | | | | | | | | | | | | | 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
* 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
* Convert Arg, ArgList, and Option to dump() to dbgs() rather than errs().Eric Christopher2015-12-181-3/+6
| | | | | | | | 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
* 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
* 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
* 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-161-3/+2
| | | | | | | | | 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
* Prefer SmallVector::append/insert over push_back loops.Benjamin Kramer2015-02-171-2/+2
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229500
* [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
* 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
* 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-151-9/+9
| | | | | | 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
* 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
* Merge changes to clang's Driver code into LLVM's Option libraryReid Kleckner2013-06-131-0/+15
| | | | | | | | | | | | 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
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+0
| | | | | | | | | | 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
* Copy clang/Driver/<Option parsing stuff> to llvm.Michael J. Spencer2012-12-051-0/+386
llvm-svn: 169344
OpenPOWER on IntegriCloud