summaryrefslogtreecommitdiff
path: root/include/llvm/Support/raw_ostream.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-02-03 03:32:32 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-02-03 03:32:32 +0000
commitb0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001 (patch)
treebd821944d76dfe9eb287e228ef5aded11fcce4d5 /include/llvm/Support/raw_ostream.h
parent3e46293c27ee6d35240d6308a84be0f2c2e91940 (diff)
downloadllvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.tar.gz
llvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.tar.bz2
llvm-b0cfa6cab85ce19c8ecaf9cdd3e34a3593d0b001.tar.xz
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/llvm/Support/raw_ostream.h')
-rw-r--r--include/llvm/Support/raw_ostream.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index 95904ea2f3..6bfae5e298 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();