[LLVMdev] Integrating LLVM in an existing project

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri Apr 6 00:50:18 PDT 2007


Hi Chris,

Chris Lattner wrote:
>> We can not use current exception handling in llvm, see
>> http://www.nondot.org/sabre/LLVMNotes/ExceptionHandlingChanges.txt.
>>     
>
> Why not?
>
>   

Like you say, it's not functional for non-calls instructions. Besides, 
having to change
all CalInst to InvokeInst is just too much pain in our current vm.

> There are two separate issues here:
>
> 1. catching exceptions from function calls
> 2. catching exceptions from "non call" instructions like divides, etc.
>
> The LLVM IR, as it stands now, is expressive enough to describe #1, but 
> not #2.  The notes above talk solely about how to extend the IR to support 
> #2.  Reid has an interest in implementing #2 at some point, which will be 
> a great improvement for some applications.
>
> There is an extra wrinkle here though.  Zero-cost C++ exception handling 
> (i.e. #1) is about 3/4 of the way implemented in the C front-end and code 
> generator, but it is not yet completed (notably, JIT support is missing). 
> This work is also currently stalled.
>
>   

Actually, why is it missing? What's the difference between the code 
generator
and the JIT?

> If you'd be interested in helping with any of these projects, please let 
> me know!
>   

The thing is, I know very little on exception handling (our 
setjmp/longjmp mechanism in our vms
is functional but not really optimized) and zip on LLVM. I looked at 
Reid's notes for implementing #2,
and I'm not sure I can help without having a month or two (of spare 
time) to learn LLVM's internals.

However, I'd be interested to look at how exception handling can be 
implemented in the JIT.
What's the current situation?

Nicolas



More information about the llvm-dev mailing list