diff options
Diffstat (limited to 'tools/CIndex/CIndex.cpp')
-rw-r--r-- | tools/CIndex/CIndex.cpp | 13 |
1 files changed, 13 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"); |