[LLVMdev] Forward references to a function

Christophe de Dinechin christophe at taodyne.com
Wed Feb 3 12:06:40 PST 2010

JIT::runJITOnFunctionUnlocked makes sure that functions referenced by the current function are JIT-ed. In my case, I may be compiling foo(), during which I notice that I need to build bar(), which refers to foo(). The compiler dies JIT-ing foo() because it's not done yet. Specifically, I'm in the middle of generating one of the BBs of foo(), so it doesn't have a terminating instruction and I assert with:

Assertion failed: (T && "getTerminator returned null!"), function SuccIterator, file /Users/ddd/Development/llvm/include/llvm/Support/CFG.h, line 99.

I have checked that ExecutionEnding::DisableLazyCompilation() fixes it. Am I supposed to enable lazy JIT in that case? That's not really what i want, what I really would like is to be able to state that a function is "in progress" to make sure it doesn't get added to the pending list. Much like a forward reference in C.

Thanks in advance,

More information about the llvm-dev mailing list