[cfe-commits] r111449 - /cfe/trunk/lib/Lex/Pragma.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 18 16:09:23 PDT 2010


Author: ddunbar
Date: Wed Aug 18 18:09:23 2010
New Revision: 111449

URL: http://llvm.org/viewvc/llvm-project?rev=111449&view=rev
Log:
CrashRecovery: Add #pragma clang __debug handle_crash, useful when debugging
CrashRecovery since it avoids sending a signal which may be intercepted by the
debugger.

Modified:
    cfe/trunk/lib/Lex/Pragma.cpp

Modified: cfe/trunk/lib/Lex/Pragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Pragma.cpp?rev=111449&r1=111448&r2=111449&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Wed Aug 18 18:09:23 2010
@@ -20,6 +20,7 @@
 #include "clang/Lex/LexDiagnostic.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
+#include "llvm/Support/CrashRecoveryContext.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 using namespace clang;
@@ -708,6 +709,10 @@
       llvm_unreachable("#pragma clang __debug llvm_unreachable");
     } else if (II->isStr("overflow_stack")) {
       DebugOverflowStack();
+    } else if (II->isStr("handle_crash")) {
+      llvm::CrashRecoveryContext *CRC =llvm::CrashRecoveryContext::GetCurrent();
+      if (CRC)
+        CRC->HandleCrash();
     } else {
       PP.Diag(Tok, diag::warn_pragma_debug_unexpected_command)
         << II->getName();





More information about the cfe-commits mailing list