Daniel Dunbar
ac9a646035
Switch FoldingSet::AddString to StringRef based API.
...
- This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail.
llvm-svn: 82517
2009-09-22 03:34:53 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Nick Lewycky
f273659759
Add an API for strings with possible NULLs in the middle. Refactor the other
...
two AddString methods to use it.
llvm-svn: 64005
2009-02-07 04:57:08 +00:00
Dale Johannesen
a5699a1e8b
Do not use host floating point types when emitting
...
ASCII IR; loading and storing these can change the
bits of NaNs on some hosts. Remove or add warnings
at a few other places using host floating point;
this is a bad thing to do in general.
llvm-svn: 62712
2009-01-21 20:32:55 +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
Dan Gohman
b6827db2c0
Add a clear() method to FoldingSet.
...
llvm-svn: 55210
2008-08-23 00:42:16 +00:00
Dan Gohman
74ac3fddee
Avoid repeatedly reallocating the FoldingSetNodeID when searching
...
through multiple nodes in a bucket.
llvm-svn: 54687
2008-08-12 17:40:22 +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
a9f1f1db52
Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" throughout FoldingSet.cpp.
...
llvm-svn: 52425
2008-06-17 19:12:43 +00:00
Evan Cheng
d9353009b7
Fix more -Wshorten-64-to-32 warnings.
...
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Anton Korobeynikov
0c5e186924
Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
...
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Ted Kremenek
83e9c3ba5c
Fixed bug in FoldingSetIteratorImpl where we did not correctly check if
...
we had reached the "fake bucket" after the last bucket, allowing the iterator
in some cases to run off the end of the hashtable.
llvm-svn: 47178
2008-02-15 21:12:46 +00:00
Ted Kremenek
f06b7ac532
Added "Profile" method to APFloat for use with FoldingSet.
...
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary
objects to a profile via dispatch to FoldingSetTrait<T>::Profile().
Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their
functionality is now replaced using the above mentioned member template.
llvm-svn: 46957
2008-02-11 17:24:50 +00:00
Dan Gohman
011075cfdb
Add support to FoldingSet for hashing APInt objects.
...
llvm-svn: 46833
2008-02-06 23:09:15 +00:00
Ted Kremenek
6dab41ed32
Added "bucket_iterators" to FoldingSet. Bucket iterators allow iteration
...
over all the nodes in a particular bucket.
llvm-svn: 46716
2008-02-04 21:11:17 +00:00
Ted Kremenek
c84b3400b2
Fixed 80 col. violation.
...
llvm-svn: 46709
2008-02-04 17:14:20 +00:00
Ted Kremenek
a0105180ad
Made 'FoldingSetNodeID' a proper class instead of a nested class in
...
'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of
'FoldingSetNodeImpl::NodeID').
Why? Clients can now easily forward declare 'FoldingSetNodeID' without having
to include FoldingSet.h.
llvm-svn: 46187
2008-01-19 04:22:50 +00:00
Chris Lattner
ad9a6ccb83
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
19cb9fa4cc
Change a #include into a forward declaration
...
llvm-svn: 42781
2007-10-09 03:40:30 +00:00
Chris Lattner
de233151af
Add initial iterator support for folding set.
...
llvm-svn: 42589
2007-10-03 21:12:09 +00:00
Chris Lattner
8955442092
Simplify implementation of the FoldingSet circular list, a necessary step
...
to giving it iterators.
llvm-svn: 42586
2007-10-03 20:45:43 +00:00
Chris Lattner
bb109aed3d
fix a gcc warning: comparison between signed and unsigned integer expressions
...
llvm-svn: 41972
2007-09-14 22:57:00 +00:00
Dale Johannesen
575bd6070a
Remove the assumption that FP's are either float or
...
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).
llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Dan Gohman
1c9bf0bfb9
And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoid
...
ambiguity.
llvm-svn: 41960
2007-09-14 20:48:42 +00:00
Chris Lattner
e37ee33c4e
remove folding set debug output
...
llvm-svn: 34549
2007-02-24 01:41:48 +00:00
Chris Lattner
8b8100ecf5
Encode small integers more densely in foldingset, avoiding overflowing the SmallVector as often.
...
llvm-svn: 33864
2007-02-04 01:48:10 +00:00
Chris Lattner
9795be05c4
improve comments, add an assertion
...
llvm-svn: 33750
2007-02-01 05:33:21 +00:00
Reid Spencer
6d6e7a072b
Add some debug output.
...
llvm-svn: 33718
2007-01-31 21:27:38 +00:00
Chris Lattner
b8f4cada84
minor cleanups. Fix off-by-one in accounting the number of nodes when the
...
table grows.
llvm-svn: 33698
2007-01-31 06:04:41 +00:00
Chris Lattner
6bd1447e03
reformat comment
...
llvm-svn: 33675
2007-01-30 23:16:22 +00:00
Rafael Espindola
ef14a04371
assert.h -> cassert
...
llvm-svn: 31399
2006-11-03 01:38:14 +00:00
Rafael Espindola
e2f969dccb
#include <assert.h>
...
llvm-svn: 31386
2006-11-02 23:48:53 +00:00
Jim Laskey
c770e68c11
Allow FoldingSet clients to pump up the initial hash size.
...
llvm-svn: 31377
2006-11-02 14:21:26 +00:00
Jim Laskey
0a32281238
Try again.
...
llvm-svn: 31278
2006-10-29 09:19:59 +00:00
Jim Laskey
7c8f89c34e
Not handling zero length strings.
...
llvm-svn: 31277
2006-10-29 08:27:07 +00:00
Jim Laskey
d3d001e012
SmallVector append not insert.
...
llvm-svn: 31224
2006-10-27 19:38:32 +00:00
Jim Laskey
904dfc49e6
Grrr.
...
llvm-svn: 31223
2006-10-27 19:20:12 +00:00
Jim Laskey
398ce23c4d
Temp patch for missing functionality.
...
llvm-svn: 31222
2006-10-27 19:14:16 +00:00
Bill Wendling
7b6f145c8e
MathExtras isn't in the llvm/ADT directory but in the llvm/Support directory.
...
llvm-svn: 31219
2006-10-27 18:47:29 +00:00
Jim Laskey
3d1116e32c
Apply editorials.
...
llvm-svn: 31218
2006-10-27 18:05:12 +00:00
Jim Laskey
69b57830c2
Breakout folding hash set from SelectionDAGCSEMap.
...
llvm-svn: 31215
2006-10-27 16:16:16 +00:00