Benjamin Kramer
371b9b0e99
SmallVector: return a valid iterator for the rare case of inserting an empty range into a SmallVector.
...
Patch by Johannes Schaub!
llvm-svn: 158643
2012-06-17 11:52:22 +00:00
Benjamin Kramer
74a12a46a0
SmallVector: Don't rely on having an assignment operator around in push_back for POD-like types.
...
llvm-svn: 155791
2012-04-29 10:53:29 +00:00
Chris Lattner
229907cd11
land David Blaikie's patch to de-constify Type, with a few tweaks.
...
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Owen Anderson
145a260f75
Fix a subtle issue in SmallVector. The following code did not work as expected:
...
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
2011-07-06 22:36:59 +00:00
Chandler Carruth
88c54b82c1
Switch attribute macros to use 'LLVM_' as a prefix. We retain the old names
...
until other LLVM projects using these are cleaned up.
llvm-svn: 117200
2010-10-23 08:10:43 +00:00
Bill Wendling
bfba2f1725
Silence 'unused' warning.
...
llvm-svn: 111539
2010-08-19 18:52:02 +00:00
Dan Gohman
42e77df78c
Fix SmallVector's insert to handle non-random-access iterators.
...
llvm-svn: 99633
2010-03-26 18:53:37 +00:00
Dan Gohman
ed4c2eb7bf
Make this test more lenient; with SmallVector now using actually
...
aligned storage, the capacity may be more than what is explicitly
requested.
llvm-svn: 98846
2010-03-18 18:47:50 +00:00
Daniel Dunbar
825e955e40
Add SmallVector::{capacity,set_size}.
...
- 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
2009-08-19 17:48:28 +00:00
Daniel Dunbar
6d6023b5f7
Clarify a FIXME.
...
llvm-svn: 75422
2009-07-12 19:45:34 +00:00
Owen Anderson
d4f5537c5e
Use the testcase from PR2791.
...
llvm-svn: 69846
2009-04-23 00:15:26 +00:00
Bill Wendling
8d069ef872
Fix naming of file.
...
llvm-svn: 62035
2009-01-11 01:25:51 +00:00
Bill Wendling
c56c37f039
Adding unittests for SmallVector. Test by Talin.
...
llvm-svn: 62025
2009-01-10 12:56:31 +00:00