[PATCH] D106213: [lld-macho] Enable copy-on-write for input buffers

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 14:02:36 PDT 2021


thevinster added a comment.

Looks pretty good to me, other than the comment about the casting.



================
Comment at: llvm/lib/Support/MemoryBufferRef.cpp:21
+
+WritableMemoryBufferRef MemoryBufferRef::castToWritable() const {
+  return WritableMemoryBufferRef(
----------------
Is there any way to prevent casting if this was called on a non-writeable buffer? I was thinking of some flag based approach that is set for writeable buffer and have that be determine whether casting can be done. That way, this can be a bit safer than having to let the developer have context about whether this is safe or not. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106213/new/

https://reviews.llvm.org/D106213



More information about the llvm-commits mailing list