summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/raw_ostream.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the program class.Rafael Espindola2013-06-121-1/+1
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. llvm-svn: 183864
* Don't try to generate crash diagnostics if we had an I/O failure. It's veryChad Rosier2013-03-271-1/+1
| | | | | | | likely the crash diagnostics generation will fail as well. Part of rdar://13296693 llvm-svn: 178163
* Don't crash if write_impl() leaves less buffer space available than expected.Matt Beaumont-Gay2013-03-121-1/+6
| | | | | | This was tickled by a Clang diagnostic; Clang test case to follow. llvm-svn: 176911
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-121-1/+2
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-5/+5
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Replace the BUILTIN_EXPECT macro with a less horrible ↵Benjamin Kramer2012-08-291-6/+6
| | | | | | LLVM_LIKELY/LLVM_UNLIKELY interface. llvm-svn: 162873
* raw_ostream: Add a has_colors() method.Daniel Dunbar2012-07-201-0/+4
| | | | llvm-svn: 160558
* Fixed few warnings.Galina Kistanova2012-07-121-1/+2
| | | | llvm-svn: 160142
* Reapply 'Add reverseColor to raw_ostream'.Benjamin Kramer2012-04-161-0/+13
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell, with a minor fix for mingw by me. llvm-svn: 154805
* Revert r154800 which breaks windows builders.Argyrios Kyrtzidis2012-04-161-13/+0
| | | | llvm-svn: 154802
* Add reverseColor to raw_ostream.Argyrios Kyrtzidis2012-04-161-0/+13
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell! llvm-svn: 154800
* Support/Program: Make Change<stream>ToBinary return error_code.Michael J. Spencer2011-12-131-0/+1
| | | | llvm-svn: 146522
* Avoid undefined behavior in signed integer negation. Patch by Ahmed Charles.Eli Friedman2011-10-131-1/+2
| | | | llvm-svn: 141905
* Fix integer overflow bug in raw_ostream::write. This showed up as aNick Lewycky2011-08-281-2/+2
| | | | | | non-deterministic crash in the test suite. Fixes PR10055! llvm-svn: 138717
* raw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.NAKAMURA Takumi2011-03-181-0/+30
| | | | | | | On MSVCRT and compatible, output of %e is incompatible to Posix by default. Number of exponent digits should be at least 2. "%+03d" FIXME: Implement our formatter in future! llvm-svn: 127872
* lib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be ↵NAKAMURA Takumi2011-03-161-0/+8
| | | | | | | | called at dtor context. report_fatal_error() invokes exit(). We know report_fatal_error() might not write messages to stderr when any errors were detected on FD == 2. llvm-svn: 127726
* raw_ostream: while it is generally desirable to do larger writes, it can lead toBenjamin Kramer2011-03-041-3/+7
| | | | | | | | | | inefficient file system buffering if the writes are not a multiple of the desired buffer size. Avoid this by limiting the large write to a multiple of the buffer size and copying the remainder into the buffer. Thanks to Dan for pointing this out. llvm-svn: 127026
* raw_ostream: If writing a string that is larger than the buffer, write it ↵Benjamin Kramer2011-03-041-9/+13
| | | | | | | | directly instead of doing many buffer-sized writes. This caps the number of write(2) calls per string to a maximum of 2. llvm-svn: 127010
* raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).Daniel Dunbar2011-02-031-3/+21
| | | | llvm-svn: 124771
* Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.Michael J. Spencer2011-01-171-0/+7
| | | | llvm-svn: 123643
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | llvm-svn: 120298
* raw_ostream::write_escaped: Add a UseHexEscapes argument.Daniel Dunbar2010-11-271-6/+15
| | | | llvm-svn: 120200
* lib/Support/raw_ostream.cpp: Fix Cygwin's build.NAKAMURA Takumi2010-10-191-0/+4
| | | | | | setmode is provided by io.h on Cygwin. llvm-svn: 116784
* Always use binary mode for output stream. This is important to prevent ↵Francois Pichet2010-10-141-0/+13
| | | | | | unwanted end of line conversion on Windows. Should not affect Unix where O_BINARY is not defined. This fix /clang/test/lexer/preamble.c XFAIL on WIN32. llvm-svn: 116509
* Move tool_output_file into its own file.Dan Gohman2010-10-071-32/+0
| | | | llvm-svn: 115973
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-011-14/+18
| | | | | | | | | | 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
* Make outs() close its file when its stream is destructed, so thatDan Gohman2010-08-201-2/+4
| | | | | | pending output errors are detected. llvm-svn: 111643
* Delete raw_stdout_ostream and raw_stderr_ostream, which are unusedDan Gohman2010-08-201-12/+4
| | | | | | | outside of outs() and errs() themselves, and they don't really need custom classes. llvm-svn: 111642
* Move raw_ostream's Error flag into raw_fd_ostream, as that's the onlyDan Gohman2010-08-201-16/+17
| | | | | | class which is using it. llvm-svn: 111639
* Introduce a new tool_output_file class, which extends raw_ostream withDan Gohman2010-08-201-0/+28
| | | | | | | | 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
* Make raw_fd_ostream consider itself the owner of STDOUT_FILENO whenDan Gohman2010-08-181-2/+5
| | | | | | | | | constructed with an output filename of "-". In particular, allow the file descriptor to be closed, and close the file descriptor in the destructor if it hasn't been explicitly closed already, to ensure that any write errors are detected. llvm-svn: 111436
* Revert r111321. This doesn't fix a problem.Dan Gohman2010-08-181-23/+19
| | | | llvm-svn: 111339
* Fix the rest of rdar://8318441 which happens when a raw_fd_ostreamChris Lattner2010-08-171-19/+23
| | | | | | | | | | (e.g. errs()) fails in close() due to (e.g.) a broken pipe. As previously written, the had_error() flag would get set and then the raw_ostream dtor would report a fatal error. There is nothing the client can do about this and we have no way to report the error, so just eat it. llvm-svn: 111321
* avoid undef behavior on minint, fixing PR7783.Chris Lattner2010-08-031-2/+3
| | | | llvm-svn: 110114
* add some triple for minix, patch by Kees van Reeuwijk from PR7582Chris Lattner2010-07-071-1/+1
| | | | llvm-svn: 107785
* Minor code simplification.Dan Gohman2010-05-281-2/+1
| | | | llvm-svn: 104959
* Fix a redundant-return warning.Dan Gohman2010-05-281-1/+2
| | | | llvm-svn: 104958
* Usage of O_NONBLOCK in bjam is now confirmed as a bug and fixed upstream.Dan Gohman2010-05-181-4/+7
| | | | | | Update the comment. llvm-svn: 104021
* Handle the case where open(2) or close(2) is interrupted by a signal whenDan Gohman2010-05-061-11/+24
| | | | | | | | automatic syscall restarting is disabled. Also, fix the build on systems which don't define EWOULDBLOCK. llvm-svn: 103158
* Handle EWOULDBLOCK as EAGAIN. And add a comment explaining whyDan Gohman2010-05-061-3/+22
| | | | | | | | | EAGAIN and EWOULDBLOCK are used here. Also, handle the case where a write call is interrupted after some data has already been written. llvm-svn: 103153
* Try again if write(2) reports an recoverable error.Benjamin Kramer2010-05-051-1/+6
| | | | | | | This should fix mysteriously crashing boost regression tests when stderr is managed by bjam (PR7043). llvm-svn: 103085
* add minix support, patch by Kees van Reeuwijk! PR6797Chris Lattner2010-04-091-1/+2
| | | | llvm-svn: 100895
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-2/+2
| | | | llvm-svn: 100709
* Fix minor style issues.Dan Gohman2010-03-241-23/+23
| | | | llvm-svn: 99414
* add an assertion requested on llvmdev.Chris Lattner2010-03-051-0/+1
| | | | llvm-svn: 97769
* enhance raw_svector_ostream::write_impl to work with unbuffered streams,Chris Lattner2010-02-151-6/+12
| | | | | | which may call write_impl on things that are not the usual buffer. llvm-svn: 96209
* Fix MSVC build.Benjamin Kramer2010-01-291-0/+1
| | | | llvm-svn: 94809
* Use llvm::format instead of ftostr (which just calls sprintf).Benjamin Kramer2010-01-291-2/+1
| | | | llvm-svn: 94807
* Changes to fix buffering that I forgot to commit with previous patch.Chris Lattner2010-01-221-5/+8
| | | | llvm-svn: 94222
* add a new MCAsmStreamer::GetCommentOS method to simplify stuffChris Lattner2010-01-221-0/+8
| | | | | | that doesn't want to use twines. llvm-svn: 94199
OpenPOWER on IntegriCloud