Chris Lattner
5c50f59690
Change a #include into a forward declaration
...
llvm-svn: 42781
2007-10-09 03:40:30 +00:00
Dan Gohman
2c6a821fd7
Move the space in overview output for commands out of each of the
...
commands and into the common code.
llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Neil Booth
49c6aab7b8
Use APInt::tcExtract. It's cleaner, and works :)
...
llvm-svn: 42746
2007-10-08 14:39:42 +00:00
Neil Booth
b618216e56
Add a new function tcExtract for extracting a bignum from an
...
arbitrary range of bits embedded in the middle of another bignum.
This kind of operation is desirable in many cases of software
floating point, e.g. converting bignum integers to floating point
numbers of fixed precision (you want to extract the precision most
significant bits).
Elsewhere, add an assertion, and exit the shift functions early if
the shift count is zero.
llvm-svn: 42745
2007-10-08 13:47:12 +00:00
Neil Booth
03f58ab706
Add back convertFromSignExtendedInteger.
...
llvm-svn: 42735
2007-10-07 12:15:41 +00:00
Neil Booth
ba205229e7
Now that convertFromUnsignedParts has a sane, constant interface,
...
convertFromZeroExtendedInteger can be simplified as it doesn't need
to make a copy of the source bignum.
llvm-svn: 42734
2007-10-07 12:10:57 +00:00
Neil Booth
6c1c8588ae
Reimplement convertFromUnsignedInteger so it is passed a const bignum.
...
It used to modify its argument in-place.
This interface is saner and the implementation more efficient. It will
be needed for decimal->binary conversion.
llvm-svn: 42733
2007-10-07 12:07:53 +00:00
Neil Booth
5f00973393
convertFromInteger, as originally written, expected sign-extended
...
input. APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input. Make this
assumption explicit in the function name.
llvm-svn: 42732
2007-10-07 11:45:55 +00:00
Neil Booth
d3985924f4
combineLostFractions does not need to be a member function
...
llvm-svn: 42729
2007-10-07 08:51:21 +00:00
Neil Booth
32897f5eb0
Cleaner, more general exponent output.
...
llvm-svn: 42690
2007-10-06 07:29:25 +00:00
Chris Lattner
2a9bcb9ea7
silence warnings in no-assert build.
...
llvm-svn: 42687
2007-10-06 06:13:42 +00:00
Neil Booth
c8b650ab14
Fix and clarify some comments.
...
llvm-svn: 42670
2007-10-06 00:43:45 +00:00
Neil Booth
0ea72a9a91
Generalize tcFullMultiply so that the operands can be of differing
...
part widths. Also, return the number of parts actually required to
hold the result's value.
Remove an over-cautious condition from rounding of float->hex conversion.
llvm-svn: 42669
2007-10-06 00:24:48 +00:00
Neil Booth
8f1946fa22
Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.
...
Useful for diagnostics and debugging.
llvm-svn: 42598
2007-10-03 22:26:02 +00:00
Chris Lattner
99f6ab7e4c
Add initial iterator support for folding set.
...
llvm-svn: 42589
2007-10-03 21:12:09 +00:00
Chris Lattner
8c41ed61d1
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
Neil Booth
1ca1f80b38
Tweak RoundAwayFromZero the bit number below which is truncated, and make
...
it const.
Preparation for APFloat -> hexadecimal string conversion.
llvm-svn: 42576
2007-10-03 15:16:41 +00:00
Dale Johannesen
28a2c4a9c4
Simplify and fix signed int -> FP conversions.
...
llvm-svn: 42483
2007-09-30 18:17:01 +00:00
Neil Booth
9acbf5aaf9
Whitespace and compiler warning cleanup.
...
llvm-svn: 42373
2007-09-26 21:33:42 +00:00
Dale Johannesen
e7439eff5a
Make APFloat->int conversions deterministic even in
...
cases with undefined behavior.
llvm-svn: 42328
2007-09-25 23:07:07 +00:00
Dale Johannesen
4f55d9fe0f
Fix long double<->shorter FP type conversions
...
of zero, infinity, and NaNs.
llvm-svn: 42298
2007-09-25 17:25:00 +00:00
Neil Booth
a8d7269269
Handle storage complications of float->float conversions.
...
llvm-svn: 42220
2007-09-22 02:56:19 +00:00
Dale Johannesen
4230512f32
Change APFloat::convertFromInteger to take the incoming
...
bit width instead of number of words allocated, which
makes it actually work for int->APF conversions.
Adjust callers. Add const to one of the APInt constructors
to prevent surprising match when called with const
argument.
llvm-svn: 42210
2007-09-21 22:09:37 +00:00
Dale Johannesen
146a0ea071
Fix PR 1688. See comments there.
...
llvm-svn: 42181
2007-09-20 23:47:58 +00:00
Devang Patel
00064e1bab
Do not hide APInt::dump() inside #ifndef NDEBUG.
...
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Chris Lattner
6395e5060d
fix a gcc warning: comparison between signed and unsigned integer expressions
...
llvm-svn: 41972
2007-09-14 22:57:00 +00:00
Dale Johannesen
98d3a08d8f
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
14cf78cde5
And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoid
...
ambiguity.
llvm-svn: 41960
2007-09-14 20:48:42 +00:00
Dan Gohman
58c468fb09
Remove spurious consts. This fixes warnings with compilers that
...
are strict about such things.
llvm-svn: 41956
2007-09-14 20:08:19 +00:00
Dale Johannesen
521988b604
Compensate for partCount change in Bogus definition
...
(could break hash table in ConstantFP)
llvm-svn: 41874
2007-09-12 01:22:05 +00:00
Dale Johannesen
245dceb06d
Add APInt interfaces to APFloat (allows directly
...
access to bits). Use them in place of float and
double interfaces where appropriate.
First bits of x86 long double constants handling
(untested, probably does not work).
llvm-svn: 41858
2007-09-11 18:32:33 +00:00
Evan Cheng
ee8d9a0e81
Smarter Reset(). Instead of deallocating all memory regions and reallocate the
...
first region, just deallocate all but the last region in the list.
llvm-svn: 41782
2007-09-08 00:02:17 +00:00
Evan Cheng
3dba41bf37
Added Reset() to free all allocated memory regions and reset state to be the same as right after ctor.
...
llvm-svn: 41728
2007-09-05 21:41:34 +00:00
Dale Johannesen
728687c423
Fix mod so it actually works. Fix conversions to
...
native types to handle denormals correctly.
llvm-svn: 41726
2007-09-05 20:39:49 +00:00
Dale Johannesen
689d17d282
Oops, should be part of 41664; won't work very well without this piece.
...
llvm-svn: 41665
2007-08-31 23:35:31 +00:00
Dale Johannesen
3cf889f75e
Enhance APFloat to retain bits of NaNs (fixes oggenc).
...
Use APFloat interfaces for more references, mostly
of ConstantFPSDNode.
llvm-svn: 41632
2007-08-31 04:03:46 +00:00
Dale Johannesen
d246b2ca5c
Change LegalFPImmediates to use APFloat.
...
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.
llvm-svn: 41587
2007-08-30 00:23:21 +00:00
Dale Johannesen
bdea32d812
Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
...
This means backing out the preceding change to Constants.cpp, alas.
llvm-svn: 41378
2007-08-24 22:09:56 +00:00
Dale Johannesen
918c33c67a
Revised per review feedback from previous patch.
...
llvm-svn: 41353
2007-08-24 05:08:11 +00:00
Chris Lattner
3da18eb22a
silence some warnings in an optimized build.
...
llvm-svn: 41352
2007-08-24 03:02:34 +00:00
Dale Johannesen
a719a60609
Change internal representation of ConstantFP to use APFloat.
...
Interface to rest of the compiler unchanged, as yet.
llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Chris Lattner
b0f158cfdf
rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
...
Add an APSInt::toString() method.
llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Chris Lattner
fe02c1f97f
initial checkin of Neil's APFloat work.
...
llvm-svn: 41203
2007-08-20 22:49:32 +00:00
Chris Lattner
6b69568f85
This adds a bunch of static functions that implement unsigned
...
two's complement bignum arithmetic. They could be used to
implement much of APInt, but the idea is they are enough to
implement APFloat as well, which the current APInt interface
is not suited for.
Patch by Neil Booth!
llvm-svn: 41124
2007-08-16 15:56:55 +00:00
Anton Korobeynikov
b61c63ecd0
Properly use const qualifiers
...
llvm-svn: 41111
2007-08-15 21:12:30 +00:00
Reid Spencer
155533cf73
Make getSTDIN return null if the standard input is empty, as the header file
...
documentation implies and as its uses depend.
llvm-svn: 40939
2007-08-08 20:01:58 +00:00
Reid Spencer
f13bcdc4a4
Escape some escapes that confuse doxygen.
...
llvm-svn: 40850
2007-08-05 19:33:11 +00:00
Chris Lattner
44f7d3aa0b
When clearing a SmallPtrSet, if the set had a huge capacity, but the
...
contents of the set were small, deallocate and shrink the set. This
avoids having us to memset as much data, significantly speeding up
some pathological cases. For example, this speeds up the verifier
from 0.3899s to 0.0763 (5.1x) on the testcase from PR1432 in a
release build.
llvm-svn: 40837
2007-08-05 07:32:14 +00:00
Owen Anderson
49f037ac29
Allow SmallPtrSet to hold pointers to const data.
...
llvm-svn: 40556
2007-07-27 18:07:02 +00:00
Owen Anderson
4c54024319
Make the copy constructor of SmallPtrSet much faster.
...
llvm-svn: 40474
2007-07-24 21:31:23 +00:00
Owen Anderson
ee99010782
Remember to free the heap allocated array if we're not going to use it.
...
llvm-svn: 40043
2007-07-19 06:45:33 +00:00
Owen Anderson
e21f270858
Fix an issue where assignments that caused a SmallPtrSet to become non-small
...
would result in calling realloc() on a null pointer. Instead, if we encounter
this situation, make a normal call to malloc().
llvm-svn: 40014
2007-07-18 19:54:15 +00:00
Reid Spencer
5060fd0fa3
Unbreak the build by putting calls to free into the implementation file and
...
having that implementation file #include <cstdlib>.
llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Owen Anderson
81990a3fc3
Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
...
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Nick Lewycky
ddc2f9ba57
Clarify the language. Pointed out by Duncan Sands.
...
llvm-svn: 39857
2007-07-14 17:41:03 +00:00
Nick Lewycky
61b4a265ee
Add alternate ConstantRange intersection algorithm.
...
llvm-svn: 39851
2007-07-14 02:51:34 +00:00
Owen Anderson
e33356b18e
Make the assignment operator for SmallPtrSet much faster for normal cases.
...
llvm-svn: 38474
2007-07-09 22:27:20 +00:00
Owen Anderson
3364abbb36
Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy
...
ctor while I'm at it.
Thanks to Chris Lattner for help with this patch.
llvm-svn: 38470
2007-07-09 20:59:01 +00:00
Owen Anderson
aee901745d
Fix an error in the assignment operator that was causing an infinite loop in GVNPRE.cpp.
...
Patch by Chis Lattner.
llvm-svn: 38467
2007-07-09 18:51:15 +00:00
Chris Lattner
85049a470e
implement operator= for smallptrset
...
llvm-svn: 38460
2007-07-09 16:54:03 +00:00
Gabor Greif
e16561cd5d
Here is the bulk of the sanitizing.
...
Almost all occurrences of "bytecode" in the sources have been eliminated.
llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Nick Lewycky
5105adfcd1
Fix undefined behaviour reported by the new --enable-expensive-checks option.
...
llvm-svn: 37829
2007-07-01 03:06:30 +00:00
Owen Anderson
6d7b6f1ab8
Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
...
llvm-svn: 37697
2007-06-22 00:11:18 +00:00
Chris Lattner
836e8f3f39
Two changes:
...
1. Make SmallPtrSet::erase faster in the small case by replacing a memmove
with a pointer copy.
2. Fix a bug where the null terminator at the end of the array in the small
case was not copied
llvm-svn: 37696
2007-06-21 23:23:32 +00:00
Nick Lewycky
d18b16034a
Fix edge case.
...
llvm-svn: 37532
2007-06-09 04:20:33 +00:00
Dale Johannesen
82810c8a13
Make tail merging the default, except on powerPC. There was no prior art
...
for a target-dependent default with a command-line override; this way
should be generally usable.
llvm-svn: 37285
2007-05-22 17:14:46 +00:00
Reid Spencer
b6af1aae35
Fix an assertion introduced by my last change to the toString method. We
...
can't use getZExtValue() to extract the low order bits for each digit.
Instead, we need to access the low order word directly.
llvm-svn: 37242
2007-05-19 00:29:55 +00:00
Reid Spencer
5c138133b7
Get rid of leading zeros in the output of toString.
...
llvm-svn: 37175
2007-05-17 19:23:02 +00:00
Reid Spencer
fffdf10566
For lshr by 0 bits, just return *this as a short cut. This also prevents
...
undefined behavior when the width > 64 bits.
llvm-svn: 37153
2007-05-17 06:26:29 +00:00
Reid Spencer
a93c981f66
Fix a bug in the "fromString" method where radix 2,8 and 16 values were
...
not being generated correctly because the shl operator does not mutate its
object but returns a new value. Also, make the distinction between radix
16 and the others more clear.
llvm-svn: 37111
2007-05-16 19:18:22 +00:00
Reid Spencer
98ed7db7ab
Make the results for the rotate functions correct when rotateAmt == 0.
...
llvm-svn: 37026
2007-05-14 00:15:28 +00:00
Reid Spencer
4c50b52f63
Add some things needed by the llvm-gcc version supporting bit accurate integer
...
types:
1. Functions to compute div/rem at the same time.
2. Further assurance that an APInt with 0 bitwidth cannot be constructed.
3. Left and right rotate operations.
4. An exactLogBase2 function which requires an exact power of two or it
returns -1.
llvm-svn: 37025
2007-05-13 23:44:59 +00:00
Reid Spencer
81ee020f64
Fix shl to produce the correct result when the bitwidth is > 64 and the
...
shift amount is 0. Previously this code would do a lshr by the bit width
which can lead to incorrect results.
llvm-svn: 37010
2007-05-12 18:01:57 +00:00
Chris Lattner
436370bac8
fix a memory leak
...
llvm-svn: 36981
2007-05-11 00:43:26 +00:00
Jeff Cohen
b6e144cffe
Unbreak VC++ build.
...
llvm-svn: 36901
2007-05-07 15:21:46 +00:00
Chris Lattner
275757a05e
Enhance MemoryBuffer to return error messages in strings if they occur.
...
llvm-svn: 36899
2007-05-06 23:32:36 +00:00
Chris Lattner
4211c20988
remove this file for now, we can bring it back from cvs if we need it in
...
the future (and integrate it with membuffer, etc)
llvm-svn: 36876
2007-05-06 19:10:47 +00:00
Chris Lattner
2fce8c5df8
remove libbzip2, it is dead
...
llvm-svn: 36875
2007-05-06 19:05:34 +00:00
Chris Lattner
d2517d6767
don't build bzip2 for now
...
llvm-svn: 36871
2007-05-06 09:31:32 +00:00
Chris Lattner
1761e05c5b
disable this for now
...
llvm-svn: 36870
2007-05-06 09:31:06 +00:00
Chris Lattner
5db36d3d82
Fix MemoryBuffer::getFile to return null if it has an error opening the
...
file instead of aborting.
llvm-svn: 36858
2007-05-06 07:24:46 +00:00
Chris Lattner
357882d27c
This is a patch to fix a compile error in STLExtras.h, and
...
a bug in GraphWriter.cpp.
Patch by Florian Brandner
llvm-svn: 36684
2007-05-03 18:32:10 +00:00
Chris Lattner
dad2d0939c
silence some annoying gcc 4.3 warnings
...
llvm-svn: 36680
2007-05-03 18:15:36 +00:00
Jeff Cohen
990a58f242
Fix MemoryBuffer breakage correctly.
...
llvm-svn: 36561
2007-04-29 14:43:31 +00:00
Jeff Cohen
50b2d2c6e3
Unbreak build.
...
llvm-svn: 36559
2007-04-29 14:21:44 +00:00
Chris Lattner
ee2d1f1ed2
Add a new memorybuffer class, to unify all the file reading code in the system
...
llvm-svn: 36553
2007-04-29 06:58:52 +00:00
Zhou Sheng
3178736d50
Using APInt more efficiently.
...
llvm-svn: 36475
2007-04-26 16:42:07 +00:00
Jeff Cohen
e7ce8f23f6
Fix PR1329.
...
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Reid Spencer
67378b22bb
We want the number of bits needed, not the power of 2.
...
llvm-svn: 35977
2007-04-14 00:00:10 +00:00
Reid Spencer
9329e7b626
Implement a getBitsNeeded method to determine how many bits are needed to
...
represent a string in binary form by an APInt.
llvm-svn: 35968
2007-04-13 19:19:07 +00:00
Zhou Sheng
01c175ec52
Make the apint construction more effective.
...
llvm-svn: 35960
2007-04-13 05:57:32 +00:00
Chris Lattner
af039c53c0
improve the patch for PR1318 to also support grouped options with custom
...
handlers (like the pass list). My previous fix only supported *new* command
line options, not additions to old ones.
This fixes test/Feature/load_module.ll
llvm-svn: 35935
2007-04-12 00:36:29 +00:00
Chris Lattner
83b53a5964
Fix PR1318 by reacting appropriately to a mutating option list.
...
llvm-svn: 35905
2007-04-11 15:35:18 +00:00
Reid Spencer
c49f2ef236
Fix an approximate calculation in an assertion not to give false negatives.
...
llvm-svn: 35901
2007-04-11 13:00:04 +00:00
Reid Spencer
21b76a9b99
For PR1291:
...
Change uses of sys::Path class to sys::PathWithStatus in those places where
the file status information is needed.
llvm-svn: 35743
2007-04-07 18:53:16 +00:00
Nick Lewycky
b89804f246
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
...
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Chris Lattner
0e1c1d4ae3
Fix a bug in my earlier commit which exposed positional options backwards.
...
This fixes llvm-ar.
llvm-svn: 35727
2007-04-07 05:38:53 +00:00
Chris Lattner
5247f60d20
rearchitect the registration mechanism used by the command line option stuff.
...
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called. In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main. Most of that
memory is now allocated by non-commandline related stuff.
llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner
2031b02faf
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
c770a0273d
stringmap memory managed with malloc now
...
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Chris Lattner
adf83a3513
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
2376346a8e
Extend StringMap to support being initialized as completely empty. When
...
initialized this way, they do not do a malloc to allocate their buckets.
llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Chris Lattner
64df4ba422
greatly reduce hte default size of stringmap.
...
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Nick Lewycky
f22938af1b
Implement union of wrapped sets.
...
llvm-svn: 35534
2007-04-01 03:47:44 +00:00
Reid Spencer
200c6f9c3d
For PR789:
...
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.
llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Reid Spencer
78b899f665
For PR789:
...
Updates for change in interface of getFileStatus method of sys::Path class.
llvm-svn: 35458
2007-03-29 16:48:16 +00:00
Zhou Sheng
0458c1db71
Fix a bug in getAllOnesValue() which broke
...
some test cases for bitwidth > 64.
llvm-svn: 35232
2007-03-21 04:34:37 +00:00
Jeff Cohen
e06855e684
Fix (and simplify) 48-bit byte swap.
...
Get pos/neg infinity the correct way.
llvm-svn: 35223
2007-03-20 20:42:36 +00:00
Reid Spencer
b1ec2e8ec7
Fix coding standards violation.
...
llvm-svn: 35189
2007-03-19 21:19:02 +00:00
Reid Spencer
6fae35acd3
Implement extension of sign bits for negative values in the uint64_t
...
constructor. This helps to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35180
2007-03-19 20:37:47 +00:00
Reid Spencer
6223c05805
Revert the last patch as it violates the conditions of sext/zext.
...
llvm-svn: 35068
2007-03-12 18:37:25 +00:00
Zhou Sheng
3999ffa0c8
For APInt::z/sext(width), if width == BitWidth, just return *this.
...
llvm-svn: 35065
2007-03-12 17:47:45 +00:00
Nick Lewycky
e455937fae
Add getter methods for the extremes of a ConstantRange.
...
llvm-svn: 35056
2007-03-10 15:54:12 +00:00
Jeff Cohen
b622c11f77
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Reid Spencer
1825dd0d7c
Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.
...
llvm-svn: 34852
2007-03-02 22:39:11 +00:00
Reid Spencer
cf8175617d
Use a better algorithm for rounding sqrt results. Change the FIXME about
...
this to a NOTE: because pari/gp results start to get rounded incorrectly
after 192 bits of precision. APInt and pari/gp never differ by more than
1, but APInt is more accurate because it does not lose precision after 192
bits as does pari/gp.
llvm-svn: 34834
2007-03-02 04:21:55 +00:00
Nick Lewycky
cf87f9eef5
Implement unionWith.
...
llvm-svn: 34833
2007-03-02 03:33:05 +00:00
Reid Spencer
c44bdae16b
Add a FIXME
...
llvm-svn: 34828
2007-03-02 02:01:34 +00:00
Reid Spencer
c442c84c8f
Fix a problem where shifting by 64-bits leads to incorrect results on PPC
...
but not on X86 becuase shift by word size is "undefined".
llvm-svn: 34825
2007-03-02 01:19:42 +00:00
Reid Spencer
1b8dfcbaaa
Combine two lines that can be.
...
llvm-svn: 34818
2007-03-01 23:30:25 +00:00
Reid Spencer
2f6ad4d3c3
Make the static table of results in sqrt const.
...
llvm-svn: 34791
2007-03-01 17:47:31 +00:00
Reid Spencer
742d1704e1
Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
...
llvm-svn: 34789
2007-03-01 17:15:32 +00:00
Reid Spencer
6a44033465
Remove the "isSigned" parameters from ConstantRange. It turns out they
...
are not needed as the results are the same with or without it.
Patch by Nicholas Lewycky.
llvm-svn: 34782
2007-03-01 07:54:15 +00:00
Reid Spencer
c8841d2ea2
Use a real table in sqrt to shorten and quicken the code.
...
Thanks for the idea Chris.
llvm-svn: 34779
2007-03-01 06:23:32 +00:00
Reid Spencer
d99feafd5f
Add a square root function.
...
llvm-svn: 34775
2007-03-01 05:39:56 +00:00
Reid Spencer
9b3d6ec983
Move ConstantRange class to lib/Support from lib/Analysis and make its
...
interface not depend on Type or ICmpInst.
llvm-svn: 34761
2007-02-28 22:02:48 +00:00
Reid Spencer
91d3b3fce9
Make the trunc/sext/zext methods return APInt& so that these operations
...
can be chained together with other operations.
llvm-svn: 34743
2007-02-28 17:34:32 +00:00
Reid Spencer
66d0d572c2
Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
...
instead of honoring the client's requested bit width.
llvm-svn: 34712
2007-02-28 01:30:08 +00:00
Reid Spencer
c2d433d47a
Join two lines that can be joined.
...
llvm-svn: 34705
2007-02-27 23:49:07 +00:00
Reid Spencer
31acef50ad
Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
...
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000
llvm-svn: 34695
2007-02-27 21:59:26 +00:00
Reid Spencer
70cb5d4287
Improve APInt interface:
...
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
so simple.
3. Simplify sdiv and srem code.
llvm-svn: 34680
2007-02-27 20:24:31 +00:00
Reid Spencer
997d9e4585
Conform to single person attribution in file comment.
...
llvm-svn: 34678
2007-02-27 19:31:09 +00:00
Reid Spencer
54abdcf30b
1. Fix three serious bugs in the comparison code.
...
2. Change RoundDoubleToAPInt to take a bit width parameter. Use that
parameter to limit the bit width of the result.
llvm-svn: 34673
2007-02-27 18:23:40 +00:00
Reid Spencer
011651745c
Get rid of extraneous // in file comment.
...
llvm-svn: 34662
2007-02-27 07:35:18 +00:00
Reid Spencer
974551a7e9
Simplify and document RoundDoubleToAPInt.
...
llvm-svn: 34648
2007-02-27 01:28:10 +00:00
Reid Spencer
7c16cd2746
1. Make sure all delete operators of arrays use the array form of delete.
...
2. Rewrite operator=(const APInt& RHS) to allow the RHS to be a different
bit width than the LHS. This makes it possible to use APInt as the key
of a DenseMap, as needed for the IntConstants map in Constants.cpp
3. Fix operator=(uint64_t) to clear unused bits in case the client assigns
a value that has more bits than the APInt allows.
4. Assert that bit widths are equal in operator==
5. Revise getHashValue() to put the bit width in the low order six bits.
This should help to make i1 0, i2 0, ... i64 0 all distinct in the
IntConstants DenseMap.
llvm-svn: 34646
2007-02-26 23:38:21 +00:00
Reid Spencer
b2bc985a4e
Implement the getHashValue method.
...
Fix toString use of getValue to use getZExtValue()
llvm-svn: 34642
2007-02-26 21:02:27 +00:00
Reid Spencer
f09418d428
Re-enable this. The header was committed.
...
llvm-svn: 34634
2007-02-26 08:10:54 +00:00
Chris Lattner
d9fc268035
another missing header :( :( :(
...
llvm-svn: 34632
2007-02-26 07:51:00 +00:00
Reid Spencer
aa8dcfe441
1. Remove redundant calls to clearUsedBits().
...
2. Fix countTrailingZeros to use a faster algorithm.
3. Simplify sext() slightly by using isNegative().
4. Implement ashr using word-at-a-time logic instead of bit-at-a-time
5. Rename locals named isNegative so they don't clash with method name.
6. Fix fromString to compute negated value correctly.
llvm-svn: 34629
2007-02-26 07:44:38 +00:00
Reid Spencer
44eef169fa
Rewrite lshr to not do bit by bit copy but to copy and shift whole words.
...
This makes it much more efficient.
llvm-svn: 34618
2007-02-26 01:19:48 +00:00
Reid Spencer
fb55b7b99d
Fix sext operation. Shifting by zero would leave an incorrect mask.
...
llvm-svn: 34617
2007-02-25 23:54:00 +00:00
Reid Spencer
b6b5cc3e2f
1. Fix the flip() method to correctly flip all words of the APInt.
...
2. Implement the trunc, sext, and zext operations.
3. Improve fromString to accept negative values as input.
llvm-svn: 34616
2007-02-25 23:44:53 +00:00
Reid Spencer
a41e93be3d
1. Provide more detail in file comment.
...
2. Move comments for methods to .h file, delete them in .cpp file.
3. All places that were doing manual clear of high order bits now call the
clearUnusedBits() method in order to not depend on undefined behavior
of the >> operator when the number of bits shifted equals the word size.
4. Reduced # of loc by using the new result of clearUnusedBits() method.
5. Simplified logic (decreased indentation) in a few places.
6. Added code comments to larger functions that needed them.
7. Added FIXME notes about weak implementations of things (e.g. bit-by-bit
shift right is sub-optimal).
llvm-svn: 34603
2007-02-25 19:32:03 +00:00
Reid Spencer
28555779b4
Allow this to compile now that the header file is checked in.
...
llvm-svn: 34581
2007-02-25 07:30:14 +00:00
Chris Lattner
4ae31ba82c
this doesn't compile, disable it
...
llvm-svn: 34571
2007-02-25 02:32:44 +00:00
Reid Spencer
522ca7cd8b
Clean up lshr and ashr to coding standards.
...
Handle the single word cases for shiftAmt == BitWidth.
llvm-svn: 34569
2007-02-25 01:56:07 +00:00
Reid Spencer
ab0e08ae2f
Whoops, last word with bits in large shift left wasn't correct.
...
llvm-svn: 34565
2007-02-25 01:08:58 +00:00
Reid Spencer
a5c84d95fa
Fix the > 64 bits case for left shift.
...
llvm-svn: 34564
2007-02-25 00:56:44 +00:00
Reid Spencer
468ad911cb
Fix the remainder shifting in KnuthDiv.
...
llvm-svn: 34562
2007-02-24 20:38:01 +00:00
Reid Spencer
632ebdf8bd
1. Fix a bug in fromString for the <= 64bits case
...
2. Fix shl when shiftAmount == BitWidth.
llvm-svn: 34560
2007-02-24 20:19:37 +00:00
Reid Spencer
df6cf5ab71
1. Fix last bug in KnuthDiv. All divide tests pass up to 1024 bits now.
...
2. Clean up comments, style, coding standards, etc.
3. Simplify a constructor.
Extended testing revealed some additional bugs in shifting. I'll fix these
tomorrow.
llvm-svn: 34559
2007-02-24 10:01:42 +00:00
Reid Spencer
a5e0d200c9
1. Make internal functions take const arguments where they should, just
...
to be safe.
2. Make internal functions that return a carry/borrow return bool instead
of uint64_t because the carry/borrow can only be in range [0,1].
3. Assert that the pointers to KnuthDiv are all different so that the
result and operands can't overlap.
4. Add debug output to KnuthDiv function.
5. Fix a problem with KnuthDiv by separating the b's complement operation
from the subtraction borrow operation. This fixes a wide range of
division problems, but alas, not all of them.
llvm-svn: 34554
2007-02-24 03:58:46 +00:00
Chris Lattner
a5821eca0d
remove folding set debug output
...
llvm-svn: 34549
2007-02-24 01:41:48 +00:00
Chris Lattner
66330fdddb
Avoid TBAA issue.
...
llvm-svn: 34539
2007-02-23 22:31:24 +00:00
Reid Spencer
cb292e4a20
1. Fix a carry out problem in add if destination and x point to the same
...
memory (as done in fromString).
2. Implement Knuth divide more closely to what is recommended in his book.
3. Fix computation of the remainder for Knuth Divide (bad shifting).
4. Remove some cruft from the file
llvm-svn: 34518
2007-02-23 01:57:13 +00:00
Reid Spencer
867b4064ae
When converting from 64 to 32-bits, use the actual number of words to
...
extract the value, not the number of words implied by the active bits.
This fixes numerous, but not all divide bugs.
llvm-svn: 34484
2007-02-22 00:58:45 +00:00
Reid Spencer
e4ce71d07a
Fix countLeadingZeros in the case that the bitwidth evenly divides the
...
word size. This fixes all reads of uninitialized data (buffer over read)
and makes APInt.cpp memory clean, per valgrind. The only remaining
problem is division in a few cases.
llvm-svn: 34483
2007-02-22 00:22:00 +00:00
Reid Spencer
58a6a43cb3
Reorganize some code to make it clearer, avoid a few uninitialized memory
...
reads, and reduce the number of temporary APInt instances we construct.
llvm-svn: 34467
2007-02-21 08:21:52 +00:00
Reid Spencer
db2abec8ac
Fix the carry in addition.
...
llvm-svn: 34465
2007-02-21 05:44:56 +00:00
Reid Spencer
1ba833564e
1. Add a dump() method for faster debugging.
...
2. Change 0 initialization of union to larger component so all is zeroed.
3. Fix the borrow logic in subtraction so it works for > 128 bits.
4. Rewrite fromString to use a simpler but correct algorithm and also to
not set the bit width contrary to the user's request.
5. Optimize toString a bit by making it only do one Knuth divide per
iteration instead of two.
With these changes, all arithmetic passes (verified by pari/GP) up to
1024 bits except for certain division cases.
llvm-svn: 34463
2007-02-21 03:55:44 +00:00
Reid Spencer
74cf82e522
Fix countLeadingZeros to actually return the correct number.
...
Fix toString to correctly return "0" for zero valued APInts over 128 bits.
llvm-svn: 34459
2007-02-21 00:29:48 +00:00
Reid Spencer
7a6a8d5116
Make long addition and subtraction work. Speed things up by using internal
...
functions more.
llvm-svn: 34458
2007-02-20 23:40:25 +00:00
Reid Spencer
4bb430c4b4
Clean up variable names in operator*.
...
Attempt #3 for getting a portable INFINITY value.
llvm-svn: 34454
2007-02-20 20:42:10 +00:00
Reid Spencer
a83af6e1fc
Use INFINITY macro from math.h instead of constructing hex floating point
...
constants (avoids warnings).
llvm-svn: 34452
2007-02-20 18:29:12 +00:00
Reid Spencer
fb77b2ba13
First version that can process arith.cpp test case up to 1024 bits:
...
1. Ensure pVal is set to 0 in each constructor.
2. Fix roundToDouble to make correct calculations and not read beyond the
end of allocated memory.
3. Implement Knuth's "classical algorithm" for division from scratch and
eliminate buffer overflows and uninitialized mememory reads. Document
it properly too.
4. Implement a wrapper function for KnuthDiv which handles the 64-bit to
32-bit conversion and back. It also implement short division for the
n == 1 case that Knuth's algorithm can't handle.
5. Simplify the logic of udiv and urem a little, make them exit early, and
have them use the "divide" wrapper function to perform the division
or remainder operation.
6. Move the toString function to the end of the file, closer to where
the division functions are located.
Note: division is still broken for some > 64 bit values, but at least it
doesn't crash any more.
llvm-svn: 34449
2007-02-20 08:51:03 +00:00
Chris Lattner
4510c99a57
Not all managedstatics need object pointers.
...
llvm-svn: 34444
2007-02-20 06:18:57 +00:00
Reid Spencer
861c1cb67a
1. Fix some indentation and variable names in the get{Min,Max}Value methods.
...
2. Implement toString for power-of-2 radix without using divide and always
printing full words. This allows hex/binary to look at the bit
respresentation of the APInt as well as avoid bugs in divide.
llvm-svn: 34396
2007-02-18 22:29:05 +00:00
Reid Spencer
be4ddf6856
1. Use APINT_WORD_SIZE instead of sizeof(uint64_t)
...
2. Teach slt about signedness.
3. Teach roundToDouble to properly sign extend.
llvm-svn: 34391
2007-02-18 20:09:41 +00:00
Reid Spencer
a856b6e985
1. Remove dead code (lshift function).
...
2. Consolidate memory allocation into just two inline functions.
3. Convert "unsigned" to uint32_t to gaurantee its size.
4. Eliminate magic constants and replace with symbolic equivalent.
5. Improve code documentation slightly.
6. Simplify the logical operator code because bitwidths must be the same.
7. Fix indentation per coding standards.
8. Use exit-early style to reduce indentation in several functions.
llvm-svn: 34389
2007-02-18 18:38:44 +00:00
Reid Spencer
ee0a685ea1
Make add_1 exit early if carry is 0.
...
Fix line breaks and 80 cols violation.
Simplify operator^= since bitwidths must be the same.
llvm-svn: 34388
2007-02-18 06:39:42 +00:00
Reid Spencer
fbd48a566a
Implement signed output for toString.
...
Fix bugs in countLeadingZeros and countTrailingZeros.
llvm-svn: 34386
2007-02-18 00:44:22 +00:00
Reid Spencer
26c6616e4b
Fix some bugs in division logic.
...
llvm-svn: 34384
2007-02-17 22:38:07 +00:00
Reid Spencer
100502d256
Move static functions closer to their usage.
...
llvm-svn: 34363
2007-02-17 03:16:00 +00:00
Reid Spencer
3986776fbd
Clean up the divide and remainder logic a bit (exit early). Use more
...
meaningful variable names. Add comments to document the flow.
llvm-svn: 34362
2007-02-17 02:07:07 +00:00
Reid Spencer
a32372d110
Fix bugs introduced by constructor parameter order change.
...
llvm-svn: 34357
2007-02-17 00:18:01 +00:00
Reid Spencer
1d0721209d
Review changes:
...
1. Function style changes.
2. 80-col violations.
3. Better names for things.
4. Arrange constructors so they all take bit width first.
5. Add named signed and unsigned comparison functions and remove the
corresponding operators.
6. Remove operator&& and operator|| but provide a getBoolValue function which
converts to bool as comparison against 0. This allows the normal && and
|| operators to be used as if (X.getBoolValue() && Y.getBoolValue())
Note: this still doesn't function 100% yet. I'm working on the bugs now.
llvm-svn: 34353
2007-02-16 22:36:51 +00:00
Anton Korobeynikov
d01defedf6
Add possibility to set memory limit for binaries run via libSystem. This
...
is especially needed for bugpoint. This partly implements PR688
llvm-svn: 34349
2007-02-16 19:11:07 +00:00
Zhou Sheng
cfa2ac0592
Fix some buges:
...
1. Make getMinValue() returns the right value.
2. Fix the ByteSwap() crash problem.
3. Make Postfix increment work correctly.
4. Fix some bugs in LogBase2, Hi/LoBits and UDiv.
llvm-svn: 34304
2007-02-15 06:36:31 +00:00
Reid Spencer
0c5db23119
Use brute-force algorithm for to_string. It doesn't have to be efficient
...
at this point, it just needs to work so we can test things reliably.
llvm-svn: 34262
2007-02-14 02:52:25 +00:00
Reid Spencer
5153525402
Make some minor improvements to APInt:
...
1. Make all the operators use uppercase
2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is
redundant.
3. Turn the class on for compilation.
llvm-svn: 34253
2007-02-13 22:41:58 +00:00
Zhou Sheng
d707d63317
1. Make APInt::shl work correctly and more efficiently.
...
2. Add functions to support the numberical conversion between APInt and
double/float.
llvm-svn: 34201
2007-02-12 20:02:55 +00:00
Chris Lattner
77baa56a70
Add support for removing elements out of StringMap.
...
llvm-svn: 34185
2007-02-11 20:58:00 +00:00
Chris Lattner
db08c1bc83
Replace the ugly FindValue method with STL-like find methods.
...
llvm-svn: 34183
2007-02-11 19:49:41 +00:00
Chris Lattner
9521fec8cf
remove support for stringmap visitors now that iterators exist.
...
llvm-svn: 34180
2007-02-11 08:22:15 +00:00
Chris Lattner
e15605ccbf
add support for iterators.
...
llvm-svn: 34179
2007-02-11 08:20:35 +00:00
Zhou Sheng
e93db8fba2
Eliminates friend function declaration inside APInt, instead, adds public
...
methods as those global function's internal implementation.
llvm-svn: 34083
2007-02-09 07:48:24 +00:00
Chris Lattner
751a42010b
Rename CStringMap -> StringMap, since it now supports nul characters in the
...
strings.
llvm-svn: 34064
2007-02-08 19:20:57 +00:00
Chris Lattner
259ba20bd8
Allow cstringmap to contain strings with nul characters in them.
...
llvm-svn: 34062
2007-02-08 19:08:37 +00:00
Zhou Sheng
11eea86410
Switched this file on accidently.
...
llvm-svn: 34054
2007-02-08 16:45:48 +00:00
Zhou Sheng
fbf61eaba7
As Chris and Reid suggested, remove "isSigned" field from APInt, instead,
...
add some signed/unsigned arithmetic operation functions into APInt.h to
handle the signed/unsigned issue. These functions will be defined inside a
namespace "APIntOps" which is inside llvm namespace.
llvm-svn: 34053
2007-02-08 14:35:19 +00:00
Zhou Sheng
3e8022d61d
As Chris suggested, fixed some problems. (This is the first part)
...
llvm-svn: 33989
2007-02-07 06:14:53 +00:00
Chris Lattner
e346767f06
do not let the table fill up with tombstones.
...
llvm-svn: 33973
2007-02-07 01:11:25 +00:00
Zhou Sheng
94b623aad4
As Reid suggested, fixed some problems.
...
llvm-svn: 33955
2007-02-06 06:04:53 +00:00
Chris Lattner
28cbd1d624
Disable this for now.
...
llvm-svn: 33953
2007-02-06 05:38:37 +00:00
Zhou Sheng
dac63788ab
Add a class APInt to represent arbitrary precision constant integral values.
...
It is a functional replacement for common case integer type like "unsigned",
"uint64_t", but also allows non-byte-width integer type and large integer
value types such as 3-bits, 15-bits, or more than 64-bits of precision. For
more details, see pr1043.
llvm-svn: 33951
2007-02-06 03:00:16 +00:00
Chris Lattner
92c5d1185f
Fix a bug in smallptrset::erase: in the small case, return true if the
...
element was in the set.
llvm-svn: 33931
2007-02-05 23:10:31 +00:00
Chris Lattner
010ee96261
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
4f5cdecde3
improve comments, add an assertion
...
llvm-svn: 33750
2007-02-01 05:33:21 +00:00
Devang Patel
9eb2caaeb6
Add PrintVersionMessage() that tools can use to print version number
...
without exiting program.
llvm-svn: 33737
2007-02-01 01:43:37 +00:00
Reid Spencer
e7422f6b8d
Add some debug output.
...
llvm-svn: 33718
2007-01-31 21:27:38 +00:00
Chris Lattner
0dbb13735e
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
a94523df7b
reformat comment
...
llvm-svn: 33675
2007-01-30 23:16:22 +00:00
Chris Lattner
39ab70cf80
implement SmallPtrSet::erase
...
llvm-svn: 33581
2007-01-27 07:59:10 +00:00
Chris Lattner
ab5d0ba168
add a note
...
llvm-svn: 33578
2007-01-27 07:18:32 +00:00
Chris Lattner
74102df857
Add a new SmallSet ADT specialized for pointers.
...
llvm-svn: 33577
2007-01-27 07:10:46 +00:00
Anton Korobeynikov
a41d9eca96
Moved disassembler to libSystem
...
llvm-svn: 33461
2007-01-23 10:26:08 +00:00
Anton Korobeynikov
3e956974b3
Adding disassembler interface and external hook to udis86 library.
...
llvm-svn: 33358
2007-01-19 17:25:17 +00:00
Chris Lattner
dff39e53f1
wow, the link was already broken :)
...
llvm-svn: 32963
2007-01-06 23:20:51 +00:00
Chris Lattner
8a7183b5b8
add a note
...
llvm-svn: 32962
2007-01-06 23:19:38 +00:00
Bill Wendling
4ec17c3951
The previous implementation of LLVM Streams wasn't removing symbols. This
...
one should.
llvm-svn: 32845
2007-01-03 22:37:27 +00:00
Chris Lattner
00bb216977
eliminate constructor from Statistic class. It is now impossible to get a
...
static constructor for them :). Transition complete.
llvm-svn: 32710
2006-12-19 23:17:40 +00:00
Chris Lattner
13bfd32f5d
Refactor statistic a big and introduce a horrible-but-necessary macro
...
(STATISTIC), which allows us to define statistics that don't introduce
static ctors into the .o files. I'm migrating code over to use this
incrementally.
llvm-svn: 32687
2006-12-19 21:27:47 +00:00
Bill Wendling
a77f14265b
Added an automatic cast to "std::ostream*" etc. from OStream. We then can
...
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.
llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Chris Lattner
8c9969ac03
Change the implementation of statistic to not need destructors at all.
...
Instead, the stat info is printed when llvm_shutdown() is called.
These also don't need static ctors, but getting rid of them is uglier:
still investigating. This reduces the number of static dtors in llvm from
~1400 to ~750.
llvm-svn: 32372
2006-12-08 20:00:42 +00:00
Bill Wendling
30c0f3367c
Don't use <sstream> in Streams.h but <iosfwd> instead.
...
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Bill Wendling
355fc5ad50
Removed more <iostream> includes
...
llvm-svn: 32321
2006-12-07 20:28:15 +00:00
Bill Wendling
f3baad3ee1
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
...
now cerr, cout, and NullStream resp.
llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
5bbf770764
merge the Statistic and StatisticBase classes, eliminating virtual methods
...
and eliminating #includes from the Statistic.h file.
llvm-svn: 32282
2006-12-06 18:20:44 +00:00
Chris Lattner
700b873130
Detemplatize the Statistic class. The only type it is instantiated with
...
is 'unsigned'.
llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Chris Lattner
228bcd3802
Add a helper function
...
llvm-svn: 31981
2006-11-28 22:32:35 +00:00
Bill Wendling
3750ae25a0
Removed #include <iostream> and replace with llvm_* streams.
...
llvm-svn: 31927
2006-11-26 10:52:51 +00:00
Reid Spencer
aa5c220665
Make the absolute/relative tolerance information easier to read/understand.
...
llvm-svn: 31908
2006-11-25 08:38:44 +00:00
Bill Wendling
9594f3a196
Moved definition of llvm_ostream wrappers to the Streams.cpp file.
...
llvm-svn: 31819
2006-11-17 09:54:47 +00:00
Bill Wendling
3315869498
Added wrappers for the std::cerr/std::cout objects. The wrappers will
...
soon replace all uses of those objects.
llvm-svn: 31817
2006-11-17 09:51:22 +00:00
Bill Wendling
d7fda04420
Added "DOUT" macro. This is used as a replacement for the std::cerr
...
stream. It centralizes the use of std::cerr so that static c'tor/d'tors
aren't scattered around all over the place. The way to use it is like this:
DOUT << "This is a status line: " << Var << "\n";
If "-debug" is specified, it will print. Otherwise, it'll not print. If
NDEBUG is defined, the DOUT does nothing.
llvm-svn: 31798
2006-11-17 00:49:12 +00:00
Jim Laskey
61feeb90f9
Remove redundant <cmath>.
...
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
John Criswell
8ea2e68493
Include llvm/Support/DataTypes.h to define intptr_t.
...
This fixes the build on OpenBSD and potentially other systems.
llvm-svn: 31550
2006-11-08 15:04:35 +00:00
Rafael Espindola
f16dbf697a
assert.h -> cassert
...
llvm-svn: 31399
2006-11-03 01:38:14 +00:00
Rafael Espindola
a1fde82b6b
#include <assert.h>
...
llvm-svn: 31386
2006-11-02 23:48:53 +00:00
Jim Laskey
eb0fd251c1
Allow FoldingSet clients to pump up the initial hash size.
...
llvm-svn: 31377
2006-11-02 14:21:26 +00:00
Chris Lattner
149e666baf
add a highly efficient hash table that is specialized for mapping C strings
...
to some other type.
llvm-svn: 31286
2006-10-29 23:42:03 +00:00
Chris Lattner
b9de90377f
Add a new llvm::Allocator abstraction, which will be used by a container
...
I'm about to add. This is similar to, but necessarily different than, the
STL allocator class.
llvm-svn: 31285
2006-10-29 22:08:03 +00:00
Jim Laskey
179ebd3fc3
Try again.
...
llvm-svn: 31278
2006-10-29 09:19:59 +00:00
Jim Laskey
8f05a611e9
Not handling zero length strings.
...
llvm-svn: 31277
2006-10-29 08:27:07 +00:00
Jim Laskey
cef515fcc0
SmallVector append not insert.
...
llvm-svn: 31224
2006-10-27 19:38:32 +00:00
Jim Laskey
a9e9cae33e
Grrr.
...
llvm-svn: 31223
2006-10-27 19:20:12 +00:00
Jim Laskey
a88e609c0f
Temp patch for missing functionality.
...
llvm-svn: 31222
2006-10-27 19:14:16 +00:00
Bill Wendling
e0412f500e
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
6ca4a345dd
Apply editorials.
...
llvm-svn: 31218
2006-10-27 18:05:12 +00:00
Jim Laskey
43bc1847a2
Breakout folding hash set from SelectionDAGCSEMap.
...
llvm-svn: 31215
2006-10-27 16:16:16 +00:00
Reid Spencer
309e03aea2
Beef up the output from DiffFilesWithTolerance by setting the error code
...
to describe the difference being reported. This assists with understanding
differences an llvm-test and should help with bugpoint too.
llvm-svn: 31044
2006-10-18 20:23:52 +00:00
Chris Lattner
5af1cbc5cf
avoid a ctor/dtor issue with the ProgramName global.
...
llvm-svn: 30925
2006-10-13 00:06:24 +00:00
Chris Lattner
adb19d6e8f
shrink anon-ns and mark stuff static. No functionality changes
...
llvm-svn: 30922
2006-10-12 22:09:17 +00:00
Chris Lattner
c374ec43b5
Fix a static dtor issue
...
llvm-svn: 30726
2006-10-04 22:13:11 +00:00
Chris Lattner
8111c59279
Fix more static dtor issues
...
llvm-svn: 30725
2006-10-04 21:52:35 +00:00
Chris Lattner
adf4095338
Define this in the correct n/s
...
llvm-svn: 30671
2006-09-29 18:43:14 +00:00
Chris Lattner
9daff49ebb
new helper class to provide more explicit management of static ctor/dtors.
...
llvm-svn: 30638
2006-09-28 00:31:55 +00:00
Chris Lattner
f5bed76353
Instantiate Statistic<> in one place, not in every .o file that uses it.
...
llvm-svn: 29971
2006-08-30 04:17:00 +00:00
Chris Lattner
2de6e33c06
Minor code cleanups
...
llvm-svn: 29917
2006-08-27 22:10:29 +00:00