Dan Gohman
48d03d5a2d
Add explicit keywords.
...
llvm-svn: 47382
2008-02-20 16:44:09 +00:00
Anton Korobeynikov
9c87c6526e
Add 'sink' cmdline option. Patch by Mikhail Glushenkov!
...
llvm-svn: 47377
2008-02-20 12:38:07 +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
0449b1da95
Fixed bug in APInt::Profile() where the BitWidth field was not included in the
...
profile of the APSInt object. This caused unexpected Profile collisions where
none should have occurred.
llvm-svn: 47338
2008-02-19 20:50:41 +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
Dan Gohman
9ca30afc39
Fix a warning about comparison between signed and unsigned,
...
being consistent with the rest of the APInt implementation.
llvm-svn: 47138
2008-02-14 22:38:45 +00:00
Dan Gohman
d22101a970
Add countTrailingOnes member functions to APInt.
...
llvm-svn: 47086
2008-02-13 21:11:05 +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
Dale Johannesen
c19b8c41c6
Chris' change to print an approximation to long doubles
...
exposed a bug in APFloat's long double->double conversion of
NaNs. Broke several things in the ieee part of gcc testsuite.
llvm-svn: 46617
2008-01-31 18:34:01 +00:00
Dan Gohman
daa38f69cf
Remove top-level const qualifiers from casts, avoiding associated
...
compiler warnings.
llvm-svn: 46509
2008-01-29 12:08:20 +00:00
Lauro Ramos Venancio
ad2a3eb416
Simplify the code and fix a typo.
...
llvm-svn: 46458
2008-01-28 20:02:51 +00:00
Lauro Ramos Venancio
947e17ae75
Fix fpcmp infinite loop when comparing "29-266" with "29-268".
...
llvm-svn: 46455
2008-01-28 18:23:23 +00:00
Ted Kremenek
dce31b9785
Added FoldingSet style 'profiling' support for APSInt.
...
llvm-svn: 46189
2008-01-19 04:31:12 +00:00
Ted Kremenek
702d3b8f37
Added FoldingSet style 'profiling' support for APInt.
...
llvm-svn: 46188
2008-01-19 04:23:33 +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
8193d4af33
remove attribution from lib Makefiles.
...
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Anton Korobeynikov
a0113f6c70
Cygwin defines uint32_t as unsigned long. Unbreak call to std::min in this case
...
llvm-svn: 45342
2007-12-24 11:16:47 +00:00
Reid Spencer
3a83a29e21
Don't have APInt.cpp depend upon DerivedTypes.h. This helps with splitting the
...
Support libraries separately into their own module.
llvm-svn: 44852
2007-12-11 06:53:58 +00:00
Chris Lattner
1fe38f35c1
proper #include order.
...
llvm-svn: 44707
2007-12-08 19:00:03 +00:00
Gordon Henriksen
e187dc4bfa
Adding a StringPool data structure, which GC will use.
...
llvm-svn: 44705
2007-12-08 17:07:47 +00:00
Neil Booth
054a756682
Prior commit updated wrong if, apologies.
...
llvm-svn: 44614
2007-12-05 13:06:04 +00:00
Neil Booth
b5afbd8e5a
Handle zero correctly.
...
llvm-svn: 44613
2007-12-05 13:01:24 +00:00
Dale Johannesen
15712dc45a
Handle 0 correctly in string->APFloat conversion.
...
llvm-svn: 44594
2007-12-05 01:10:19 +00:00
Chris Lattner
36854c740d
Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
...
llvm-svn: 44296
2007-11-23 22:42:31 +00:00
Chris Lattner
57a40dc2ad
Fix APInt::countTrailingZeros to return BitWidth if the input is zero instead of returning some random large number.
...
llvm-svn: 44294
2007-11-23 22:36:25 +00:00
Chris Lattner
56d872fcbb
Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
...
a valid but empty buffer if stdin is empty.
llvm-svn: 44219
2007-11-18 18:52:28 +00:00
Dale Johannesen
ea47b8b77d
Fix denormal check in float->APInt conversion.
...
PR 1804.
llvm-svn: 44201
2007-11-17 01:02:27 +00:00
Chris Lattner
edf6668dda
make smallptrset more const and type correct, which caught a few
...
minor bugs.
llvm-svn: 43782
2007-11-06 22:12:43 +00:00
Neil Booth
cd1d243989
Remove some unnecessary C-style statics.
...
Restore an assertion that arithmetic can be performed on this format.
llvm-svn: 43638
2007-11-02 15:10:05 +00:00
Neil Booth
7eeb095d37
Add back line whose removal somehow crept into prior patch
...
llvm-svn: 43627
2007-11-01 22:51:07 +00:00
Neil Booth
d04447b7ae
When converting to integer, do bit manipulations in the destination
...
memory rather than in a copy of the APFloat. This avoids problems
when the destination is wider than our significand and is cleaner.
Also provide deterministic values in all cases where conversion
fails, namely zero for NaNs and the minimal or maximal value
respectively for underflow or overflow.
llvm-svn: 43626
2007-11-01 22:43:37 +00:00
Hartmut Kaiser
48b3098b43
Clarified operator precedence.
...
Silenced VC++ warning.
llvm-svn: 43372
2007-10-25 23:15:31 +00:00
Chris Lattner
cee5f18fb6
This requires rtti info because tblgen uses commandline,
...
and tblgen requires rtti.
llvm-svn: 43127
2007-10-18 15:57:29 +00:00
Neil Booth
e14f19eda6
Fast-track obviously over-large and over-small exponents during decimal->
...
integer conversion. In some such cases this makes us one or two orders
of magnitude faster than NetBSD's libc. Glibc seems to have a similar
fast path.
Also, tighten up some upper bounds to save a bit of memory.
llvm-svn: 42984
2007-10-15 15:00:55 +00:00
Neil Booth
1463947f03
Consolidate logic for creating NaNs. Silence compiler warning.
...
llvm-svn: 42966
2007-10-14 10:39:51 +00:00
Neil Booth
138d8ef4a7
Whether arithmetic is supported is a property of the semantics. Make it
...
so, and clean up the checks by putting them in an inline function.
llvm-svn: 42965
2007-10-14 10:29:28 +00:00
Neil Booth
a352eb14cd
Separate out parsing of decimal number. Use this to only allocate
...
memory for the significand once up-front. Also ignore insignificant
trailing zeroes; this saves unnecessary multiplications later.
llvm-svn: 42964
2007-10-14 10:16:12 +00:00
Neil Booth
f3582ac0e0
If the power of 5 is exact, and the reciprocal exact, the error is zero not one half-ulps. This prevents an infinite loop in rare cases.
...
llvm-svn: 42950
2007-10-13 03:34:08 +00:00
Neil Booth
fb373da5fd
Remove duplicate comment.
...
llvm-svn: 42913
2007-10-12 16:05:57 +00:00
Neil Booth
078f455d15
Implement correctly-rounded decimal->binary conversion, i.e. conversion
...
from user input strings.
Such conversions are more intricate and subtle than they may appear;
it is unlikely I have got it completely right first time. I would
appreciate being informed of any bugs and incorrect roundings you
might discover.
llvm-svn: 42912
2007-10-12 16:02:31 +00:00
Neil Booth
4a0b91bebe
Remove a field that was never used.
...
llvm-svn: 42911
2007-10-12 15:35:10 +00:00
Neil Booth
9b83d8be07
If we're trying to be arbitrary precision, unsigned char clearly won't cut it. Needed for dec->bin conversions.
...
llvm-svn: 42910
2007-10-12 15:33:27 +00:00
Neil Booth
39cc673e61
Don't attempt to mask no bits
...
llvm-svn: 42909
2007-10-12 15:31:31 +00:00
Dale Johannesen
0ee2a2fb59
Next PPC long double bits. First cut at constants.
...
No compile-time support for constant operations yet,
just format transformations. Make readers and
writers work. Split constants into 2 doubles in
Legalize.
llvm-svn: 42865
2007-10-11 18:07:22 +00:00
Chris Lattner
a65ec649fd
Add new MemoryBuffer::getMemBufferCopy method.
...
llvm-svn: 42815
2007-10-09 21:46:38 +00:00
Dan Gohman
2fb0a249d7
Pass argc by value, not by reference, since it isn't modified.
...
llvm-svn: 42788
2007-10-09 16:04:57 +00:00