[LLVMdev] Question about LLVM Interpreter

Lu Mitnick king19880326 at gmail.com
Wed Dec 26 00:09:29 PST 2012


Hello all,

I am an user of LLVM Interpreter. The situation I encounter is as follows:

---------------------------------------------------------------------
main.c:

jmp_buf buf;
int main() {

  if (setjmp(buf) == 0) {
    ...
  } else {
     execute();
  }

}
---------------------------------------------------------------------
execute.c:

execute() {
    EE->runFunction(Func, Args); // EE is LLVM interpreter, function body
                                                // of Func is in Func.ll
}
---------------------------------------------------------------------
Func.ll:

def void @Func() {
  .
  call void @foo() noreturn
  .
}
---------------------------------------------------------------------
foo.c:

void foo() {
  longjmp(buf, 1);
}
---------------------------------------------------------------------

If Interpreter execute a LLVM function Func, It may not update stack frame
of
interpreter simultaneously. An error may occur when recall
interpreter::run().

Does anyone encounter the same problem and have any idea to solve it?

Thanks a lot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121226/482cb943/attachment.html>


More information about the llvm-dev mailing list