[LLVMdev] Redefining function

Conrado Miranda miranda.conrado at gmail.com
Mon Feb 1 12:46:38 PST 2010


On Mon, Feb 1, 2010 at 3:41 PM, Jeffrey Yasskin <jyasskin at google.com> wrote:

> Hm, I wonder if the error message for llvm_unreachable should change.
> I think I remember a couple people focusing incorrectly on the
> UNREACHABLE instead of the actual error message above it (which means
> it's our fault, not theirs).
>

I think so. It really seems like it's the programmers fault


> Miranda, this is pointing at the same problem you had before. You have
> a function JIT-compiled, and you're trying to RAUW
> (ReplaceAllUsesWith) it. You'll need to call
> freeMachineCodeForFunction(x) before you call
> x->replaceAllUsesWith(y).
>

Actually, I didn't call freeMachineCodeForFunction(x) (I know it's a leak,
but just to show it's possible not to call).


> And yes, putting your code (and a gdb-produced stack trace when
> there's a crash) somewhere we can see it (for example, pastebin.com)
> will always help us debug problems.
>

The headers are a little mess, but it compiles OK.
Main file: http://miranda.pastebin.com/m10213c9c
File with function A (following your convention):
http://miranda.pastebin.com/m2dbe2e64
File with function B: http://miranda.pastebin.com/m2dbe2e64
File with function C: http://miranda.pastebin.com/m32f19219
gdb trace: http://miranda.pastebin.com/m5c794b0d

When I call recompileAndRelinkFunction without calling
freeMachineCodeForFunction for the same function, it crashes.

Just ask if more info is needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100201/f7d04d35/attachment.html>


More information about the llvm-dev mailing list