Commit Graph

797 Commits

Author SHA1 Message Date
Ted Kremenek
43d1f02b54 Added raw_fd_ostream::close().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23 23:49:09 +00:00
Julien Lerouge
e7d3af5473 Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22 16:30:41 +00:00
Daniel Dunbar
48534b31d8 Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21 19:53:10 +00:00
Dan Gohman
b8cab9227a Fix command-line option printing to print two spaces where needed,
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 20:25:08 +00:00
Dale Johannesen
51b7f8268b Change TAG_ names to DW_TAG for gcc (testsuite) compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 21:23:01 +00:00
Dale Johannesen
ba0fb07156 Change Dwarf comments starting with AT_ to DW_AT_ to
match gcc.  Helps with the testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 06:20:47 +00:00
Chris Lattner
119c30b955 rearrange some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-11 22:07:19 +00:00
Dale Johannesen
23a98551ab Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 23:00:39 +00:00
Dale Johannesen
7111b02c73 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 18:53:47 +00:00
Dale Johannesen
e4a4245906 Mark negative-zero-to-int conversion as Inexact,
since -0.0 can't be represented as an int.
This prevents llvm from reducing -0.0 to a
load-and-convert of int 0.  Fixes
ieee.exp/mzero[2356].c in gcc testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-07 00:40:01 +00:00
Dale Johannesen
2df5eec2ff Be more precise about which conversions of NaNs
are Inexact.  (These are not Inexact as defined
by IEEE754, but that seems like a reasonable way
to abstract what happens:  information is lost.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57218 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 22:59:10 +00:00
Dale Johannesen
65609f2efa Temporarily revert functionality change from my previous patch;
it is too aggressive.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57203 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 20:43:48 +00:00
Dale Johannesen
d3d8ce3aba Mark shortening NaN conversions as Inexact. PR 2856.
Improve description of unsupported formats.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57185 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 18:22:29 +00:00
Oscar Fuentes
3d01fc7de8 Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 01:08:49 +00:00
Cedric Venet
a3f343f4cd Updating VC++ project.
Adding one include file and correct one declaration from class to struct in order to make llvm compile on VC2005.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 11:56:40 +00:00
Chris Lattner
78a2812538 Add raw_stream adaptors that write into an std::string and SmallVector/SmallString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:43:04 +00:00
Chris Lattner
944fac71e0 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:23:09 +00:00
Chris Lattner
42f77ab95a add #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 20:34:06 +00:00
Chris Lattner
097af7fc8f add a simple mechanism for formatted output. This gives raw_ostream's
all the power and risk of fprintf format strings.  Use them like this:

  OS << format("%10.4f", 42.0) << "\n" << format("%x", 42) << '\n';



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:23:10 +00:00
Dan Gohman
535de1a8c1 Add a clear() method to FoldingSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 00:42:16 +00:00
Chris Lattner
969a46a948 improve support for systems that need unistd.h to get STDOUT_FILENO.
Patch contributed by Bjorn Reese!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 15:45:00 +00:00
Owen Anderson
fd2a05332a Fix write() when the string being written is larger than the buffer. This broke various ObjC testcases
with very long symbol names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55148 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 22:39:33 +00:00
Owen Anderson
66b17ba0d2 Move non-trivial methods out of line to avoid code-size bloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 20:58:52 +00:00
Owen Anderson
cb37188323 Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:14:44 +00:00
Chris Lattner
98f8ccfad0 Move the fast-path (<=i64) cases of various APInt methods inline
and the slow-path cases out of line.  This speeds up instcombine
a bit in real world cases.  Patch contributed by m-s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 17:02:31 +00:00
Dan Gohman
eace52f12d It's not necessary to check if a value is null before delete[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55053 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 14:55:37 +00:00
Argyrios Kyrtzidis
b68dc369e0 Get raw_ostream.cpp to compile on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54879 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 09:25:21 +00:00
Chris Lattner
fad86b003a Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector
passed in.  This significantly reduces string thrashing in some cases.

More specifically, this:
 - Adds an operator<< and a print method for APInt that allows you to 
   directly send them to an ostream.
 - Reimplements APInt::toString to be much simpler and more efficient
   algorithmically in addition to not thrashing strings quite as much.

This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter.  This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 07:19:36 +00:00
Chris Lattner
9f17eb0b79 remove a dead APInt ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:58:58 +00:00
Chris Lattner
07f51f788e add support for a cout/cerr analog (outs()/errs()) as well as
a simple adaptor class to give raw output capabilities to 
something that wants to write to an ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:13:37 +00:00
Chris Lattner
c52b128e1a opening "-" automatically yields stdout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 03:53:23 +00:00
Chris Lattner
d497df5cf5 rename OutputData to 'write' to match ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 01:46:05 +00:00
Chris Lattner
60d3962624 add a new raw_ostream class which is an extremely high performance ostream that
can *only* output data (no seeking, reading, etc).  This is adapted from the
clang "-E outputter", and is roughly 10% faster than stdio on darwin and 30%
(or more) faster than std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 01:35:29 +00:00
Dan Gohman
ee4bd9a5b4 Avoid repeatedly reallocating the FoldingSetNodeID when searching
through multiple nodes in a bucket.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 17:40:22 +00:00
Dan Gohman
430b8a22e2 Fix several const-correctness issues, resolving some -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 14:45:15 +00:00
Dan Gohman
fed90b6d09 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-28 21:51:04 +00:00
Wojciech Matyjewicz
de0f2382e4 Fix PR2088. Use modulo linear equation solver to compute loop iteration
count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-20 15:55:14 +00:00
Dan Gohman
5e84368b26 Reapply 53476 and 53480, with a fix so that it properly updates
the BB member to the current basic block after emitting
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 18:19:29 +00:00
Evan Cheng
b5eec33dcd Back out 53476 and 53480 for now. Somehow they cause llc to miscompile 179.art.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 01:38:51 +00:00
Dan Gohman
dbe2a5a269 Add support for putting NamedRegionTimers in TimerGroups, and
use a timer group for the timers in SelectionDAGISel. Also,
Split scheduling out from emitting, to give each their own
timer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 21:54:34 +00:00
Dan Gohman
c418bf3dd5 Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:58:19 +00:00
Dan Gohman
e14d81deeb Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 22:58:06 +00:00
Owen Anderson
72e61b8501 Add a version of AddString that takes a const char* so we can avoid extraneous
conversions to std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 23:49:59 +00:00
Dan Gohman
153d28a414 Append to the ActiveTimers std::vector before looking at the timer instead
of after, so that any reallocation it does doesn't get counted for the pass
being timed.  This probably doesn't account for a timing discrepancy I was
looking into, but I'm fixing it anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 22:07:07 +00:00
Wojciech Matyjewicz
300c6c5167 First step to fix PR2088. Implement routine to compute the
multiplicative inverse of a given number. Modify udivrem to allow input and 
output pairs of arguments to overlap. Patch is based on the work by Chandler
Carruth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 19:39:50 +00:00
Dan Gohman
95df6b3603 Avoid creating a redundant zero APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52602 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 22:03:12 +00:00
Ted Kremenek
8d6a58c5d5 Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" throughout FoldingSet.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 19:12:43 +00:00
Zhou Sheng
bfde7d6b9e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 13:27:38 +00:00
Matthijs Kooijman
33540adca5 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 13:26:11 +00:00
Bill Wendling
eecfa369eb Remove more iostream header includes. Needed to implement a "FlushStream"
function to flush a specified std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:46:33 +00:00