summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/PointerUnionTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic ↵Dmitri Gribenko2020-01-141-2/+2
| | | | template
* Add TinyPtrVector support for general pointer-like things.Andrew Trick2019-08-201-2/+53
| | | | | | | | | | | | | | | In particular, make TinyPtrVector<PtrIntPair<T *, 1>> work. Remove all unnecessary assumptions that the element type has a formal "null" representation. The important property to maintain is that default-constructed element type has the same internal representation as the default-constructed PointerUnion (all zero bits). Remove the incorrect recursive behavior from PointerUnion::isNull. This was never generally correct because it only recursed over the first type parameter. With variadic templates it's completely unnecessary. llvm-svn: 369473
* Fix broken test case.Richard Trieu2019-05-171-3/+3
| | | | | | EXPECT_EQ takes two arguments, not a single expression that evaluates to bool. llvm-svn: 360969
* Convert PointerUnion to a variadic template.Richard Smith2019-05-171-0/+37
| | | | | | | | | | | | | | | | | | | | | | Summary: Rather than duplicating code between PointerUnion, PointerUnion3, and PointerUnion4 (and missing things from the latter cases, such as some of the DenseMap support and operator==), convert PointerUnion to a variadic template that can be used as a union of any number of pointers. (This doesn't support PointerUnion<> right now. Adding a special case for that would be possible, and perhaps even useful in some situations, but it doesn't seem worthwhile until we have a concrete use case.) Reviewers: dblaikie Subscribers: dexonsmith, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62027 llvm-svn: 360962
* 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
* 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
* [C++11] Use 'nullptr'.Craig Topper2014-06-081-1/+1
| | | | llvm-svn: 210442
* [ADT] Teach PointerUnion to support assignment directly from nullptr toChandler Carruth2014-04-291-0/+6
| | | | | | clear it out. llvm-svn: 207471
* [cleanup] Add some actual positive tests for equality. This unittestChandler Carruth2014-04-281-2/+6
| | | | | | | never actually compared for equality two pointer unions that were equal. Fortunately, things seem to work. =] llvm-svn: 207468
* [cleanup] Make this test use a proper fixture rather than globals.Chandler Carruth2014-04-281-7/+6
| | | | llvm-svn: 207466
* [cleanup] Fix the whitespace in this test. Notably, correct spacingChandler Carruth2014-04-281-12/+11
| | | | | | around pointer types. llvm-svn: 207465
* Basic unit tests for PointerUnionDavid Blaikie2013-08-211-0/+64
llvm-svn: 188933
OpenPOWER on IntegriCloud