summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-12-15 09:30:31 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-12-15 09:30:31 +0000
commit5c248d89f316fab5569dc79c54b50bd4de7f04a6 (patch)
treed96f3054502dab2b1f5d91bb463acb6746f99c1c /clang/include/clang-c
parent6045cc89bd81fa8915ad809e982902bcfc741632 (diff)
downloadbcm5719-llvm-5c248d89f316fab5569dc79c54b50bd4de7f04a6.tar.gz
bcm5719-llvm-5c248d89f316fab5569dc79c54b50bd4de7f04a6.zip
[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 llvm-svn: 255635
Diffstat (limited to 'clang/include/clang-c')
-rw-r--r--clang/include/clang-c/Index.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index e7ba2b26a4b..09e21608263 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/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
};
/**
OpenPOWER on IntegriCloud