aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2021-05-24 20:19:32 -0700
committerLang Hames <lhames@gmail.com>2021-05-24 22:09:36 -0700
commit82ad2b6e94b6e9285de38aab9e2e5d87b06a377b (patch)
tree185cdc0bcf9889798855923376ab89b0c2822d84 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent6685a3f3e4c497a3a0fd06aa4e77cb442325d1ba (diff)
downloadllvm-82ad2b6e94b6e9285de38aab9e2e5d87b06a377b.zip
llvm-82ad2b6e94b6e9285de38aab9e2e5d87b06a377b.tar.gz
llvm-82ad2b6e94b6e9285de38aab9e2e5d87b06a377b.tar.bz2
[JITLink] Enable creation and management of mutable block content.
This patch introduces new operations on jitlink::Blocks: setMutableContent, getMutableContent and getAlreadyMutableContent. The setMutableContent method will set the block content data and size members and flag the content as mutable. The getMutableContent method will return a mutable copy of the existing content value, auto-allocating and populating a new mutable copy if the existing content is marked immutable. The getAlreadyMutableMethod asserts that the existing content is already mutable and returns it. setMutableContent should be used when updating the block with totally new content backed by mutable memory. It can be used to change the size of the block. The argument value should *not* be shared with any other block. getMutableContent should be used when clients want to modify the existing content and are unsure whether it is mutable yet. getAlreadyMutableContent should be used when clients want to modify the existing content and know from context that it must already be immutable. These operations reduce copy-modify-update boilerplate and unnecessary copies introduced when clients couldn't me sure whether the existing content was mutable or not.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions