[PATCH] D74063: [Clang] Remove #pragma clang __debug handle_crash
Alexandre Ganea via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 5 08:59:23 PST 2020
aganea created this revision.
aganea added a reviewer: hans.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
As discussed in D70568 <https://reviews.llvm.org/D70568>, remove this because it isn't used anywhere, and I think it's better to go through real crashes for testing (`#pragma clang __debug crash`).
Also remove the support function `CrashRecoveryContext::HandleCrash()` which was added at the same time by @ddunbar.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74063
Files:
clang/lib/Lex/Pragma.cpp
llvm/include/llvm/Support/CrashRecoveryContext.h
llvm/lib/Support/CrashRecoveryContext.cpp
Index: llvm/lib/Support/CrashRecoveryContext.cpp
===================================================================
--- llvm/lib/Support/CrashRecoveryContext.cpp
+++ llvm/lib/Support/CrashRecoveryContext.cpp
@@ -406,14 +406,6 @@
#endif // !_MSC_VER
-void CrashRecoveryContext::HandleCrash() {
- CrashRecoveryContextImpl *CRCI = (CrashRecoveryContextImpl *) Impl;
- assert(CRCI && "Crash recovery context never initialized!");
- // As per convention, -2 indicates a crash or timeout as opposed to failure to
- // execute (see llvm/include/llvm/Support/Program.h)
- CRCI->HandleCrash(-2, 0);
-}
-
// FIXME: Portability.
static void setThreadBackgroundPriority() {
#ifdef __APPLE__
Index: llvm/include/llvm/Support/CrashRecoveryContext.h
===================================================================
--- llvm/include/llvm/Support/CrashRecoveryContext.h
+++ llvm/include/llvm/Support/CrashRecoveryContext.h
@@ -97,10 +97,6 @@
return RunSafelyOnThread([&]() { Fn(UserData); }, RequestedStackSize);
}
- /// Explicitly trigger a crash recovery in the current process, and
- /// return failure from RunSafely(). This function does not return.
- void HandleCrash();
-
/// In case of a crash, this is the crash identifier.
int RetCode = 0;
Index: clang/lib/Lex/Pragma.cpp
===================================================================
--- clang/lib/Lex/Pragma.cpp
+++ clang/lib/Lex/Pragma.cpp
@@ -1105,10 +1105,6 @@
M->dump();
} else if (II->isStr("overflow_stack")) {
DebugOverflowStack();
- } else if (II->isStr("handle_crash")) {
- llvm::CrashRecoveryContext *CRC =llvm::CrashRecoveryContext::GetCurrent();
- if (CRC)
- CRC->HandleCrash();
} else if (II->isStr("captured")) {
HandleCaptured(PP);
} else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74063.242644.patch
Type: text/x-patch
Size: 1800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200205/fed3690d/attachment.bin>
More information about the cfe-commits
mailing list