summaryrefslogtreecommitdiff
path: root/include/clang-c
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-05-17 07:31:29 +0000
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-05-17 07:31:29 +0000
commit96865fb14c773fbc314c0533e3286300d37ee406 (patch)
tree22d0852c5c2affc56c77a57bbea1ffa9a32aee9b /include/clang-c
parente831748eaaa33bd543f5474ecd4cb76cbdc46b29 (diff)
downloadclang-96865fb14c773fbc314c0533e3286300d37ee406.tar.gz
[libclang] Allow skipping function bodies in preamble only
As an addition to CXTranslationUnit_SkipFunctionBodies, provide the new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble, which constraints the skipping of functions bodies to the preamble only. Function bodies in the main file are not affected if this option is set. Skipping function bodies only in the preamble is what clangd already does and the introduced flag implements it for libclang clients. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D45815 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang-c')
-rw-r--r--include/clang-c/Index.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 3fee13a40b..4e6fcce8ad 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -1321,13 +1321,21 @@ enum CXTranslationUnit_Flags {
*/
CXTranslationUnit_KeepGoing = 0x200,
- /**
- * Sets the preprocessor in a mode for parsing a single file only.
- */
- CXTranslationUnit_SingleFileParse = 0x400
-};
-
-/**
+ /**
+ * Sets the preprocessor in a mode for parsing a single file only.
+ */
+ CXTranslationUnit_SingleFileParse = 0x400,
+
+ /**
+ * \brief Used in combination with CXTranslationUnit_SkipFunctionBodies to
+ * constrain the skipping of function bodies to the preamble.
+ *
+ * The function bodies of the main file are not skipped.
+ */
+ CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 0x800,
+};
+
+/**
* Returns the set of flags that is suitable for parsing a translation
* unit that is being edited.
*