[PATCH] D33042: [libclang] Allow to suspend a translation unit.

Nikolai Kosjar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 08:09:21 PDT 2017


nik created this revision.
Herald added a subscriber: klimek.

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 for further use (compared to disposal of
the translation unit and a parse from scratch).


Repository:
  rL LLVM

https://reviews.llvm.org/D33042

Files:
  include/clang-c/Index.h
  include/clang/Frontend/ASTUnit.h
  lib/Format/UnwrappedLineParser.cpp
  lib/Frontend/ASTUnit.cpp
  tools/c-index-test/c-index-test.c
  tools/libclang/CIndex.cpp
  tools/libclang/libclang.exports
  unittests/Format/FormatTestJS.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33042.98459.patch
Type: text/x-patch
Size: 6415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170510/fc03850f/attachment.bin>


More information about the cfe-commits mailing list