[PATCH] D69825: [Clang][Driver] Bypass cc1 process and re-enter driver main

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 10:37:25 PST 2019


zturner added a comment.

Does this change crash recovery semantics in any meaningful way?  Will we still be able to get stack traces on all platforms when the compiler crashes?



================
Comment at: llvm/lib/Support/CrashRecoveryContext.cpp:207
+  // FIXME error: cannot compile this 'this' captured by SEH yet
+  CrashRecoveryContext *This = this;
   __try {
----------------
You can fix this by writing:

```
static bool wrap_function_call(function_ref<void()> Fn, bool EnableExceptionHandler, unsigned &RetCode)
{
   __try {
     Fn();
     return true;
  } __except (EnableExceptionHandler
                  ? LLVMUnhandledExceptionFilter(GetExceptionInformation())
                  : 1) {
    RetCode = GetExceptionCode();
    return false;
  }
}

bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
    ...
    bool Result = wrap_function_call(EnableExceptionHandler, Fn, RetCode);
    ...
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69825/new/

https://reviews.llvm.org/D69825





More information about the llvm-commits mailing list