Skip to content

Commit 793d643

Browse files
aganeazmodem
authored andcommitted
[Clang] Remove unused #pragma clang __debug handle_crash
As discussed in 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 llvm::CrashRecoveryContext::HandleCrash() which was added at the same time by @ddunbar. Differential Revision: https://reviews.llvm.org/D74063 (cherry picked from commit 8ecde3a)
1 parent b8fead7 commit 793d643

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

clang/lib/Lex/Pragma.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "llvm/ADT/SmallVector.h"
4040
#include "llvm/ADT/StringSwitch.h"
4141
#include "llvm/ADT/StringRef.h"
42-
#include "llvm/Support/CrashRecoveryContext.h"
4342
#include "llvm/Support/Compiler.h"
4443
#include "llvm/Support/ErrorHandling.h"
4544
#include <algorithm>
@@ -1105,10 +1104,6 @@ struct PragmaDebugHandler : public PragmaHandler {
11051104
M->dump();
11061105
} else if (II->isStr("overflow_stack")) {
11071106
DebugOverflowStack();
1108-
} else if (II->isStr("handle_crash")) {
1109-
llvm::CrashRecoveryContext *CRC =llvm::CrashRecoveryContext::GetCurrent();
1110-
if (CRC)
1111-
CRC->HandleCrash();
11121107
} else if (II->isStr("captured")) {
11131108
HandleCaptured(PP);
11141109
} else {

llvm/include/llvm/Support/CrashRecoveryContext.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ class CrashRecoveryContext {
9797
return RunSafelyOnThread([&]() { Fn(UserData); }, RequestedStackSize);
9898
}
9999

100-
/// Explicitly trigger a crash recovery in the current process, and
101-
/// return failure from RunSafely(). This function does not return.
102-
void HandleCrash();
103-
104100
/// In case of a crash, this is the crash identifier.
105101
int RetCode = 0;
106102

llvm/lib/Support/CrashRecoveryContext.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,6 @@ bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
406406

407407
#endif // !_MSC_VER
408408

409-
void CrashRecoveryContext::HandleCrash() {
410-
CrashRecoveryContextImpl *CRCI = (CrashRecoveryContextImpl *) Impl;
411-
assert(CRCI && "Crash recovery context never initialized!");
412-
// As per convention, -2 indicates a crash or timeout as opposed to failure to
413-
// execute (see llvm/include/llvm/Support/Program.h)
414-
CRCI->HandleCrash(-2, 0);
415-
}
416-
417409
// FIXME: Portability.
418410
static void setThreadBackgroundPriority() {
419411
#ifdef __APPLE__

0 commit comments

Comments
 (0)