<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 15, 2017, at 10:11 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Nov 15, 2017 at 9:51 AM Pavel Labath <<a href="mailto:labath@google.com" class="">labath@google.com</a>> wrote:<br class=""></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" class="">zturner@google.com</a>> wrote:<br class="">
> Can we just extend llvm's mapped_file_region to support a boolean Writable<br class="">
> flag?<br class="">
><br class="">
mapped_file_region already can be writable. The feature it is missing<br class="">
is the ability to *not* use mmap. And that's not a good idea, as the<br class="">
whole purpose of that class is to mmap things.<br class=""></blockquote><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
We could theoretically add a writable flag to llvm::MemoryBuffer,<br class="">
but's its header says:<br class="">
/// This interface provides simple ***read-only*** access to a block<br class="">
of memory, and ...<br class=""></blockquote><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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>
</div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">The more we can push down into llvm the better IMHO. I wouldn't have any problem with it.</div></body></html>