]> granicus.if.org Git - clang/commitdiff
Add clang_disposeTranslationUnit() and clang_disposeIndex().
authorSteve Naroff <snaroff@apple.com>
Thu, 17 Sep 2009 18:33:27 +0000 (18:33 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 17 Sep 2009 18:33:27 +0000 (18:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82154 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CIndex/CIndex.cpp
tools/CIndex/CIndex.exports

index 1efb50fab5cc7b6e3b21a4e8b1e87224e4f95849..b2fca60a6f7c0fcd6750c7a5b3f1848e330e9cd0 100644 (file)
@@ -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");
index 17aba04493da02a4fe5b68bbe9020c47945927f3..a06d7bc558fd5aa5471c1916eda09d271e8b0f40 100644 (file)
@@ -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