[PATCH] D39449: Rewrite FileOutputBuffer as two separate classes.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 20:01:33 PDT 2017


ruiu created this revision.
Herald added a subscriber: hiraditya.

This patch is to rewrite FileOutputBuffer as two separate classes;
one for file-backed output buffer and the other for memory-backed
output buffer. I think the new code is easier to follow because two
different implementations are now actually separated as different
classes.

Unlike the previous implementation, the class that does not replace the
final output file using rename(2) does not create a temporary file at
all. Instead, it allocates memory using mmap(2) and use it. I think
this is an improvement because it is now guaranteed that the temporary
memory region doesn't trigger any I/O and there's now zero chance to
leave a temporary file behind. Also, it shouldn't impose new restrictions
because were using mmap IO too.


https://reviews.llvm.org/D39449

Files:
  llvm/include/llvm/Support/FileOutputBuffer.h
  llvm/lib/Support/FileOutputBuffer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39449.120931.patch
Type: text/x-patch
Size: 11009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171031/aa098566/attachment.bin>


More information about the llvm-commits mailing list