[PATCH] D44230: Add a ReadWriteMemoryBuffer class that can map an input file for modification

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 15:09:48 PST 2018


zturner created this revision.
zturner added reviewers: labath, dblaikie, rnk.
Herald added a subscriber: hiraditya.
zturner updated this revision to Diff 137494.
zturner added a comment.

clang-format the patch.


We currently have two `MemoryBuffer` abstractions.  The first is the most commonly used, and maps a file for read only access.  The second is called `WritableMemoryBuffer` and maps a file privately (e.g. using copy-on-write) in case you need to make local modifications.  But until this patch, we have no abstraction that can map a file in a way that allows to commit modifications back to the underlying file.  There are no users of this yet (in this patch anyway), but I have a patch locally which will use this in a followup.


https://reviews.llvm.org/D44230

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44230.137494.patch
Type: text/x-patch
Size: 8248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180307/3ef6b7ad/attachment.bin>


More information about the llvm-commits mailing list