[PATCH] MCJIT::clearSymbolAddress

Yaron Keren yaron.keren at gmail.com
Fri Oct 18 04:39:26 PDT 2013


The use-case is replacing a named function before creating a same-named
function in a new module, such as in REPL.

With the older JIT a function could be removed from the symbol table (and
memory freed) by calling freeMachineCodeForFunction.

The new MCJIT does not implement this function - may be impossible to
modify the object - so the next best thing is to remove the symbol from the
symbol table so the older copy will not be found anymore and then a new
function could be created.

Since MCJIT uses GlobalSymbolTable in RuntimeDyldImpl.h rather than
the GlobalAddressMap in ExecutionEngineState (could EEState be reused by
MCJIT somehow?) the code is MCJIT specific.

To expose it to the programmer the function appears in EE as well with a
comment and the call chain is

EE->MCJIT->RuntimeDyld->RuntimeDyldImpl->GlobalSymbolTable.erase().

Yaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131018/e46d5d0c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clearSymbolAddress.diff
Type: application/octet-stream
Size: 4057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131018/e46d5d0c/attachment.obj>


More information about the llvm-commits mailing list