summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
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/Windows
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/Windows')
-rw-r--r--llvm/lib/Support/Windows/Path.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index 58c555daceb..1fcb7598412 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -1101,7 +1101,7 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
DWORD CreationDisposition;
if (Flags & F_Excl)
CreationDisposition = CREATE_NEW;
- else if (Flags & F_Append)
+ else if ((Flags & F_Append) || (Flags & F_NoTrunc))
CreationDisposition = OPEN_ALWAYS;
else
CreationDisposition = CREATE_ALWAYS;
OpenPOWER on IntegriCloud