diff options
author | Steve Naroff <snaroff@apple.com> | 2009-09-17 18:33:27 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-09-17 18:33:27 +0000 |
commit | 2bd6b9f298afb16a2aec035ebd7b29af7c5c3da8 (patch) | |
tree | 805ee951c9abac79ede343e852f3147eddde3086 /tools/CIndex/CIndex.cpp | |
parent | e1f63b38a0a668a2756c77b92f440c03977d7ca1 (diff) |
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/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"); |