Dan Gohman
e6da01721b
Avoid creating a redundant zero APInt.
...
llvm-svn: 52602
2008-06-21 22:03:12 +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
Zhou Sheng
0d32cd97e1
As comments said, for negative value, the arithmetic
...
over-shift-right should return -1. So here it should be signed-extended,
when bitwidth larger than 64.
test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll
llvm-svn: 51999
2008-06-05 13:27:38 +00:00
Matthijs Kooijman
9fc9250ec0
Give a proper error message when a command line option is defined more than
...
once (ie, at two different places in the source, not two times on the
commandline).
llvm-svn: 51771
2008-05-30 13:26:11 +00:00
Bill Wendling
2ba98ca60f
Remove more iostream header includes. Needed to implement a "FlushStream"
...
function to flush a specified std::ostream.
llvm-svn: 51705
2008-05-29 21:46:33 +00:00
Dan Gohman
92d5dff525
Tidy up whitespace in ConstantRange::print output.
...
llvm-svn: 51606
2008-05-27 20:29:07 +00:00
Dale Johannesen
809ad5df81
Don't assume underlying APInt type is limited
...
to 64 bits.
llvm-svn: 51135
2008-05-14 22:53:25 +00:00
Dale Johannesen
b9d2bc9303
Remove undefined behavior in hex string->APFloat
...
conversion. Try 0x1.0000a4p+0f. Neil, please review.
llvm-svn: 51132
2008-05-14 22:05:31 +00:00
Dan Gohman
bab18cae46
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Dan Gohman
4224373cc8
Make firstEightPowers const.
...
llvm-svn: 50975
2008-05-12 16:38:14 +00:00
Dan Gohman
a84b75df17
Remove uses of llvm/System/IncludeFile.h that are no longer needed.
...
llvm-svn: 50695
2008-05-06 01:32:53 +00:00
Evan Cheng
d9353009b7
Fix more -Wshorten-64-to-32 warnings.
...
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Evan Cheng
c2d34f03bf
Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.
...
llvm-svn: 50590
2008-05-02 21:15:08 +00:00
Gabor Greif
134707f8e8
fcntl.h is pretty standard on unix (without the sys/)
...
llvm-svn: 50475
2008-04-30 08:53:22 +00:00
Dan Gohman
e921f90c15
Fix a pointer-arithmetic bug that caused 64-bit host pointer values to
...
be truncated to 32 bits. This fixes the recent Benchmarks/McCat/09-vor
regression on x86-64, among other things.
llvm-svn: 50372
2008-04-28 20:25:15 +00:00
Ted Kremenek
f1304a3762
Bug fix in BumpPtrAllocator: don't assume that all objects have the same alignment. "Bump" of the pointer for the next allocated object to be of the specified alignment.
...
llvm-svn: 50362
2008-04-28 17:58:07 +00:00
Mikhail Glushenkov
4c358b3125
Add support for response files to the CommandLine library.
...
llvm-svn: 50355
2008-04-28 16:44:25 +00:00
Dan Gohman
6054efc488
Make these variables static.
...
llvm-svn: 50196
2008-04-23 23:15:23 +00:00
Dale Johannesen
675fca3ee1
Check that APFloat::convert is not trying to target
...
ppc long double, which doesn't work.
This may break some stuff temporarily, but I want to
avoid the propagation of code that assumes this works.
llvm-svn: 49983
2008-04-20 01:34:03 +00:00
Dan Gohman
d0162df4c1
Use gv's --spartan option, which trades away an extra row of UI buttons
...
for more space for displaying the graph.
llvm-svn: 49730
2008-04-15 17:27:05 +00:00
Dan Gohman
26c2127be9
Make several symbols static.
...
llvm-svn: 49496
2008-04-10 21:11:47 +00:00
Bill Wendling
fb7564e94c
Fix compilation errors on MSVC. Patch by Argiris Kirtzidis!
...
llvm-svn: 49055
2008-04-01 22:09:20 +00:00
Chris Lattner
d141d16ed7
Change the MemoryBuffer::getFile* methods to take just a pointer to the
...
start of a filename, not a filename+length. All clients can produce a
null terminated name, and the system api's require null terminated
strings anyway.
llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Chris Lattner
7f88d9043f
Reimplement MemoryBuffer::getFile with three enhancements:
...
1) stop using MappedFile.
2) if profitable use the sys::path::MapInFilePages api to
read the file.
3) otherwise fallback to read.
When sys::path::MapInFilePages is implemented, this provides
several benefits:
#1 : this avoids fragmenting memory for small files.
#2 : this avoids extraneous stat calls when the file size is known.
#3 : this only keeps the file descriptor open while reading the
file, not for the duration of the lifetime of the memory
buffer. This fixes a serious clang FD 'leak' problem.
I believe that this will work on a win32 machine, but I don't have
one to test on. I'd appreciate it if someone could check.
llvm-svn: 49031
2008-04-01 06:05:21 +00:00
Chris Lattner
b29e4e90bc
Remove the MappedFile::charBase member, rename base -> getBase() and
...
make getBase() return a const-correct pointer.
llvm-svn: 49025
2008-04-01 03:40:53 +00:00
Chris Lattner
c88457a8b2
Change DiffFilesWithTolerance to be written in terms of MemoryBuffer,
...
not an mmapped file. This more closely matches its requirements and
provides an implicitly null terminated buffer, something this
routine had to emulate itself before.
llvm-svn: 49024
2008-04-01 03:39:49 +00:00
Chris Lattner
f2309c208a
Remove MappedFile support for mapping files for write and exec
...
and shared. This complicates the design, is not used, and probably
doesn't even work.
llvm-svn: 49022
2008-04-01 03:10:22 +00:00
Dan Gohman
2b96ce84aa
Add explicit keywords.
...
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Dan Gohman
22002efa15
A quick nm audit turned up several fixed tables and objects that were
...
marked read-write. Use const so that they can be allocated in a
read-only segment.
llvm-svn: 48800
2008-03-25 21:45:14 +00:00
Bill Wendling
301783caf7
Add assert for non-hexadecimal radixes.
...
llvm-svn: 48421
2008-03-16 20:05:52 +00:00
Evan Cheng
41a16a1347
Fix a typo. It's causing consumer-typeset to miscompile. Perhaps more.
...
llvm-svn: 48035
2008-03-07 22:39:49 +00:00
Dan Gohman
2b8022a8c6
Add support to APInt for shift and rotate operations with APInt
...
instead of uint32_t for the shift/rotate count operand type.
llvm-svn: 47741
2008-02-29 01:40:47 +00:00
Dan Gohman
45a26a462f
Add a method to APFloat to convert directly from APInt.
...
llvm-svn: 47738
2008-02-29 01:26:11 +00:00
Dan Gohman
8d536a33ff
Fix a bug that caused opt and other tools to silently ignore
...
invalid command-line options.
llvm-svn: 47523
2008-02-23 01:55:25 +00:00
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