1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

13 Commits

Author SHA1 Message Date
Chandler Carruth
ae65e281f3 Update the file headers across all of the LLVM projects in the monorepo
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
2019-01-19 08:50:56 +00:00
Eric Fiselier
d3b507dfd6 [ADT] Fix MapVector when 'Map::mapped_type != unsigned'.
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
2018-04-08 08:48:58 +00:00
Chandler Carruth
87b8e94f84 Re-sort #include lines for unittests. This uses a slightly modified
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
2017-06-06 11:06:56 +00:00
Justin Lebar
8960a1706e [ADT] Let MapVector handle non-copyable values.
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
2016-10-10 16:25:59 +00:00
Chandler Carruth
9a37e27bd2 [ADT] Teach MapVector to support a swap member. Will be used in
a subsequent commit in Clang.

llvm-svn: 233159
2015-03-25 00:50:21 +00:00
Michael Gottesman
b2e01905b0 Add a SmallMapVector class that is a MapVector with a Map of SmallDenseMap and a Vector of SmallVector.
llvm-svn: 225054
2014-12-31 23:33:21 +00:00
Michael Gottesman
d4b999b2da Add MapVector::rbegin(), MapVector::rend() to completment 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
2014-10-27 17:20:53 +00:00
Kaelyn Takata
3a59730bde Add return value and negative checks to MapVector::erase from r219240.
llvm-svn: 219250
2014-10-07 23:11:49 +00:00
Kaelyn Takata
6c182edff1 Add size_t MapVector::erase(KeyT) similar to the one in std::map.
llvm-svn: 219240
2014-10-07 21:15:51 +00:00
Duncan P. N. Exon Smith
920db48687 ADT: Add MapVector::remove_if
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
2014-07-15 20:24:56 +00:00
Duncan P. N. Exon Smith
d7051f69aa ADT: Fix MapVector::erase()
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
2014-07-15 18:32:30 +00:00
Douglas Gregor
567c8d3dc3 Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
llvm-svn: 175538
2013-02-19 18:26:07 +00:00
Nick Lewycky
4c1f132b0c Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00