Rafael Espindola
efe64e5f1e
Add bound checks in SmallVector
...
llvm-svn: 56432
2008-09-22 10:06:26 +00:00
Dan Gohman
3b4af81381
Fix SmallVector's size calculation so that a size of 0 is
...
handled correctly, and change a few SmallVector uses to use
size 0 to more clearly reflect their intent.
llvm-svn: 55181
2008-08-22 16:07:55 +00:00
Owen Anderson
b307df554d
Add a value_type typedef to SmallVector, to make it more compatible with STL adapters.
...
llvm-svn: 54819
2008-08-15 18:45:51 +00:00
Dan Gohman
3755664b6d
Remove unnecessary static_casts.
...
llvm-svn: 53181
2008-07-07 18:08:20 +00:00
Seo Sanghyeon
0b4c1205fb
Compilation fix
...
llvm-svn: 52950
2008-07-01 05:27:28 +00:00
Dan Gohman
081848d881
Make SmallVector's grow use memcpy in common cases
...
instead of std::uninitialized_copy, which uses memmove.
llvm-svn: 52928
2008-06-30 21:45:13 +00:00
Dan Gohman
06ca992a01
Use plain operator new instead of new char[].
...
llvm-svn: 52927
2008-06-30 21:33:02 +00:00
Dan Gohman
b67e96f3aa
Add an operator< for SmallVector.
...
llvm-svn: 51791
2008-05-30 22:37:47 +00:00
Anton Korobeynikov
f77142326f
For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
...
llvm-svn: 51687
2008-05-29 17:41:17 +00:00
Bill Wendling
1866fa680f
Remove warnings about unused parameters and shadowed variables.
...
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Evan Cheng
d9353009b7
Fix more -Wshorten-64-to-32 warnings.
...
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Chris Lattner
27fa922841
Remove the SmallVector ctor that converts from a SmallVectorImpl. This
...
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when
needed.
This patch includes many small cleanups for sdisel also.
llvm-svn: 50340
2008-04-28 06:44:42 +00:00
Chris Lattner
89339f3a90
restore the copy ctor in SmallVector. This fixes serious
...
errors I introduced in my last patch.
llvm-svn: 50338
2008-04-28 06:32:08 +00:00
Chris Lattner
a03159bc35
generalize SmallVector copy ctor, there is no requirement for
...
the initialization vector to have the same fixed size, just the
same element type.
llvm-svn: 50334
2008-04-28 06:01:06 +00:00
David Greene
0ca05878fe
Iterators folloring a SmallVector erased element are invalidated so
...
don't access cached iterators from after the erased element.
Re-apply 49056 with SmallVector support.
llvm-svn: 49106
2008-04-02 18:24:46 +00:00
Chris Lattner
89d996afce
add operator==/!= to smallvector.
...
llvm-svn: 45872
2008-01-11 18:42:02 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
24d536e26b
add reverse iterators to smallvector
...
llvm-svn: 41198
2007-08-20 21:22:48 +00:00
Reid Spencer
8c5c7c8453
Change casts from old style to new style. This helps document the details
...
better, gives the compiler a chance to validate the cast and reduces warnings
if the user turns on -Wold-style-cast option.
llvm-svn: 41033
2007-08-12 08:12:35 +00:00
Chris Lattner
f570f023cf
memcpy with zero length is hugely expensive, so avoid it. This speeds up coallescing from 1.17s to 0.88s on siod.
...
llvm-svn: 40984
2007-08-10 07:02:50 +00:00
Chris Lattner
8995eae095
small speedup in the case where a smallvector is default ctor'd from
...
an empty vector. This speeds up llc slightly.
llvm-svn: 40983
2007-08-10 06:54:38 +00:00
Dan Gohman
2d36dfca67
Add an explicit keyword. Thanks Chris!
...
llvm-svn: 37819
2007-06-29 22:16:25 +00:00
Dan Gohman
d2a3725004
Add a default parameter to a SmallVector constructor to allow it to
...
be called with just an initial length value, just like in std::vector.
llvm-svn: 37779
2007-06-28 20:27:24 +00:00
Chris Lattner
c68a1721c2
silence some "comparison between signed and unsigned integer expressions"
...
warnings
llvm-svn: 37177
2007-05-17 20:01:40 +00:00
Dan Gohman
2340529c17
Fix some sporadic segfaults that are triggered when SmallVector's heap
...
storage lands near the end of the available address space. In the expression
Begin+N > Capacity, the Begin+N was overflowing. Fix this by replacing it
by with an expression that doesn't involve computation of an address
beyond the end of allocated memory.
llvm-svn: 37171
2007-05-17 18:29:01 +00:00
Jeff Cohen
ac369daaa3
Fix some VC++ warnings.
...
llvm-svn: 36259
2007-04-19 02:04:09 +00:00
Jeff Cohen
84d84f7381
The hack won't work on VS 2005, and it might not be needed anyway.
...
llvm-svn: 34930
2007-03-05 17:22:33 +00:00
Jeff Cohen
b58af23ff3
Elminate tabs and improve comments.
...
llvm-svn: 34921
2007-03-05 00:46:22 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
3490afcd50
fix a critical bug in smallvector, where it would destroy elements that are
...
not in its range (!).
llvm-svn: 34230
2007-02-13 07:25:36 +00:00
Chris Lattner
d9c5442b61
add missing ctor
...
llvm-svn: 33714
2007-01-31 20:08:34 +00:00
Chris Lattner
5c33fa2a37
add a new form of insert.
...
llvm-svn: 31290
2006-10-30 05:07:51 +00:00
Chris Lattner
9a99a284dc
Add SmallString a (currently) minimal class that adapts SmallVector to be
...
more string-like.
llvm-svn: 31289
2006-10-30 03:39:20 +00:00
Andrew Lenharth
6223a6ce63
Fix build error in gcc 3.4 and make more this general
...
llvm-svn: 30839
2006-10-09 19:05:44 +00:00
Chris Lattner
e3f0524253
Fix PR897
...
llvm-svn: 30820
2006-10-08 22:28:34 +00:00
Chris Lattner
7453a7d197
add a simple reserve method.
...
llvm-svn: 30011
2006-09-01 06:08:16 +00:00
Chris Lattner
4fa85705f6
Add 2nd form of resize
...
llvm-svn: 29945
2006-08-28 21:52:08 +00:00
Chris Lattner
a6735ae8d1
add resize, move swap out of line
...
llvm-svn: 29823
2006-08-22 17:28:57 +00:00
Chris Lattner
19d59ce917
add a bunch more operations, including swap, insert, erase, front(), and
...
bugfixes for operator=.
llvm-svn: 29811
2006-08-22 06:27:16 +00:00
Chris Lattner
402986c13f
silence a warning.
...
llvm-svn: 29734
2006-08-16 22:09:24 +00:00
Chris Lattner
2cd25d1642
Bugfixes for smallvector when the element size is small and N is small.
...
llvm-svn: 29720
2006-08-16 01:23:31 +00:00
Chris Lattner
67305e3cf6
avoid a warning
...
llvm-svn: 29674
2006-08-14 21:47:50 +00:00
Chris Lattner
870808beda
move code out of line so that GCC doesn't inline it at -O3
...
llvm-svn: 29636
2006-08-11 23:40:23 +00:00
Chris Lattner
6c9bcb32a3
Split SmallVector into SmallVector and SmallVectorImpl, which allows us to
...
eliminate code duplication due to the 'N' parameter.
llvm-svn: 29634
2006-08-11 23:19:51 +00:00
Chris Lattner
5f8473bc02
capacity is a pointer, not a value
...
llvm-svn: 29564
2006-08-08 01:54:17 +00:00
Chris Lattner
03c7b425a2
add a new assign method
...
llvm-svn: 29562
2006-08-08 01:44:16 +00:00
Chris Lattner
3bb43d2173
Add ctor that initializes from a range.
...
llvm-svn: 29560
2006-08-08 00:37:50 +00:00
Chris Lattner
3e1a9b0188
Remove assertions from the SmallVector class. They slow down clients of
...
smallvector too much in a release build. Removing them speeds up isel 4%.
llvm-svn: 29556
2006-08-07 23:41:59 +00:00
Chris Lattner
a4af471488
Add a clear method to SmallVector
...
llvm-svn: 29542
2006-08-07 05:45:34 +00:00
Evan Cheng
627a71290f
This causes some random crashes.
...
llvm-svn: 29534
2006-08-05 17:31:00 +00:00