diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 9 | ||||
-rw-r--r-- | include/clang/Sema/CodeCompleteConsumer.h | 6 | ||||
-rw-r--r-- | include/clang/Sema/CodeCompleteOptions.h | 7 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 6 |
4 files changed, 24 insertions, 4 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index a0c4dc98ad..775b7acc94 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -5161,7 +5161,14 @@ enum CXCodeComplete_Flags { * \brief Whether to include brief documentation within the set of code * completions returned. */ - CXCodeComplete_IncludeBriefComments = 0x04 + CXCodeComplete_IncludeBriefComments = 0x04, + + /** + * \brief Whether to speed up completion by omitting some entities which are + * defined in the preamble. There's no guarantee any particular entity will + * be omitted. This may be useful if the headers are indexed externally. + */ + CXCodeComplete_SkipPreamble = 0x08 }; /** diff --git a/include/clang/Sema/CodeCompleteConsumer.h b/include/clang/Sema/CodeCompleteConsumer.h index 5d280b5608..e8db3ec237 100644 --- a/include/clang/Sema/CodeCompleteConsumer.h +++ b/include/clang/Sema/CodeCompleteConsumer.h @@ -934,6 +934,12 @@ public: return CodeCompleteOpts.IncludeBriefComments; } + /// \brief Hint whether to load data from the external AST in order to provide + /// full results. If false, declarations from the preamble may be omitted. + bool loadExternal() const { + return CodeCompleteOpts.LoadExternal; + } + /// \brief Determine whether the output of this consumer is binary. bool isOutputBinary() const { return OutputIsBinary; } diff --git a/include/clang/Sema/CodeCompleteOptions.h b/include/clang/Sema/CodeCompleteOptions.h index 091d8ca605..bfba2be3ec 100644 --- a/include/clang/Sema/CodeCompleteOptions.h +++ b/include/clang/Sema/CodeCompleteOptions.h @@ -35,9 +35,14 @@ public: /// Show brief documentation comments in code completion results. unsigned IncludeBriefComments : 1; + /// Hint whether to load data from the external AST in order to provide + /// full results. If false, declarations from the preamble may be omitted. + unsigned LoadExternal : 1; + CodeCompleteOptions() : IncludeMacros(0), IncludeCodePatterns(0), IncludeGlobals(1), - IncludeNamespaceLevelDecls(1), IncludeBriefComments(0) {} + IncludeNamespaceLevelDecls(1), IncludeBriefComments(0), + LoadExternal(1) {} }; } // namespace clang diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index b4afd073c6..23aa3565d1 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -3199,11 +3199,13 @@ public: void LookupVisibleDecls(Scope *S, LookupNameKind Kind, VisibleDeclConsumer &Consumer, - bool IncludeGlobalScope = true); + bool IncludeGlobalScope = true, + bool LoadExternal = true); void LookupVisibleDecls(DeclContext *Ctx, LookupNameKind Kind, VisibleDeclConsumer &Consumer, bool IncludeGlobalScope = true, - bool IncludeDependentBases = false); + bool IncludeDependentBases = false, + bool LoadExternal = true); enum CorrectTypoKind { CTK_NonError, // CorrectTypo used in a non error recovery situation. |