Questions about event handler implementation


I want to implement an exceptions support in some compiler I'm
currently working on.
I've read the documentation and some articles (like or
I've also checked out C++ implementation for Unix-like systems.
There are many things I don't understand.

1. landingpad instruction returns an info of type {i8*, i32}. Where
this type comes from? Can it be changed to something else?

2. It seems that personality function can be of any type. How LLVM
knows how to supply arguments for it?

3. I don't see a connection between personality function used in C++
(__gxx_personality_v0) and the information landingpad instruction
returns. __gxx_personality_v0 returns only some return code, but no
selector. Where the selector returned by landingpad comes from?

4. throw in C++ is implemented with the help of __cxa_throw which uses
_Unwind_RaiseException. How LLVM knows that an exception was raised
inside that function and control should go to a landingpad?