Commit Graph

787 Commits

Author SHA1 Message Date
Nuno Lopes 10ab44a3a2 remove unused var
llvm-svn: 60770
2008-12-09 17:04:06 +00:00
Nick Lewycky d745adedd7 Fixes for Visual Studio users. Patch by OvermindDL1 on llvm-dev!
llvm-svn: 60679
2008-12-08 00:45:02 +00:00
Ted Kremenek 123a35a81c Have raw_fd_ostream keep track of the position in the file to make tell() go faster by not requiring a flush().
llvm-svn: 60560
2008-12-04 22:51:11 +00:00
Nuno Lopes 50343cd2fe fix build on some machines. thanks buildbot
llvm-svn: 60175
2008-11-27 16:42:44 +00:00
Nuno Lopes d5c2a144e1 fix my previous commit r60064: compare strings instead of pointers
llvm-svn: 60174
2008-11-27 16:37:02 +00:00
Bill Wendling c6075401c2 Get rid of bogus "control may reach end of non-void function ‘...’ being
inlined" message.

llvm-svn: 60165
2008-11-27 08:00:12 +00:00
Ted Kremenek e076257b8c Add 'tell' method to raw_fd_ostream that clients can use to query the current location in the file the stream is writing to.
llvm-svn: 60085
2008-11-26 03:33:13 +00:00
Evan Cheng 496b042e20 Revert r60042. IndVarSimplify should check if APFloat is PPCDoubleDouble first before trying to convert it to an integer.
llvm-svn: 60072
2008-11-26 01:11:57 +00:00
Nuno Lopes b472c9fac7 change AnnotationManager to use 'const char*' instead of std::string. this fixes the leakage of those strings and avoids the creation of such strings in static cosntructors (should result in a little improvement of startup time)
llvm-svn: 60064
2008-11-26 00:00:44 +00:00
Evan Cheng 2e5aeff676 convertToSignExtendedInteger should return opInvalidOp instead of asserting if sematics of float does not allow arithmetics.
llvm-svn: 60042
2008-11-25 19:00:29 +00:00
Daniel Dunbar ed90e701f0 Add Binary flag to raw_fd_ostream constructor.
Document raw_fd_ostream's treatment of "-".

llvm-svn: 59219
2008-11-13 05:01:07 +00:00
Dan Gohman bde853911f Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced
by r58623.

llvm-svn: 58632
2008-11-03 19:40:18 +00:00
Chris Lattner 2bfc72e65e fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase.

llvm-svn: 58199
2008-10-26 19:20:47 +00:00
Ted Kremenek 3c6de496b0 Added raw_fd_ostream::close().
llvm-svn: 58052
2008-10-23 23:49:09 +00:00
Julien Lerouge e9de15b88a Fix for PR2881: fix a small leak exposed by valgrind, using a ManagedStatic.
llvm-svn: 57984
2008-10-22 16:30:41 +00:00
Daniel Dunbar 1ca20df437 Clear raw_fd_ostream error string on success and explain behavior in
documentation.

Add C++ header marker.

llvm-svn: 57923
2008-10-21 19:53:10 +00:00
Dan Gohman 9c4b7d5c4f 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.

llvm-svn: 57521
2008-10-14 20:25:08 +00:00
Dale Johannesen cc98e28f37 Change TAG_ names to DW_TAG for gcc (testsuite) compatibility.
llvm-svn: 57425
2008-10-12 21:23:01 +00:00
Dale Johannesen ba074c0fed Change Dwarf comments starting with AT_ to DW_AT_ to
match gcc.  Helps with the testsuite.

llvm-svn: 57410
2008-10-12 06:20:47 +00:00
Chris Lattner d57b7603f9 rearrange some code.
llvm-svn: 57384
2008-10-11 22:07:19 +00:00
Dale Johannesen 4f0bd68cfe Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen 54306fe499 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.

llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Dale Johannesen 7221af384d 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.

llvm-svn: 57224
2008-10-07 00:40:01 +00:00
Dale Johannesen 6c6729f3a8 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.)

