summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/MapVectorTest.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
* 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
* [ADT] Fix MapVector when 'Map::mapped_type != unsigned'.Eric Fiselier2018-04-081-0/+39
| | | | | | | | | | | Previously MapVector assumed `Map::mapped_type` was `unsigned`. This caused problems when using MapVector with a user-specified map where this didn't hold (For example StringMap<unsigned>). This patch adjusts MapVector to use the same type as the underlying map, avoiding reference binding errors in functions like `insert`. llvm-svn: 329523
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* [ADT] Let MapVector handle non-copyable values.Justin Lebar2016-10-101-0/+18
| | | | | | | | | | | | Summary: The keys must still be copyable, because we store two copies of them. Reviewers: timshen Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25404 llvm-svn: 283764
* [ADT] Teach MapVector to support a swap member. Will be used inChandler Carruth2015-03-251-0/+25
| | | | | | a subsequent commit in Clang. llvm-svn: 233159
* Add a SmallMapVector class that is a MapVector with a Map of SmallDenseMap ↵Michael Gottesman2014-12-311-0/+218
| | | | | | and a Vector of SmallVector. llvm-svn: 225054
* Add MapVector::rbegin(), MapVector::rend() to completment ↵Michael Gottesman2014-10-271-0/+25
| | | | | | | | | | MapVector::begin(), MapVector::end(). These just delegate to the underlying vector type in the MapVector. Also just add in some sanity unittests. llvm-svn: 220687
* Add return value and negative checks to MapVector::erase from r219240.Kaelyn Takata2014-10-071-1/+4
| | | | llvm-svn: 219250
* Add size_t MapVector::erase(KeyT) similar to the one in std::map.Kaelyn Takata2014-10-071-0/+5
| | | | llvm-svn: 219240
* ADT: Add MapVector::remove_ifDuncan P. N. Exon Smith2014-07-151-0/+21
| | | | | | | Add a `MapVector::remove_if()` that erases items in bulk in linear time, as opposed to quadratic time for repeated calls to `MapVector::erase()`. llvm-svn: 213090
* ADT: Fix MapVector::erase()Duncan P. N. Exon Smith2014-07-151-0/+15
| | | | | | | | | | | | Actually update the changed indexes in the map portion of `MapVector` when erasing from the middle. Add a unit test that checks for this. Note that `MapVector::erase()` is a linear time operation (it was and still is). I'll commit a new method in a moment called `MapVector::remove_if()` that deletes multiple entries in linear time, which should be slightly less painful. llvm-svn: 213084
* Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a ↵Douglas Gregor2013-02-191-1/+15
| | | | | | unit test. llvm-svn: 175538
* Add an insert() method to MapVector. Adds the first MapVector unit test.Nick Lewycky2013-01-251-0/+41
llvm-svn: 173505
OpenPOWER on IntegriCloud