]> granicus.if.org Git - llvm/commit
[Orc] Add a method for ObjectLinkingLayer to return ownership of object buffers.
authorLang Hames <lhames@gmail.com>
Tue, 15 Oct 2019 21:41:12 +0000 (21:41 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 15 Oct 2019 21:41:12 +0000 (21:41 +0000)
commit72deff436dcd881c23ec2bef65b8f6eb4f309ea7
tree8ec73c6354c87c9024264ef6f1faed47cd83c1cd
parentada11b89658c878aec432d29ea8cb2f22958096d
[Orc] Add a method for ObjectLinkingLayer to return ownership of object buffers.

RTDyldObjectLinkingLayer allowed clients to register a NotifyEmitted function to
reclaim ownership of object buffers once they had been linked. This patch adds
similar functionality to ObjectLinkingLayer: Clients can now optionally call the
ObjectLinkingLayer::setReturnObjectBuffer method to register a function that
will be called when discarding object buffers. If set, this function will be
called to return ownership of the object regardless of whether the link
succeeded or failed.

Use cases for this function include debug dumping (it provides a way to dump
all objects linked into JIT'd code) and object re-use (e.g. storing an
object in a cache).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374951 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp