- } else if (PersonalityName == "_except_handler3") {
- RegNodeTy = getSEH3RegistrationType();
- RegNode = Builder.CreateAlloca(RegNodeTy);
- // TryLevel = -1
- StateFieldIndex = 2;
- insertStateNumberStore(RegNode, Builder.GetInsertPoint(), -1);
- // ScopeTable = llvm.x86.seh.lsda(F)
- Value *LSDA = emitEHLSDA(Builder, F);
- Builder.CreateStore(LSDA, Builder.CreateStructGEP(RegNodeTy, RegNode, 1));
- Link = Builder.CreateStructGEP(RegNodeTy, RegNode, 0);
- linkExceptionRegistration(Builder, PersonalityFn);
- } else if (PersonalityName == "_except_handler4") {
- RegNodeTy = getSEH4RegistrationType();
+ } else if (Personality == EHPersonality::MSVC_X86SEH) {
+ // If _except_handler4 is in use, some additional guard checks and prologue
+ // stuff is required.
+ bool UseStackGuard = (PersonalityName == "_except_handler4");
+ RegNodeTy = getSEHRegistrationType();