summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/SmallPtrSetTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ADT: Fix SmallPtrSet iterators in reverse modeDuncan P. N. Exon Smith2017-03-071-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | Fix SmallPtrSet::iterator behaviour and creation ReverseIterate is true. - Any function that creates an iterator now uses SmallPtrSet::makeIterator, which creates an iterator that dereferences to the given pointer. - In reverse-iterate mode, initialze iterator::End with "CurArray" instead of EndPointer. - In reverse-iterate mode, the current node is iterator::Buffer[-1]. iterator::operator* and SmallPtrSet::makeIterator are the only ones that need to know. - Fix the assertions for reverse-iterate mode. This fixes the tests Danny B added in r297182, and adds a couple of others to confirm that dereferencing does the right thing, regardless of how the iterator was found, and that iteration works correctly from each return from find. llvm-svn: 297234
* Add unit tests for changes to SmallPtrSet and PointerLikeTypeTraitsDaniel Berlin2017-03-071-0/+33
| | | | llvm-svn: 297182
* [ADT] Add initializer list support to SmallPtrSet so that sets can beChandler Carruth2016-11-221-4/+10
| | | | | | easily initialized with some initial values. llvm-svn: 287610
* SmallPtrSetTest: More checks for the swap() testingMatthias Braun2016-01-291-0/+24
| | | | llvm-svn: 259152
* SmallPtrSetTest: Check that iterators are still valid after erase()Matthias Braun2016-01-291-0/+39
| | | | llvm-svn: 259151
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-021-1/+1
| | | | | | directly, and remove the macro. llvm-svn: 202612
* [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth2014-03-011-2/+0
| | | | llvm-svn: 202583
* Make the moved-from SmallPtrSet be a valid, empty, small-state object.Chandler Carruth2013-11-201-7/+21
| | | | | | | | | | | Enhance the tests to actually require moves in C++11 mode, in addition to testing the moved-from state. Further enhance the tests to cover copy-assignment into a moved-from object and moving a large-state object. (Note that we can't really test small-state vs. large-state as that isn't an observable property of the API really.) This should finish addressing review on r195239. llvm-svn: 195261
* Add a test for assignment operator behavior which was changed inChandler Carruth2013-11-201-1/+25
| | | | | | | | r195239, as well as a comment about the fact that assigning over a moved-from object was in fact tested. Addresses some of the review feedback on r195239. llvm-svn: 195260
* Give SmallPtrSet move semantics when we have R-value references.Chandler Carruth2013-11-201-0/+49
| | | | | | | | | | | | Somehow, this ADT got missed which is moderately terrifying considering the efficiency of move for it. The code to implement move semantics for it is pretty horrible currently but was written to reasonably closely match the rest of the code. Unittests that cover both copying and moving (at a basic level) added. llvm-svn: 195239
* SmallVector and SmallPtrSet allocations now power-of-two aligned.Jean-Luc Duprat2013-03-291-0/+55
| | | | | | This time tested on both OSX and Linux. llvm-svn: 178377
* Revert "Fix allocations of SmallVector and SmallPtrSet so they are more ↵Rafael Espindola2013-03-291-55/+0
| | | | | | | | | | | | | | | | | prone to" This reverts commit 617330909f0c26a3f2ab8601a029b9bdca48aa61. It broke the bots: /home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest /home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure Value of: v[i].getValue() Actual: 0 Expected: value Which is: 2 llvm-svn: 178334
* Fix allocations of SmallVector and SmallPtrSet so they are more prone toJean-Luc Duprat2013-03-291-0/+55
| | | | | | being power-of-two sized. llvm-svn: 178332
* SmallPtrSet: Provide a more efficient implementation of swap than the ↵Benjamin Kramer2012-03-061-0/+72
default triple-copy std::swap. This currently assumes that both sets have the same SmallSize to keep the implementation simple, a limitation that can be lifted if someone cares. llvm-svn: 152143
OpenPOWER on IntegriCloud