Reid Spencer
8c2e0f85eb
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
b601311b07
fix a memory leak
...
llvm-svn: 36981
2007-05-11 00:43:26 +00:00
Jeff Cohen
2e8263c013
Unbreak VC++ build.
...
llvm-svn: 36901
2007-05-07 15:21:46 +00:00
Chris Lattner
112d26a164
Enhance MemoryBuffer to return error messages in strings if they occur.
...
llvm-svn: 36899
2007-05-06 23:32:36 +00:00
Chris Lattner
4dca43cc6d
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
71eb8d5e89
remove libbzip2, it is dead
...
llvm-svn: 36875
2007-05-06 19:05:34 +00:00
Chris Lattner
5bd1b5b32d
don't build bzip2 for now
...
llvm-svn: 36871
2007-05-06 09:31:32 +00:00
Chris Lattner
5f94a8492f
disable this for now
...
llvm-svn: 36870
2007-05-06 09:31:06 +00:00
Chris Lattner
9fa29b4027
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
49b1ec44eb
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
d363044771
silence some annoying gcc 4.3 warnings
...
llvm-svn: 36680
2007-05-03 18:15:36 +00:00
Jeff Cohen
7cfc4b404f
Fix MemoryBuffer breakage correctly.
...
llvm-svn: 36561
2007-04-29 14:43:31 +00:00
Jeff Cohen
349056458a
Unbreak build.
...
llvm-svn: 36559
2007-04-29 14:21:44 +00:00
Chris Lattner
4749cca517
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
8c150f133c
Using APInt more efficiently.
...
llvm-svn: 36475
2007-04-26 16:42:07 +00:00
Jeff Cohen
5a502fb622
Fix PR1329.
...
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Reid Spencer
84c2475e77
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
6e7854339e
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
dedfc40044
Make the apint construction more effective.
...
llvm-svn: 35960
2007-04-13 05:57:32 +00:00
Chris Lattner
9564abbfb5
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
32f6730bb1
Fix PR1318 by reacting appropriately to a mutating option list.
...
llvm-svn: 35905
2007-04-11 15:35:18 +00:00
Reid Spencer
9b497be3c4
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
875a2bc4db
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
ec51e934ef
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
...
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Chris Lattner
c1bce783e8
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
0160bf7114
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
d33f94f2d2
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
ed593d6789
stringmap memory managed with malloc now
...
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Chris Lattner
8a4ca643dd
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
dbf6a79a71
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
59994ede6b
greatly reduce hte default size of stringmap.
...
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Nick Lewycky
03f9c0ffc9
Implement union of wrapped sets.
...
llvm-svn: 35534
2007-04-01 03:47:44 +00:00
Reid Spencer
4269ae1274
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
50b83584c4
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
427b6bec97
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
21c7fc9c1f
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
41d254c7f4
Fix coding standards violation.
...
llvm-svn: 35189
2007-03-19 21:19:02 +00:00
Reid Spencer
b7d0a60da1
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
7be576b4b0
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
0145067d85
For APInt::z/sext(width), if width == BitWidth, just return *this.
...
llvm-svn: 35065
2007-03-12 17:47:45 +00:00
Nick Lewycky
2af4a3ab17
Add getter methods for the extremes of a ConstantRange.
...
llvm-svn: 35056
2007-03-10 15:54:12 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Reid Spencer
3e3980a403
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
6d483da6c0
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
29f7380f34
Implement unionWith.
...
llvm-svn: 34833
2007-03-02 03:33:05 +00:00
Reid Spencer
39b817765b
Add a FIXME
...
llvm-svn: 34828
2007-03-02 02:01:34 +00:00
Reid Spencer
eabc981a60
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
f8f8413839
Combine two lines that can be.
...
llvm-svn: 34818
2007-03-01 23:30:25 +00:00
Reid Spencer
c94231581b
Make the static table of results in sqrt const.
...
llvm-svn: 34791
2007-03-01 17:47:31 +00:00
Reid Spencer
6a95676875
Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
...
llvm-svn: 34789
2007-03-01 17:15:32 +00:00