MSVC provide exception handlers with enhanced information to deal with security buffer feature (/GS).
To be more secure, the security cookies (GS and SEH) are validated when unwinding the stack.
The following code:
void f() {}
void foo() {
__try {
f();
} __except(1) {
f();
}
}
Code in lib/Analysis isn't supposed to modify IR, but inserting a declaration into the module should be fine. Maybe a better name would be getStackGuardEHPersonality, though, since it doesn't actually modify the IR.