aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/CIndex/CIndex.cpp13
-rw-r--r--tools/CIndex/CIndex.exports2
2 files changed, 15 insertions, 0 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 1efb50fab5..b2fca60a6f 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -190,6 +190,12 @@ CXIndex clang_createIndex()
return new Indexer(*new Program(), *new FileManager());
}
+void clang_disposeIndex(CXIndex CIdx)
+{
+ assert(CIdx && "Passed null CXIndex");
+ delete static_cast<Indexer *>(CIdx);
+}
+
// FIXME: need to pass back error info.
CXTranslationUnit clang_createTranslationUnit(
CXIndex CIdx, const char *ast_filename)
@@ -202,6 +208,13 @@ CXTranslationUnit clang_createTranslationUnit(
return ASTUnit::LoadFromPCHFile(astName, CXXIdx->getFileManager(), &ErrMsg);
}
+void clang_disposeTranslationUnit(
+ CXTranslationUnit CTUnit)
+{
+ assert(CTUnit && "Passed null CXTranslationUnit");
+ delete static_cast<ASTUnit *>(CTUnit);
+}
+
const char *clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit)
{
assert(CTUnit && "Passed null CXTranslationUnit");
diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports
index 17aba04493..a06d7bc558 100644
--- a/tools/CIndex/CIndex.exports
+++ b/tools/CIndex/CIndex.exports
@@ -1,4 +1,5 @@
_clang_createIndex
+_clang_disposeIndex
_clang_getCursor
_clang_getCursorColumn
_clang_getCursorDecl
@@ -14,6 +15,7 @@ _clang_getURI
_clang_loadDeclaration
_clang_loadTranslationUnit
_clang_createTranslationUnit
+_clang_disposeTranslationUnit
_clang_isDeclaration
_clang_isReference
_clang_isDefinition