Rafael Espindola
efe64e5f1e
Add bound checks in SmallVector
...
llvm-svn: 56432
2008-09-22 10:06:26 +00:00
Oscar Fuentes
0f25988689
Initial support for the CMake build system.
...
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Ted Kremenek
543bdab683
Added static methods to APSInt: getMinValue and getMaxValue.
...
llvm-svn: 56355
2008-09-19 18:01:14 +00:00
Daniel Dunbar
1b3e44db87
Add DenseMap::lookup:
...
/// lookup - Return the entry for the specified key, or a default
/// constructed value if no such entry exists.
llvm-svn: 55523
2008-08-29 00:48:44 +00:00
Chris Lattner
fe3155fc62
Switch the asmprinter (.ll) and all the stuff it requires over to
...
use raw_ostream instead of std::ostream. Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).
Other interesting changes:
1) This makes Value::print be non-virtual.
2) AP[S]Int and ConstantRange can no longer print to ostream directly,
use raw_ostream instead.
3) This fixes a bug in raw_os_ostream where it didn't flush itself
when destroyed.
4) This adds a new SDNode::print method, instead of only allowing "dump".
A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream
versions.
This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.
llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Dan Gohman
b6827db2c0
Add a clear() method to FoldingSet.
...
llvm-svn: 55210
2008-08-23 00:42:16 +00:00
Dan Gohman
abc71f026a
Add an empty() member to FoldingSet.
...
llvm-svn: 55182
2008-08-22 16:14:23 +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
Chris Lattner
fd64cbf22d
consolidate DenseMapInfo implementations, and add one for std::pair.
...
Patch contributed by m-s.
llvm-svn: 55167
2008-08-22 05:08:25 +00:00
Chris Lattner
bb8a53802b
remove redundant include
...
llvm-svn: 55116
2008-08-21 06:41:07 +00:00
Chris Lattner
16121a7f73
Fix the build with gcc 4.3 as the host, patch by Zhongxing Xu!
...
llvm-svn: 55115
2008-08-21 06:25:28 +00:00
Nick Lewycky
d9012655db
Fix build on GCC 4.3.
...
llvm-svn: 55110
2008-08-21 05:36:03 +00:00
Chris Lattner
c9fdd97035
Move the fast-path (<=i64) cases of various APInt methods inline
...
and the slow-path cases out of line. This speeds up instcombine
a bit in real world cases. Patch contributed by m-s.
llvm-svn: 55063
2008-08-20 17:02:31 +00:00
Chris Lattner
c0610874cc
Rework the routines that convert AP[S]Int into a string. Now, instead of
...
returning an std::string by value, it fills in a SmallString/SmallVector
passed in. This significantly reduces string thrashing in some cases.
More specifically, this:
- Adds an operator<< and a print method for APInt that allows you to
directly send them to an ostream.
- Reimplements APInt::toString to be much simpler and more efficient
algorithmically in addition to not thrashing strings quite as much.
This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter. This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.
llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner
4e4a482a41
remove a dead APInt ctor.
...
llvm-svn: 54869
2008-08-17 04:58:58 +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
Ted Kremenek
7bc723b79f
Removed redundant ctor.
...
llvm-svn: 54789
2008-08-14 21:17:07 +00:00
Daniel Dunbar
e249d30421
Add default constructor to APSInt
...
- Creates uninitialized APInt.
- Prevents need for embedding arbitrary constants when used as an out
parameter, for example.
llvm-svn: 54757
2008-08-13 20:53:17 +00:00
Bill Wendling
5aaf075b29
Removed unused parameters.
...
llvm-svn: 54262
2008-08-01 05:50:13 +00:00
Dan Gohman
9653b21dc2
Fold the useful features of alist and alist_node into ilist, and
...
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.
Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.
Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.
llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Anton Korobeynikov
583ed0eb6e
Remove bogus assertion. This unbreaks mingw, where ConstantSDNode
...
has alignment 8 and LoadSDNode (used as LargestT template) - 4.
llvm-svn: 53782
2008-07-19 05:52:44 +00:00
Ted Kremenek
6efe7adf98
Inline typedef for alist_iterator::pointer to work with MSVC++.
...
llvm-svn: 53517
2008-07-12 18:28:46 +00:00
Nick Lewycky
0dae6f90bb
operator[] is not defined for list::iterator. Overload it in ilist::iterator
...
to prevent silly things from happening accidentally. PR2171
llvm-svn: 53507
2008-07-12 07:00:52 +00:00
Ted Kremenek
d6dcdf8802
Minor tweaks to the ImmutableList iterator interface.
...
Added partial specialization of DenseMapInfo<T> for ImmutableList.
llvm-svn: 53485
2008-07-11 22:43:07 +00:00
Ted Kremenek
4e5efc791c
Make typedef public to make MSVC++ happy.
...
llvm-svn: 53433
2008-07-10 23:24:20 +00:00
Ted Kremenek
d2eef72ae9
Make some typedefs public to make MSVC++ happy.
...
llvm-svn: 53432
2008-07-10 23:09:45 +00:00
Ted Kremenek
9bd15119cd
Make typedefs in ilist public (Visual C++ errors out when they are private).
...
llvm-svn: 53431
2008-07-10 22:58:10 +00:00
Bill Wendling
7e2acf0dc9
Pull r53428 from Gaz into mainline:
...
Remove warnings about unused/shadowed variables.
llvm-svn: 53430
2008-07-10 22:57:49 +00:00
Ted Kremenek
91171c5406
Added ImmutableMap constructor that accepts a const TreeTy*.
...
llvm-svn: 53429
2008-07-10 22:57:10 +00:00
Dan Gohman
c3f346dc55
Tidy up #includes.
...
llvm-svn: 53426
2008-07-10 22:26:19 +00:00
Duncan Sands
e667a05fcb
Correct a comment.
...
llvm-svn: 53401
2008-07-10 11:21:59 +00:00
Dan Gohman
60e964b34c
Add some basic Pool-allocation infrastructure. This adds a Recycler class,
...
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.
llvm-svn: 53210
2008-07-07 22:58:06 +00:00
Dan Gohman
1834981eb0
Make ilist noncopyable too.
...
llvm-svn: 53190
2008-07-07 18:43:32 +00:00
Dan Gohman
fca9922b1b
Don't use std::advance just to increment or decrement by one.
...
llvm-svn: 53189
2008-07-07 18:39:33 +00:00
Dan Gohman
3755664b6d
Remove unnecessary static_casts.
...
llvm-svn: 53181
2008-07-07 18:08:20 +00:00
Dan Gohman
9112a5463e
Remove an unnecessary reinterpret_cast.
...
llvm-svn: 53180
2008-07-07 18:07:36 +00:00
Dan Gohman
955fdc7a4c
Add explicit keywords.
...
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Dan Gohman
c97817aac3
Make DenseMap's insert return a pair, to more closely resemble std::map.
...
llvm-svn: 53177
2008-07-07 17:46:23 +00:00
Ted Kremenek
1d321b8875
Removed ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new method does the same thing, except that it returns a pointer to the mapped data type, and not to an internal tree node.
...
llvm-svn: 53171
2008-07-07 16:20:55 +00:00
Dan Gohman
9c78662057
Use operator new instead of new char[].
...
llvm-svn: 53067
2008-07-03 00:59:36 +00:00
Owen Anderson
dd29406f31
Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
...
llvm-svn: 53033
2008-07-02 17:29:59 +00:00
Chris Lattner
441571cc05
optimize StringMap::clear
...
llvm-svn: 53009
2008-07-02 05:30:45 +00:00
Chris Lattner
06545d1c4a
Add a new (simple) StringMap::clear method, patch by Pratik
...
Solanki!
llvm-svn: 53008
2008-07-02 05:26:32 +00:00
Ted Kremenek
41502657f7
Implemented operator!= for the ImmutableList iterator.
...
llvm-svn: 52998
2008-07-02 00:06:55 +00:00
Owen Anderson
1530481dd3
Add a version of AddString that takes a const char* so we can avoid extraneous
...
conversions to std::string.
llvm-svn: 52995
2008-07-01 23:49:59 +00:00
Ted Kremenek
0b662363f9
Added partial specialization of FoldingSetTrait for pointers.
...
llvm-svn: 52989
2008-07-01 22:30:13 +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
Ted Kremenek
834afcfdcd
Added some comments and some cleanups.
...
llvm-svn: 52922
2008-06-30 20:41:22 +00:00