[LLVMdev] Redefining function

Conrado Miranda miranda.conrado at gmail.com
Sat Jan 30 18:22:59 PST 2010


Albert Graef wrote:

> The way I do this in Pure is to always call global functions in an
> indirect fashion, using an internal global variable which holds the
> current function pointer. When a function definition gets updated, the
> Pure interpreter just jits the new function, changes the global variable
> accordingly, and frees the old code.
>
> Compared to Duncan's suggestion, this has the advantage that you only
> have to recompile the function which was changed. AFAICT, if you use
> replaceAllUsesWith, then the changes ripple through so that you might
> end up re-jiting most of your program.
>

Thought of that before, but I was trying to do it more elegantly and
transparent to the program (which is being write in C/C++). Maybe going back
to that.

Thank you both for the quick replies.

Miranda

PS:
If it's any help, got the svn version and, while running the program, got
this:
The JIT doesn't know how to handle a RAUW on a value it has emitted.
UNREACHABLE executed at
/home/conrado/engines/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1542!

I looked at the function and it's a dummy function. Just looking forward to
see that corrected.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100131/a5097a2a/attachment.html>


More information about the llvm-dev mailing list