summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/SmallVectorTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sort the #include lines for unittest/...Chandler Carruth2012-12-041-2/+2
| | | | llvm-svn: 169250
* Move the SmallVector unit tests to be type-parameterized so that we canChandler Carruth2012-07-301-149/+176
| | | | | | | | | | | | | | | | | | | | test more than a single instantiation of SmallVector. Add testing for 0, 1, 2, and 4 element sized "small" buffers. These appear to be essentially untested in the unit tests until now. Fix several tests to be robust in the face of a '0' small buffer. As a consequence of this size buffer, the growth patterns are actually observable in the test -- yes this means that many tests never caused a grow to occur before. For some tests I've merely added a reserve call to normalize behavior. For others, the growth is actually interesting, and so I captured the fact that growth would occur and adjusted the assertions to not assume how rapidly growth occured. Also update the specialization for a '0' small buffer length to have all the same interface points as the normal small vector. llvm-svn: 161001
* Bring the return value of SmallVector::insert in line with std::vector::insert.Benjamin Kramer2012-06-171-4/+30
| | | | | | | | It always returns the iterator for the first inserted element, or the passed in iterator if the inserted range was empty. Flesh out the unit test more and fix all the cases it uncovered so far. llvm-svn: 158645
* SmallVector: return a valid iterator for the rare case of inserting an empty ↵Benjamin Kramer2012-06-171-0/+7
| | | | | | | | range into a SmallVector. Patch by Johannes Schaub! llvm-svn: 158643
* SmallVector: Don't rely on having an assignment operator around in push_back ↵Benjamin Kramer2012-04-291-0/+13
| | | | | | for POD-like types. llvm-svn: 155791
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-1/+1
| | | | llvm-svn: 135375
* Fix a subtle issue in SmallVector. The following code did not work as expected:Owen Anderson2011-07-061-21/+27
| | | | | | | | | vec.insert(vec.begin(), vec[3]); The issue was that vec[3] returns a reference into the vector, which is invalidated when insert() memmove's the elements down to make space. The method needs to specifically detect and handle this case to correctly match std::vector's semantics. Thanks to Howard Hinnant for clarifying the correct behavior, and explaining how std::vector solves this problem. llvm-svn: 134554
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-231-1/+1
| | | | | | until other LLVM projects using these are cleaned up. llvm-svn: 117200
* Silence 'unused' warning.Bill Wendling2010-08-191-1/+3
| | | | llvm-svn: 111539
* Fix SmallVector's insert to handle non-random-access iterators.Dan Gohman2010-03-261-0/+6
| | | | llvm-svn: 99633
* Make this test more lenient; with SmallVector now using actuallyDan Gohman2010-03-181-1/+1
| | | | | | | aligned storage, the capacity may be more than what is explicitly requested. llvm-svn: 98846
* Add SmallVector::{capacity,set_size}.Daniel Dunbar2009-08-191-0/+18
| | | | | | | - These allow clients to make use of the extra elements in the vector which have already been allocated, without requiring them to be value initialized. llvm-svn: 79433
* Clarify a FIXME.Daniel Dunbar2009-07-121-4/+5
| | | | llvm-svn: 75422
* Use the testcase from PR2791.Owen Anderson2009-04-231-3/+3
| | | | llvm-svn: 69846
* Fix naming of file.Bill Wendling2009-01-111-1/+1
| | | | llvm-svn: 62035
* Adding unittests for SmallVector. Test by Talin.Bill Wendling2009-01-101-0/+383
llvm-svn: 62025
OpenPOWER on IntegriCloud