summaryrefslogtreecommitdiff
path: root/include/llvm/Support/FormattedStream.h
Commit message (Collapse)AuthorAge
* Add line tracking support to FormattedStream Daniel Malea2013-05-08
| | | | | | | | | | - previously formatted_raw_ostream tracked columns, now it tracks lines too - used by (upcoming) DebugIR pass to know the line number to connect to each IR instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181463 91177308-0d34-0410-b5e6-96231b3b80d8
* unindent the file to follow coding standards, change class doc commentChris Lattner2013-04-01
| | | | | | | | to be correct. No functionality or behavior change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178511 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM_OVERRIDE to methods that override their base classes.Craig Topper2012-09-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164471 91177308-0d34-0410-b5e6-96231b3b80d8
* formatted_raw_ostream: Fix a serious bug in tell().Daniel Dunbar2012-09-14
| | | | | | | | | - The current_pos function is supposed to return all the written bytes, not the current position of the underlying stream. - This caused tell() to be broken whenever the underlying stream had buffered content. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163948 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-01
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
* formatted_tool_output_file::close needs to flush its buffer beforeDan Gohman2010-08-23
| | | | | | | closing the underlying stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111822 91177308-0d34-0410-b5e6-96231b3b80d8
* Export error-handling functions in formatted_tool_output_file.Dan Gohman2010-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111638 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new tool_output_file class, which extends raw_ostream withDan Gohman2010-08-20
| | | | | | | | | functionality that most command-line tools need: ensuring that the output file gets deleted if the tool is interrupted or encounters an error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111595 91177308-0d34-0410-b5e6-96231b3b80d8
* comment fix.Chris Lattner2010-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96248 91177308-0d34-0410-b5e6-96231b3b80d8
* make PadToColumn return the stream so you can use:Chris Lattner2010-02-15
| | | | | | | | OS.PadToColumn(42) << "foo"; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96208 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a build error by adding a missing commit.David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92670 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some methods const. The only interesting change here is thatChris Lattner2009-12-19
| | | | | | | | | | it changes raw_fd_ostream::preferred_buffer_size to return zero on a scary stat failure instead of setting the stream to an error state. This method really should not mutate the stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91740 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Don't allow formatted_ostream to be unbuffered, even if its underlyingDaniel Dunbar2009-09-22
| | | | | | | | | buffer", while we work out a solution. Dan convinced me that making debugging annoying for him is worse than 10x being slower for me. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82553 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't allow formatted_ostream to be unbuffered, even if its underlying bufferDaniel Dunbar2009-09-21
| | | | | | | | | | | | is. - The problem is that formatted_ostream forces its underlying buffer to be unbuffered, so if some client happens to wrap a formatted_ostream around something, but still use the underlying stream, then we can end up writing on a fully unbuffered output (which was never intended to be unbuffered). - This makes clang (and presumably llvm-gcc) -emit-llvm -S a mere 10x faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82434 91177308-0d34-0410-b5e6-96231b3b80d8
* Change "const static" to "static const", as warned aboutDuncan Sands2009-09-06
| | | | | | | by icc (#82). Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81117 91177308-0d34-0410-b5e6-96231b3b80d8
* switch formattedstream to use raw_ostream::indent. This eliminatesChris Lattner2009-08-22
| | | | | | | the weird MAX_COLUMN_PAD limitation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79785 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream: Reduce FormattedStream's reliance on raw_ostream's implementation.Daniel Dunbar2009-08-18
| | | | | | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79379 91177308-0d34-0410-b5e6-96231b3b80d8
* the MinPad argument to PadToColumn only really makes sense to be 1,Chris Lattner2009-08-17
| | | | | | | just remove the argument and replace it with 1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
* Move FormattedStream's write_impl out of line.Dan Gohman2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79064 91177308-0d34-0410-b5e6-96231b3b80d8
* Make formatted_raw_ostream restore the buffer settings of theDan Gohman2009-08-13
| | | | | | | | underlying stream when it is finished, so that clients don't have to do this manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78952 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a GetBufferSize() member to raw_ostream and use it toDan Gohman2009-08-12
| | | | | | | simplify some formatted_raw_ostream code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78836 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply previous changes and improve column padding performance some more.David Greene2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77461 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r77397, it causes significant regressions in llc performance.Daniel Dunbar2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77425 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve performance of PadToColumn by eliminating flushes.David Greene2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77397 91177308-0d34-0410-b5e6-96231b3b80d8
* Write space padding as one string to speed up comment printing.David Greene2009-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76910 91177308-0d34-0410-b5e6-96231b3b80d8
* Use setStream infomatted_raw_ostream's constructor, to reduce codeDan Gohman2009-07-16
| | | | | | | duplication. Also, make setStream honor the old DeleteStream flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76075 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove inapplicable comments.Dan Gohman2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76074 91177308-0d34-0410-b5e6-96231b3b80d8
* Use size_t.Dan Gohman2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76069 91177308-0d34-0410-b5e6-96231b3b80d8
* formatted_raw_ostream both is-a raw_ostream and has-a raw_ostream. ThisDan Gohman2009-07-16
| | | | | | | | | | | | | | | | means that two separate raw_ostreams are doing buffering before data is sent to the underlying stream. Besides the inefficiency of redundant buffering, the second level of buffering doesn't recieve flush() requests. Fix this by having formatted_raw_ostream set the underlying raw_ostream to be unbuffered. This eliminates inefficiency due to redundant buffering, and it makes the flush() disconnect harmless. This fixes PR4559. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75883 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug in my previous patch.Chris Lattner2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75678 91177308-0d34-0410-b5e6-96231b3b80d8
* allow default construction of formatted_raw_ostream.Chris Lattner2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75674 91177308-0d34-0410-b5e6-96231b3b80d8
* Have asm printers use formatted_raw_ostream directly to avoid aDavid Greene2009-07-14
| | | | | | | dynamic_cast<>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some more changes suggested by Chris. Manipulators go away.David Greene2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75472 91177308-0d34-0410-b5e6-96231b3b80d8
* Make changes suggested by Chris and eliminate newly-added raw_ostreamDavid Greene2009-07-10
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75283 91177308-0d34-0410-b5e6-96231b3b80d8