<div dir="rtl"><div dir="ltr"><div dir="ltr">The use-case is replacing a named function before creating a same-named function in a new module, such as in REPL.</div><div><br></div></div><div dir="ltr">With the older JIT a function could be removed from the symbol table (and memory freed) by calling freeMachineCodeForFunction. </div>

<div dir="ltr"><br></div><div dir="ltr">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.</div>

<div dir="ltr"><br></div><div dir="ltr">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.</div>

<div dir="ltr"><br></div><div dir="ltr">To expose it to the programmer the function appears in EE as well with a comment and the call chain is</div><div dir="ltr"><br></div><div dir="ltr"><font face="courier new, monospace">EE->MCJIT->RuntimeDyld->RuntimeDyldImpl->GlobalSymbolTable.erase().</font></div>

<div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div>