зеркало из https://github.com/microsoft/clang.git
Add libclang hook 'clang_toggleCrashRecovery()', which provides a mechanism for a client to enable/disable CrashRecovery within libclang function calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127920 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
6628a614c5
Коммит
d2427ddf00
|
@ -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()).
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -126,6 +126,7 @@ clang_parseTranslationUnit
|
|||
clang_reparseTranslationUnit
|
||||
clang_saveTranslationUnit
|
||||
clang_sortCodeCompletionResults
|
||||
clang_toggleCrashRecovery
|
||||
clang_tokenize
|
||||
clang_visitChildren
|
||||
clang_visitChildrenWithBlock
|
||||
|
|
Загрузка…
Ссылка в новой задаче