diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-08-18 23:09:23 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-18 23:09:23 +0000 |
commit | 211a787eaf9b5fbaed92fe3d1a2470c3206a3c41 (patch) | |
tree | 0fcde5728634a1070f6050ca3aaaab17fb95b19e /clang/lib/Lex/Pragma.cpp | |
parent | ec29d712d449beb6b16210c6683b01814082ca75 (diff) | |
download | bcm5719-llvm-211a787eaf9b5fbaed92fe3d1a2470c3206a3c41.tar.gz bcm5719-llvm-211a787eaf9b5fbaed92fe3d1a2470c3206a3c41.zip |
CrashRecovery: Add #pragma clang __debug handle_crash, useful when debugging
CrashRecovery since it avoids sending a signal which may be intercepted by the
debugger.
llvm-svn: 111449
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 0ef87b96d3b..f0f3bce008d 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -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 @@ struct PragmaDebugHandler : public PragmaHandler { 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(); |