Commit Graph

21 Commits

Author SHA1 Message Date
Nick Lewycky 0de20af7ba Add missing standard headers. Patch by Joerg Sonnenberger!
llvm-svn: 122193
2010-12-19 20:43:38 +00:00
Dan Gohman a2233f2801 Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.

llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Dan Gohman b87ad69350 Introduce a new tool_output_file class, which extends raw_ostream with
functionality that most command-line tools need: ensuring that the
output file gets deleted if the tool is interrupted or encounters an
error.

llvm-svn: 111595
2010-08-20 00:48:10 +00:00
Dan Gohman 30ff721f09 Fix various doxygen warnings.
llvm-svn: 96779
2010-02-22 04:10:52 +00:00
Chris Lattner f733d75892 make PadToColumn return the stream so you can use:
OS.PadToColumn(42) << "foo";

llvm-svn: 96208
2010-02-15 02:17:50 +00:00
David Greene 93a522baba Change errs() to dbgs().
llvm-svn: 92641
2010-01-05 01:28:43 +00:00
Chris Lattner ba4bd50a80 switch formattedstream to use raw_ostream::indent. This eliminates
the weird MAX_COLUMN_PAD limitation.

llvm-svn: 79785
2009-08-22 23:16:09 +00:00
Daniel Dunbar 17a6fd2299 raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.
- Kill off begin(), end(), and iterator. It isn't clear what these
   mean. Instead provide getBufferStart(), which can be used with
   GetNumBytesInBuffer to the same effect.

 - Update ComputeColumn to take arguments for the buffer to scan, this
   simplifies the implementation of write_impl substantially.

 - This should also fix possible problems with the scanning pointer pointing
   outside of the current raw_ostream buffer.

llvm-svn: 79379
2009-08-18 23:36:04 +00:00
Chris Lattner ee97b8b11c the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Dan Gohman 186b85dbcc Add support for column computation on unbuffered streams.
llvm-svn: 79065
2009-08-15 02:02:59 +00:00
Dan Gohman 250635e3ac Move FormattedStream's write_impl out of line.
llvm-svn: 79064
2009-08-15 02:01:04 +00:00
Dan Gohman e9f0bf5dee Remove an unnecessary #include.
llvm-svn: 79063
2009-08-15 01:56:38 +00:00
David Greene ea2f1ceb4b Re-apply previous changes and improve column padding performance some more.
llvm-svn: 77461
2009-07-29 16:08:27 +00:00
Daniel Dunbar af71a3035b Revert r77397, it causes significant regressions in llc performance.
llvm-svn: 77425
2009-07-29 03:04:22 +00:00
David Greene 5f6511c3d5 Improve performance of PadToColumn by eliminating flushes.
llvm-svn: 77397
2009-07-28 23:26:34 +00:00
David Greene 8e621f0182 Write space padding as one string to speed up comment printing.
llvm-svn: 76910
2009-07-23 23:21:10 +00:00
Dan Gohman f199ad6ebc Use size_t.
llvm-svn: 76069
2009-07-16 15:24:40 +00:00
Chris Lattner ca99c348ed minor syntax cleanup
llvm-svn: 75707
2009-07-14 23:14:10 +00:00
David Greene a31f96cf2b Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.

llvm-svn: 75670
2009-07-14 20:18:05 +00:00
David Greene 20f6ac0738 Make some more changes suggested by Chris. Manipulators go away.
llvm-svn: 75472
2009-07-13 16:49:27 +00:00
David Greene c97b778b3c Make changes suggested by Chris and eliminate newly-added raw_ostream
hooks as they're no longer needed.

The major change with this patch is to make formatted_raw_ostream usable
by any client of raw_ostream.

llvm-svn: 75283
2009-07-10 21:14:44 +00:00