[Support] Add WriteThroughMemoryBuffer.
authorZachary Turner <zturner@google.com>
Thu, 8 Mar 2018 20:34:47 +0000 (20:34 +0000)
committerZachary Turner <zturner@google.com>
Thu, 8 Mar 2018 20:34:47 +0000 (20:34 +0000)
commitadad33011f3f5511e5959362fc33003e1e378eb6
treee27f8cb286ddea20f07e6d589f2a8e55c72f0eec
parent373c38a2db3787b60a5d2588922e8b8eac389d17
[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
llvm/include/llvm/Support/FileSystem.h
llvm/include/llvm/Support/MemoryBuffer.h
llvm/lib/Support/MemoryBuffer.cpp
llvm/lib/Support/Unix/Path.inc
llvm/lib/Support/Windows/Path.inc
llvm/unittests/Support/MemoryBufferTest.cpp