]> granicus.if.org Git - clang/commit
[libclang] Allow to suspend a translation unit.
authorErik Verbruggen <erikjv@me.com>
Tue, 30 May 2017 14:25:54 +0000 (14:25 +0000)
committerErik Verbruggen <erikjv@me.com>
Tue, 30 May 2017 14:25:54 +0000 (14:25 +0000)
commit91321d9884b7ce357cac1d128244d22dbe2a0cc7
treeb47a0b63a497050701d60321d40a816062d3c83c
parentce14f2c54ac4d7ba117337bf79420cebbd489481
[libclang] Allow to suspend a translation unit.

A suspended translation unit uses significantly less memory but on the
other side does not support any other calls than
clang_reparseTranslationUnit to resume it or
clang_disposeTranslationUnit to dispose it completely.

This helps IDEs to reduce the memory footprint. The data that is freed
by a call to clang_suspendTranslationUnit will be re-generated on the
next (re)parse anyway. Used with a preamble, this allows pretty fast
resumption of the translation unit for further use (compared to disposal
of the translation unit and a parse from scratch).

Patch by Nikolai Kosjar!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304212 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang-c/Index.h
include/clang/Frontend/ASTUnit.h
lib/Frontend/ASTUnit.cpp
tools/c-index-test/c-index-test.c
tools/libclang/CIndex.cpp
tools/libclang/libclang.exports