summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/raw_ostream.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add raw_ostream::write_hexDaniel Dunbar2009-07-301-4/+7
| | | | llvm-svn: 77614
* Perform simplification noticed by Reid.Daniel Dunbar2009-07-291-4/+0
| | | | llvm-svn: 77477
* raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.Daniel Dunbar2009-07-291-0/+4
| | | | llvm-svn: 77444
* Make raw_null_ostream flush its buffer in its destructor, so thatDan Gohman2009-07-271-0/+9
| | | | | | | it conforms to the assertion added in r77245. This fixes a failure in qa_override.c in clang's testsuite. llvm-svn: 77255
* Add an assertion check to raw_ostream's destructor to verifyDan Gohman2009-07-271-0/+5
| | | | | | that the subclass hasn't left any pending data in the buffer. llvm-svn: 77245
* Add raw_null_ostream and llvm::nulls(), a raw_ostream that discards output.Daniel Dunbar2009-07-161-0/+17
| | | | | | - No functionality change. llvm-svn: 76103
* Use size_t.Dan Gohman2009-07-161-12/+12
| | | | llvm-svn: 76069
* Change raw_ostream so that it doesn't call llvm_report_errorDan Gohman2009-07-151-4/+14
| | | | | | | | | | | | | | | | | | immediately on every output error. Instead, add a flag to raw_ostream, and set the flag whenever an error is detected. The flag can be queried and cleared from the public API. This gives applications more flexibility to handling errors in application-specific ways. If the flag is not cleared when the raw_ostream is destructed, llvm_report_error is called from the destructor. This ensures that errors are not implicitly silenced, and provides convenient default behavior for tools like llc and opt. Clients wishing to avoid llvm_report_error calls from raw_ostream should check for errors and clear the error flag. llvm-svn: 75857
* Add a Force option to raw_fd_ostream to specify whether openingDan Gohman2009-07-151-1/+3
| | | | | | | | an existing file is considered an error. Convert several tools to use raw_fd_ostream instead of std::ostream, and to use this new option instead of doing a manual check. llvm-svn: 75801
* Check for errors on close(2) too. And lseek(2).Dan Gohman2009-07-151-2/+6
| | | | llvm-svn: 75793
* Use 0664 instead of 0644 for the default open mode. This isDan Gohman2009-07-151-1/+1
| | | | | | | consistent with common std::ostream implmentations, and it gives the user the option of using the umask group write bit. llvm-svn: 75792
* Detect write failures on raw_fd_ostream.Daniel Dunbar2009-07-151-2/+4
| | | | llvm-svn: 75758
* Have asm printers use formatted_raw_ostream directly to avoid aDavid Greene2009-07-141-1/+1
| | | | | | dynamic_cast<>. llvm-svn: 75670
* Make changes suggested by Chris and eliminate newly-added raw_ostreamDavid Greene2009-07-101-1/+0
| | | | | | | | | 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
* Add some hooks that a redesigned AsmStream needs to do its job. TheseDavid Greene2009-07-091-0/+1
| | | | | | allow derived classes to examine the stream buffer before it's flushed. llvm-svn: 75199
* Add support for outputting ANSI colors to raw_fd_ostream.Torok Edwin2009-06-041-0/+30
| | | | llvm-svn: 72854
* Make all raw_ostreams support the tell() function.Douglas Gregor2009-04-201-0/+11
| | | | llvm-svn: 69583
* Add BUILTIN_EXPECT Support/Compiler macro.Daniel Dunbar2009-03-171-1/+2
| | | | | | | | | - Use for exceptional buffer conditions in raw_ostream:write to shave off a cycle or two. - Please rename if you have a better one. llvm-svn: 67103
* raw_ostream: Put all exceptional conditions in raw_ostream::writeDaniel Dunbar2009-03-171-18/+30
| | | | | | | | under a single branch. Also, add a FIXME for formatted output. llvm-svn: 67069
* raw_ostream: Rework implementation of unbuffered streams so outputtingDaniel Dunbar2009-03-171-4/+12
| | | | | | | | | a single character requires only one branch to follow slow path. - Never use a buffer when writing on an unbuffered stream. - Move default buffer size to header. llvm-svn: 67066
* raw_ostream: Replace flush_impl with write_impl, which takes data toDaniel Dunbar2009-03-161-32/+15
| | | | | | | | | write as arguments. - Add raw_ostream::GetNumBytesInBuffer. - Privatize buffer pointers. - Get rid of slow and unnecessary code for writing out large strings. llvm-svn: 67060
* raw_ostream: Lift out flush_nonempty.Daniel Dunbar2009-03-161-20/+21
| | | | | | | | | | | | | | | | | - Flush a known non-empty buffers; enforces the interface to flush_impl and kills off HandleFlush (which I saw no reason to be an inline method, Chris?). - Clarify invariant that flush_impl is only called with OutBufCur > OutBufStart. - This also cleary collects all places where we have to deal with the buffer possibly not existing. - A few more comments and fixing the unbuffered behavior remain in this commit sequence. llvm-svn: 67057
* Make raw_ostream::operator<<(const void *) fast; it doesn't matter butDaniel Dunbar2009-03-161-2/+19
| | | | | | it is easy. llvm-svn: 67054
* Add slow path for single character write, and use exclusively forDaniel Dunbar2009-03-161-8/+8
| | | | | | single characters writes outside of the fast path in raw_ostream.h llvm-svn: 67053
* PR3478: raw_ostream should not buffer stderrDaniel Dunbar2009-03-101-1/+5
| | | | | | | - Add unbuffered flag to raw_ostream, forwarded by raw_fd_ostream and used by raw_stderr_ostream. llvm-svn: 66545
* Add method raw_fd_ostream::seek() for random access within a file.Ted Kremenek2009-01-261-0/+6
| | | | llvm-svn: 63044
* Have raw_fd_ostream keep track of the position in the file to make tell() go ↵Ted Kremenek2008-12-041-10/+4
| | | | | | faster by not requiring a flush(). llvm-svn: 60560
* Add 'tell' method to raw_fd_ostream that clients can use to query the ↵Ted Kremenek2008-11-261-0/+8
| | | | | | current location in the file the stream is writing to. llvm-svn: 60085
* Add Binary flag to raw_fd_ostream constructor.Daniel Dunbar2008-11-131-2/+13
| | | | | | Document raw_fd_ostream's treatment of "-". llvm-svn: 59219
* fix PR2953, an off-by-one error handling formatted i/o. Chris Lattner2008-10-261-1/+1
| | | | | | Thanks to Török Edwin for the awesome reduced testcase. llvm-svn: 58199
* Added raw_fd_ostream::close().Ted Kremenek2008-10-231-3/+14
| | | | llvm-svn: 58052
* Clear raw_fd_ostream error string on success and explain behavior inDaniel Dunbar2008-10-211-3/+6
| | | | | | | | documentation. Add C++ header marker. llvm-svn: 57923
* Updating VC++ project.Cedric Venet2008-08-241-0/+1
| | | | | | Adding one include file and correct one declaration from class to struct in order to make llvm compile on VC2005. llvm-svn: 55279
* Add raw_stream adaptors that write into an std::string and ↵Chris Lattner2008-08-231-0/+35
| | | | | | SmallVector/SmallString. llvm-svn: 55265
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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
* add #includeChris Lattner2008-08-231-0/+1
| | | | llvm-svn: 55252
* add a simple mechanism for formatted output. This gives raw_ostream's Chris Lattner2008-08-231-0/+50
| | | | | | | | 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
* improve support for systems that need unistd.h to get STDOUT_FILENO.Chris Lattner2008-08-221-2/+10
| | | | | | Patch contributed by Bjorn Reese! llvm-svn: 55179
* Fix write() when the string being written is larger than the buffer. This ↵Owen Anderson2008-08-211-0/+1
| | | | | | | | broke various ObjC testcases with very long symbol names. llvm-svn: 55148
* Move non-trivial methods out of line to avoid code-size bloat.Owen Anderson2008-08-211-0/+92
| | | | llvm-svn: 55138
* Use raw_ostream throughout the AsmPrinter.Owen Anderson2008-08-211-11/+11
| | | | llvm-svn: 55092
* Get raw_ostream.cpp to compile on MSVC.Argyrios Kyrtzidis2008-08-171-5/+11
| | | | llvm-svn: 54879
* add support for a cout/cerr analog (outs()/errs()) as well asChris Lattner2008-08-171-0/+31
| | | | | | | a simple adaptor class to give raw output capabilities to something that wants to write to an ostream. llvm-svn: 54865
* opening "-" automatically yields stdout.Chris Lattner2008-08-171-0/+7
| | | | llvm-svn: 54863
* rename OutputData to 'write' to match ostream.Chris Lattner2008-08-171-1/+1
| | | | llvm-svn: 54857
* add a new raw_ostream class which is an extremely high performance ostream thatChris Lattner2008-08-171-0/+64
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
OpenPOWER on IntegriCloud