summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-09-17 18:33:27 +0000
committerSteve Naroff <snaroff@apple.com>2009-09-17 18:33:27 +0000
commit2bd6b9f298afb16a2aec035ebd7b29af7c5c3da8 (patch)
tree805ee951c9abac79ede343e852f3147eddde3086 /tools
parente1f63b38a0a668a2756c77b92f440c03977d7ca1 (diff)
downloadclang-2bd6b9f298afb16a2aec035ebd7b29af7c5c3da8.tar.gz
Add clang_disposeTranslationUnit() and clang_disposeIndex().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-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