[LLVMdev] Proper way to handle JIT codegen exceptions?

Gregory Junker gjunker at dayark.com
Thu Oct 27 23:00:34 PDT 2011

I am looking through the source and Support/ErrorHandling.cpp/.h says, in so
many words, "don't throw exceptions from inside an installed fatal error
handling routine". 

So how are people handling errors during JIT? For command-line compilers,
calling exit() or abort() isn't as big a deal -- the compiler is probably
going to exit anyway. But say, for instance, the host application is Firefox
-- my guess is that just letting exit() handle the situation isn't the

So what is the "proper" way to handle exceptional LLVM conditions ("cannot
select", for instance)? Yes, I know this is something that needs to be
brought to the programmer's attention, but having the user's application
crash out on them isn't the way I expect most actual LLVM-JIT-based
applications are handling these things...


More information about the llvm-dev mailing list