[cfe-commits] r82154 - in /cfe/trunk/tools/CIndex: CIndex.cpp CIndex.exports

Steve Naroff snaroff at apple.com
Thu Sep 17 11:33:27 PDT 2009


Author: snaroff
Date: Thu Sep 17 13:33:27 2009
New Revision: 82154

URL: http://llvm.org/viewvc/llvm-project?rev=82154&view=rev
Log:
Add clang_disposeTranslationUnit() and clang_disposeIndex().

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp
    cfe/trunk/tools/CIndex/CIndex.exports

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=82154&r1=82153&r2=82154&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Thu Sep 17 13:33:27 2009
@@ -190,6 +190,12 @@
   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 @@
   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");

Modified: cfe/trunk/tools/CIndex/CIndex.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.exports?rev=82154&r1=82153&r2=82154&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.exports (original)
+++ cfe/trunk/tools/CIndex/CIndex.exports Thu Sep 17 13:33:27 2009
@@ -1,4 +1,5 @@
 _clang_createIndex
+_clang_disposeIndex
 _clang_getCursor
 _clang_getCursorColumn
 _clang_getCursorDecl
@@ -14,6 +15,7 @@
 _clang_loadDeclaration
 _clang_loadTranslationUnit
 _clang_createTranslationUnit
+_clang_disposeTranslationUnit
 _clang_isDeclaration
 _clang_isReference
 _clang_isDefinition





More information about the cfe-commits mailing list