This is an archive of the discontinued LLVM Phabricator instance.

[libclang] Allow to suspend a translation unit.
ClosedPublic

Authored by nik on May 10 2017, 8:09 AM.

Details

Summary

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).

Diff Detail

Event Timeline

nik created this revision.May 10 2017, 8:09 AM
nik updated this revision to Diff 98461.May 10 2017, 8:12 AM
nik added a reviewer: akyrtzi.May 11 2017, 8:26 AM
bkramer accepted this revision.May 19 2017, 7:05 AM

This makes sense to me.

lib/Frontend/ASTUnit.cpp
2067

Put the { on the same line as the decl.

This revision is now accepted and ready to land.May 19 2017, 7:05 AM
nik marked an inline comment as done.May 22 2017, 12:33 AM

Adapted to the changes that happened in the meanwhile (CINDEX_VERSION_MINOR increased, CleanTemporaryFiles got removed).

nik updated this revision to Diff 99718.May 22 2017, 12:34 AM
nik edited the summary of this revision. (Show Details)
nik added a comment.May 29 2017, 2:07 AM

I'm new to this review tool. I've addressed the comments and rebased. Does this needs a re-review? Note that this is my first change and I probably do not have any permissions to submit this change.

erikjv closed this revision.May 30 2017, 7:28 AM
erikjv added a subscriber: erikjv.

Committed as r304212.