[LLVMdev] Implementing try/catch/finally

Duncan Sands duncan.sands at math.u-psud.fr
Mon Apr 21 00:32:14 PDT 2008

> One approach would be to simply duplicate the code in the 'finally' 
> block for each exit, but that seems sub-optimal. It would be better, I 
> think, to set a state variable before entering the 'finally' block, and 
> then have it do a switch instruction at the end and transfer to the 
> appropriate block.

I think gcc just duplicates the block (see tree-eh.c).  I suggest that
to start with you do the same, because it is simple to do, and then once
everything is working well look into improving the code quality.



More information about the llvm-dev mailing list