This patch fixes a Windows -EHa crash induced by previous commit
797ad701522988e212495285dade8efac41a24d4.
The crash was caused by "LifetimeMarker" scope (with option -O2) that should not be considered as SEH Scope.
This change also turns off -fasync-exceptions by default under -EHa option for now.
Differential Revision: https://reviews.llvm.org/D103664#2799944
Scope->setLifetimeMarker();
// With Windows -EHa, Invoke llvm.seh.scope.begin() for EHCleanup
- if (CGF->getLangOpts().EHAsynch && IsEHCleanup &&
+ if (CGF->getLangOpts().EHAsynch && IsEHCleanup && !IsLifetimeMarker &&
CGF->getTarget().getCXXABI().isMicrosoft())
CGF->EmitSehCppScopeBegin();
if (types::isCXX(InputType))
CmdArgs.push_back("-fcxx-exceptions");
CmdArgs.push_back("-fexceptions");
- if (EH.Asynch)
- CmdArgs.push_back("-fasync-exceptions");
}
if (types::isCXX(InputType) && EH.Synch && EH.NoUnwindC)
CmdArgs.push_back("-fexternc-nounwind");