<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 15, 2017 at 9:51 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 15 November 2017 at 17:42, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> Can we just extend llvm's mapped_file_region to support a boolean Writable<br>
> flag?<br>
><br>
mapped_file_region already can be writable. The feature it is missing<br>
is the ability to *not* use mmap. And that's not a good idea, as the<br>
whole purpose of that class is to mmap things.<br></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
We could theoretically add a writable flag to llvm::MemoryBuffer,<br>
but's its header says:<br>
/// This interface provides simple ***read-only*** access to a block<br>
of memory, and ...<br></blockquote><div><br></div><div>To be quite honest I've been annoyed by MemoryBuffer's lack of mutability on many different occasions.  It's something I've wanted to fix for a long time anyway.</div><div><br></div><div>If this patch isn't super time-critical, I can actually volunteer to go make a writable version of MemoryBuffer, and then we can use that instead.  I could probably be done in a day or two.  Thoughts?</div></div></div>