diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-02-03 03:32:32 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-02-03 03:32:32 +0000 |
commit | b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001 (patch) | |
tree | bd821944d76dfe9eb287e228ef5aded11fcce4d5 /include | |
parent | 3e46293c27ee6d35240d6308a84be0f2c2e91940 (diff) | |
download | external_llvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.zip external_llvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.tar.gz external_llvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.tar.bz2 |
raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/raw_ostream.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index 95904ea..6bfae5e 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -301,6 +301,10 @@ class raw_fd_ostream : public raw_ostream { /// bool Error; + /// Controls whether the stream should attempt to use atomic writes, when + /// possible. + bool UseAtomicWrites; + uint64_t pos; /// write_impl - See raw_ostream::write_impl. @@ -361,6 +365,16 @@ public: /// position to the offset specified from the beginning of the file. uint64_t seek(uint64_t off); + /// SetUseAtomicWrite - Set the stream to attempt to use atomic writes for + /// individual output routines where possible. + /// + /// Note that because raw_ostream's are typically buffered, this flag is only + /// sensible when used on unbuffered streams which will flush their output + /// immediately. + void SetUseAtomicWrites(bool Value) { + UseAtomicWrites = Value; + } + virtual raw_ostream &changeColor(enum Colors colors, bool bold=false, bool bg=false); virtual raw_ostream &resetColor(); |