r195829 - [libclang] Check for LIBCLANG_DISABLE_CRASH_RECOVERY before enabling crash recovery.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Nov 27 00:58:09 PST 2013
Author: akirtzidis
Date: Wed Nov 27 02:58:09 2013
New Revision: 195829
URL: http://llvm.org/viewvc/llvm-project?rev=195829&view=rev
Log:
[libclang] Check for LIBCLANG_DISABLE_CRASH_RECOVERY before enabling crash recovery.
Suggested by Alp Toker.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=195829&r1=195828&r2=195829&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Nov 27 02:58:09 2013
@@ -2544,7 +2544,8 @@ CXIndex clang_createIndex(int excludeDec
int displayDiagnostics) {
// We use crash recovery to make some of our APIs more reliable, implicitly
// enable it.
- llvm::CrashRecoveryContext::Enable();
+ if (!getenv("LIBCLANG_DISABLE_CRASH_RECOVERY"))
+ llvm::CrashRecoveryContext::Enable();
// Enable support for multithreading in LLVM.
{
@@ -6515,11 +6516,6 @@ bool RunSafely(llvm::CrashRecoveryContex
unsigned Size) {
if (!Size)
Size = GetSafetyThreadStackSize();
- if (getenv("LIBCLANG_DISABLE_CRASH_RECOVERY")) {
- // Don't use crash recovery.
- llvm::llvm_execute_on_thread(Fn, UserData, Size);
- return true;
- }
if (Size)
return CRC.RunSafelyOnThread(Fn, UserData, Size);
return CRC.RunSafely(Fn, UserData);
More information about the cfe-commits
mailing list