[Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI.
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 7 Feb 2020 00:23:27 +0000 (19:23 -0500)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 7 Feb 2020 00:23:49 +0000 (19:23 -0500)
commit2a3fa0fc5cd7d3398c0293915b0e569eaa0be24b
treec826609bf9bde7c9a8f2298f94b7aca4217e6fc4
parentad0e03fd4c8066843f4138e44661ee0287ceb631
[Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI.

Previously, the SEH codepath in CrashRecoveryContext didn't create a CrashRecoveryContextImpl. The other codepaths (VEH and Unix) were creating it.

When running with -fintegrated-cc1, this is needed to handle exit() as a jump to CrashRecoveryContext's exception filter, through a call to RaiseException. In that situation, we need a user-defined exception code, which is later interpreted as an exit() by the exception filter. This in turn needs to set RetCode accordingly, *inside* the exception filter, and *before* calling HandleCrash().

Differential Revision: https://reviews.llvm.org/D74078
llvm/lib/Support/CrashRecoveryContext.cpp