[llvm-commits] Patch for correct landing pad code emission

Duncan Sands baldrick at free.fr
Wed May 23 15:16:37 PDT 2007


Hi Anton,

> Please find attached patch, which fixes LLVM's behaviour during code
> emission in LPs.
> 
> Currently AddLandingPad() function emits llvm.eh.exception only for
> TRY_EXCEPT blocks. But sometimes (see, e.g. g++.dg/eh/unexpected1.C) gcc
> generates code of form:
> 
> try {
>  throw();
> } finally {
>  ....
>  Unwind_Resume();
> }
> 
> so, the exception is rethrown upper. In order to correctly handle this
> situation we should emit landing pad info for TRY_FINALLY blocks also.
> Attached patch does this.

while this patch works, I think it is suboptimal in some cases.
I am still investigating how to avoid this suboptimality.  I suggest
this patch be put on hold for a day or two until I have finished.

Ciao,

Duncan.



More information about the llvm-commits mailing list