llvm-svn: 57218
2008-10-06 22:59:10 +00:00
Dale Johannesen 6271b0a83c Temporarily revert functionality change from my previous patch;
it is too aggressive.

llvm-svn: 57203
2008-10-06 20:43:48 +00:00
Dale Johannesen fff2995532 Mark shortening NaN conversions as Inexact. PR 2856.
Improve description of unsupported formats.

llvm-svn: 57185
2008-10-06 18:22:29 +00:00
Oscar Fuentes a229b3c9a7 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Cedric Venet 0f7b5666a2 Updating VC++ project.
Adding one include file and correct one declaration from class to struct in order to make llvm compile on VC2005.

llvm-svn: 55279
2008-08-24 11:56:40 +00:00
Chris Lattner 205af9643d Add raw_stream adaptors that write into an std::string and SmallVector/SmallString.
llvm-svn: 55265
2008-08-23 22:43:04 +00:00
Chris Lattner 0c19df4871 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.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Chris Lattner da42964999 add #include
llvm-svn: 55252
2008-08-23 20:34:06 +00:00
Chris Lattner 22b52c984a 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';

llvm-svn: 55246
2008-08-23 19:23:10 +00:00
Dan Gohman 0e44e0d7a8 Add a clear() method to FoldingSet.
llvm-svn: 55210
2008-08-23 00:42:16 +00:00
Chris Lattner d564f29957 improve support for systems that need unistd.h to get STDOUT_FILENO.
Patch contributed by Bjorn Reese!

llvm-svn: 55179
2008-08-22 15:45:00 +00:00
Owen Anderson 3ad8ac90b6 Fix write() when the string being written is larger than the buffer. This broke various ObjC testcases
with very long symbol names.

llvm-svn: 55148
2008-08-21 22:39:33 +00:00
Owen Anderson d2850538db Move non-trivial methods out of line to avoid code-size bloat.
llvm-svn: 55138
2008-08-21 20:58:52 +00:00
Owen Anderson 9371964f47 Use raw_ostream throughout the AsmPrinter.
llvm-svn: 55092
2008-08-21 00:14:44 +00:00
Chris Lattner 1ac3e2545b 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.

llvm-svn: 55063
2008-08-20 17:02:31 +00:00
Dan Gohman 0f23237b0c It's not necessary to check if a value is null before delete[].
llvm-svn: 55053
2008-08-20 14:55:37 +00:00
Argyrios Kyrtzidis b97ff82bd4 Get raw_ostream.cpp to compile on MSVC.
llvm-svn: 54879
2008-08-17 09:25:21 +00:00
Chris Lattner 17f7165f84 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.

llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner 8fcea67ae9 remove a dead APInt ctor.
llvm-svn: 54869
2008-08-17 04:58:58 +00:00
Chris Lattner d3723fc8a2 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.

llvm-svn: 54865
2008-08-17 04:13:37 +00:00
Chris Lattner d5bc0683fd opening "-" automatically yields stdout.
llvm-svn: 54863
2008-08-17 03:53:23 +00:00
Chris Lattner 3394262a33 rename OutputData to 'write' to match ostream.
llvm-svn: 54857
2008-08-17 01:46:05 +00:00
Chris Lattner 84b94f77c6 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.

llvm-svn: 54855
2008-08-17 01:35:29 +00:00
Dan Gohman be5e69ed37 Avoid repeatedly reallocating the FoldingSetNodeID when searching
through multiple nodes in a bucket.

llvm-svn: 54687
2008-08-12 17:40:22 +00:00
Dan Gohman e955c481fd Fix several const-correctness issues, resolving some -Wcast-qual warnings.
llvm-svn: 54349
2008-08-05 14:45:15 +00:00
Dan Gohman 804c95df52 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.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Wojciech Matyjewicz f0d21cdd19 Fix PR2088. Use modulo linear equation solver to compute loop iteration
count.

llvm-svn: 53810
2008-07-20 15:55:14 +00:00