Trying out SjLj exception handling on Win32

I've raised the point before, and I know it's not the "right" way for
exceptions on Windows, but 32-bit Windows really has no alternative
(Win64 is different).

I set (unconditionally, only for testing)
ExceptionsType = ExceptionHandling::SjLj;
in X86MCAsmInfoCOFF. This leads to an error message when compiling with clang++:
fatal error: error in backend: Cannot select: intrinsic %llvm.eh.sjlj.lsda

Which is telling me I missed something. I can't find the origin of the
error, or where I should look to make it go away.

Any help is appreciated.

Ruben

I set (unconditionally, only for testing)
ExceptionsType = ExceptionHandling::SjLj;
in X86MCAsmInfoCOFF. This leads to an error message when compiling with clang++:
fatal error: error in backend: Cannot select: intrinsic %llvm.eh.sjlj.lsda

Which is telling me I missed something. I can't find the origin of the
error, or where I should look to make it go away.

Instruction selector on x86 does not know how to expand the mentioned intrinsic.
If you really want sjlj exceptions on windows you should (at least):

1. Make sure the frontend emits the proper IR (e.g. compatible with gcc)
2. Implement the necessary lowering & instruction selection code