Chris Lattner
80d0eff786
Introduce a new array_pod_sort function and switch LSR to use it
...
instead of std::sort. This shrinks the release-asserts LSR.o file
by 1100 bytes of code on my system.
We should start using array_pod_sort where possible.
llvm-svn: 60335
2008-12-01 06:49:59 +00:00
Eli Friedman
401743c904
Fix bogus assertion using getSExtValue for legitimate values, like -1 in
...
an 128-bit-wide integer. No testcase; the issue I ran into depends on
local changes.
llvm-svn: 60311
2008-12-01 00:43:48 +00:00
Chris Lattner
ee7fbed62d
add the rest of the comparison routines.
...
llvm-svn: 60303
2008-11-30 19:10:41 +00:00
Chris Lattner
8c592b282e
fix indentation. std::pair is "isPod" if the first/second are both isPod.
...
llvm-svn: 60262
2008-11-30 00:50:20 +00:00
Torok Edwin
7f54c665a2
protect against negative values that would exceed allowed bit width
...
llvm-svn: 60239
2008-11-29 08:52:45 +00:00
Chris Lattner
ce03bccd7e
apparently GCC doesn't believe that I understand C
...
precedence rules. Pacify it.
llvm-svn: 60237
2008-11-29 08:36:39 +00:00
Duncan Sands
845f6467ba
Typo fix.
...
llvm-svn: 60236
2008-11-29 08:03:35 +00:00
Chris Lattner
7ae87447ed
Fix sentinels to use correctly 'aligned' pointers.
...
llvm-svn: 60229
2008-11-29 01:36:16 +00:00
Chris Lattner
070df849e9
Fix spello, add DenseMapInfo specialization for PointerIntPair.
...
llvm-svn: 60228
2008-11-29 01:18:05 +00:00
Chris Lattner
b41c45dbdf
fix comment typo
...
llvm-svn: 60227
2008-11-28 23:57:26 +00:00
Chris Lattner
507e71fce3
fix a bug.
...
llvm-svn: 60225
2008-11-28 23:36:15 +00:00
Chris Lattner
d8b755ed95
add a generic "bitmangled pointer" class, which allows a parameterized
...
pointer and integer type to be used.
llvm-svn: 60224
2008-11-28 23:31:44 +00:00
Ted Kremenek
d0f8118dc1
Add typedef to StringMapEntry.
...
llvm-svn: 60134
2008-11-27 00:17:25 +00:00
Chris Lattner
527a103e8e
add an operator= to assign to smallstring.
...
llvm-svn: 59715
2008-11-20 07:09:17 +00:00
Zhongxing Xu
12b52895f2
move partial template specialization to FoldingSet.h.
...
llvm-svn: 59434
2008-11-17 02:40:00 +00:00
Zhongxing Xu
fb7e7e8158
Fix 80-col violation.
...
llvm-svn: 59394
2008-11-16 04:44:41 +00:00
Zhongxing Xu
cfe0df8609
Add partial specialization of FoldingSetTrait for ImmutableList.
...
llvm-svn: 59387
2008-11-16 04:23:49 +00:00
Zhongxing Xu
b62b5ce749
Fix 80-column violation.
...
llvm-svn: 59385
2008-11-16 04:14:33 +00:00
Zhongxing Xu
bce4760ed8
Add Profile method to ImmutableList.
...
llvm-svn: 59362
2008-11-15 09:26:02 +00:00
Duncan Sands
dda3cac043
Work around PR1000.
...
llvm-svn: 58984
2008-11-10 10:05:09 +00:00
Chris Lattner
46166d50a8
split out the functionality of utohexstr into a new utohex_buffer
...
helper. This allows us to convert numbers to hex without necessarily
needing to make a std::string to hold the result.
llvm-svn: 58961
2008-11-10 04:22:46 +00:00
Dan Gohman
1532a1621c
Overload AddInteger on int/long/long long instead of on int/int64_t,
...
to avoid overload ambiguities. This fixes build errors introduced
by r58623.
llvm-svn: 58632
2008-11-03 19:40:18 +00:00
Nick Lewycky
3315ae6e08
Typo
...
llvm-svn: 58594
2008-11-03 03:50:40 +00:00
Daniel Dunbar
ec8e99098f
Return bool (inserted) from StringSet::insert as for StringMap::insert.
...
llvm-svn: 58268
2008-10-27 20:50:02 +00:00
David Greene
e8f05397ca
Add STL-style typedefs and default constructors to make it possible to
...
use DenseMap in more contexts.
llvm-svn: 58256
2008-10-27 18:15:15 +00:00
Ted Kremenek
fb81568ed6
Fix incorrect testing for the end of the both strings in CStrInCStrNoCase. This could cause a read-out-of-bounds error if s2 is smaller than s1.
...
llvm-svn: 58009
2008-10-22 23:16:52 +00:00
Ted Kremenek
270f3e22d5
constify some methods and variables in ImmutableList.
...
llvm-svn: 57894
2008-10-21 05:59:33 +00:00
Dan Gohman
440dea174f
Implement a SmallVector insert method that can insert multiple
...
copies of a value, and add several additional utilities to make
SmallVector better conform to the Container concept.
llvm-svn: 57616
2008-10-16 00:15:24 +00:00
Dan Gohman
307b390231
Fix several places that called mapped_iterator's constructor without
...
passing in a function object.
llvm-svn: 57615
2008-10-16 00:12:39 +00:00
Daniel Dunbar
2f3ec96450
Add llvm::hexdigit to StringExtras (number -> hexadecimal char)
...
llvm-svn: 57536
2008-10-14 23:26:20 +00:00
Chris Lattner
7e58510a50
this was to be removed after 2.4 branched.
...
llvm-svn: 57422
2008-10-12 18:57:09 +00:00
Chris Lattner
fc98ac247e
random cleanup
...
llvm-svn: 57383
2008-10-11 22:06:50 +00:00
Dale Johannesen
075a62519f
Add a "loses information" return value to APFloat::convert
...
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.
llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen
9e57068854
Rename APFloat::convertToAPInt to bitcastToAPInt to
...
make it clearer what the function does. No functional
change.
llvm-svn: 57325
2008-10-09 18:53:47 +00:00
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