]> granicus.if.org Git - clang/commitdiff
Add libclang hook 'clang_toggleCrashRecovery()', which provides a mechanism for a...
authorTed Kremenek <kremenek@apple.com>
Fri, 18 Mar 2011 23:05:39 +0000 (23:05 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 18 Mar 2011 23:05:39 +0000 (23:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127920 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/libclang/CIndex.cpp
tools/libclang/libclang.darwin.exports
tools/libclang/libclang.exports

index 722f6be538b4365d147ab75206ceb9a04dacbbe8..4d93afd105dd16291196890d7baa4e205b2d49e3 100644 (file)
@@ -2871,6 +2871,15 @@ CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results,
  */
 CINDEX_LINKAGE CXString clang_getClangVersion();
 
+  
+/**
+ * \brief Enable/disable crash recovery.
+ *
+ * \param Flag to indicate if crash recovery is enabled.  A non-zero value
+ *        enables crash recovery, while 0 disables it.
+ */
+CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled);
+  
  /**
   * \brief Visitor invoked for each file in a translation unit
   *        (used with clang_getInclusions()).
index 88b3d76e91e419370c4fa4631ffb3f40769ca50a..502ee9958d64792fc7a155a86e2fb2d56adad41c 100644 (file)
@@ -2309,6 +2309,13 @@ void clang_disposeIndex(CXIndex CIdx) {
     delete static_cast<CIndexer *>(CIdx);
 }
 
+void clang_toggleCrashRecovery(unsigned isEnabled) {
+  if (isEnabled)
+    llvm::CrashRecoveryContext::Enable();
+  else
+    llvm::CrashRecoveryContext::Disable();
+}
+  
 CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx,
                                               const char *ast_filename) {
   if (!CIdx)
index 7614544ca3bc91345e116fb3ffc63500d646f593..0bb463207f232235d92516e6517fbcde24f2731f 100644 (file)
@@ -108,8 +108,8 @@ _clang_getTranslationUnitSpelling
 _clang_getTypeDeclaration
 _clang_getTypeKindSpelling
 _clang_hashCursor
-_clang_isCursorDefinition
 _clang_isConstQualifiedType
+_clang_isCursorDefinition
 _clang_isDeclaration
 _clang_isExpression
 _clang_isInvalid
@@ -126,6 +126,7 @@ _clang_parseTranslationUnit
 _clang_reparseTranslationUnit
 _clang_saveTranslationUnit
 _clang_sortCodeCompletionResults
+_clang_toggleCrashRecovery
 _clang_tokenize
 _clang_visitChildren
 _clang_visitChildrenWithBlock
index c2f0587b9ae805fad4cb3ca3466e091ae0c31b54..ac17b2e74bc88c374d6ed6c2b1d09b70db50eaa8 100644 (file)
@@ -126,6 +126,7 @@ clang_parseTranslationUnit
 clang_reparseTranslationUnit
 clang_saveTranslationUnit
 clang_sortCodeCompletionResults
+clang_toggleCrashRecovery
 clang_tokenize
 clang_visitChildren
 clang_visitChildrenWithBlock