diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-15 09:30:31 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-12-15 09:30:31 +0000 |
commit | bdb673743a14ba6d761febf41176581d7674df34 (patch) | |
tree | ed0bb6f0b14f6b5b8922a095cb82fbfdfcce75c3 /include/clang-c | |
parent | 598a06b9066ab5176456fa50b6f8eff6a72bac25 (diff) |
[libclang] Add a flag to create the precompiled preamble on the first parse.
Summary:
The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.
YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that.
Reviewers: doug.gregor, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15490
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r-- | include/clang-c/Index.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index e7ba2b26a4..09e2160826 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -1200,7 +1200,15 @@ enum CXTranslationUnit_Flags { * included into the set of code completions returned from this translation * unit. */ - CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80 + CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80, + + /** + * \brief Used to indicate that the precompiled preamble should be created on + * the first parse. Otherwise it will be created on the first reparse. This + * trades runtime on the first parse (serializing the preamble takes time) for + * reduced runtime on the second parse (can now reuse the preamble). + */ + CXTranslationUnit_CreatePreambleOnFirstParse = 0x100 }; /** |