summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Path.inc
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-03-08 20:34:47 +0000
committerZachary Turner <zturner@google.com>2018-03-08 20:34:47 +0000
commitadad33011f3f5511e5959362fc33003e1e378eb6 (patch)
treee27f8cb286ddea20f07e6d589f2a8e55c72f0eec /llvm/lib/Support/Unix/Path.inc
parent373c38a2db3787b60a5d2588922e8b8eac389d17 (diff)
downloadbcm5719-llvm-adad33011f3f5511e5959362fc33003e1e378eb6.tar.gz
bcm5719-llvm-adad33011f3f5511e5959362fc33003e1e378eb6.zip
[Support] Add WriteThroughMemoryBuffer.
This is like MemoryBuffer (read-only) and WritableMemoryBuffer (writable private), but where the underlying file can be modified after writing. This is useful when you want to open a file, make some targeted edits, and then write it back out. Differential Revision: https://reviews.llvm.org/D44230 llvm-svn: 327057
Diffstat (limited to 'llvm/lib/Support/Unix/Path.inc')
-rw-r--r--llvm/lib/Support/Unix/Path.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 088774a2927..1d5e56dc3cf 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -792,7 +792,7 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
if (Flags & F_Append)
OpenFlags |= O_APPEND;
- else
+ else if (!(Flags & F_NoTrunc))
OpenFlags |= O_TRUNC;
if (Flags & F_Excl)
OpenPOWER on IntegriCloud