[llvm-branch-commits] [llvm] 793d643 - [Clang] Remove unused #pragma clang __debug handle_crash

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 10 06:32:39 PST 2020


Author: Alexandre Ganea
Date: 2020-02-10T15:30:01+01:00
New Revision: 793d643f6d69e6908a6ece4aacb07b6573e33e18

URL: https://github.com/llvm/llvm-project/commit/793d643f6d69e6908a6ece4aacb07b6573e33e18
DIFF: https://github.com/llvm/llvm-project/commit/793d643f6d69e6908a6ece4aacb07b6573e33e18.diff

LOG: [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 8ecde3ac34bbb5a8d53d8ec5cd32867658646df1)

Added: 
    

Modified: 
    clang/lib/Lex/Pragma.cpp
    llvm/include/llvm/Support/CrashRecoveryContext.h
    llvm/lib/Support/CrashRecoveryContext.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index e4636265a72b..c881bcac9f38 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -39,7 +39,6 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/CrashRecoveryContext.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
@@ -1105,10 +1104,6 @@ struct PragmaDebugHandler : public PragmaHandler {
       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 {

diff  --git a/llvm/include/llvm/Support/CrashRecoveryContext.h b/llvm/include/llvm/Support/CrashRecoveryContext.h
index 9522c4742244..beeb855c7c58 100644
--- a/llvm/include/llvm/Support/CrashRecoveryContext.h
+++ b/llvm/include/llvm/Support/CrashRecoveryContext.h
@@ -97,10 +97,6 @@ class CrashRecoveryContext {
     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;
 

diff  --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp
index 510f46abe4b5..a24bf7bf2557 100644
--- a/llvm/lib/Support/CrashRecoveryContext.cpp
+++ b/llvm/lib/Support/CrashRecoveryContext.cpp
@@ -406,14 +406,6 @@ bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
 
 #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__


        


More information about the llvm-branch-commits mailing list