diff options
Diffstat (limited to 'include/clang/Frontend/ASTUnit.h')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 896cb31680..232f9406be 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -289,6 +289,9 @@ public: /// of that loading. It must be cleared when preamble is recreated. llvm::StringMap<SourceLocation> PreambleSrcLocCache; + /// \brief The set of cached code-completion results. + std::vector<CachedCodeCompletionResult> CachedCompletionResults; + /// \brief Counter that determines when we want to try building a /// precompiled preamble. /// @@ -306,6 +309,13 @@ public: /// This hash value is used to determine when we need to refresh the /// global code-completion cache after a rebuild of the precompiled preamble. unsigned PreambleTopLevelHashValue = 0; + + /// \brief A string hash of the top-level declaration and macro definition + /// names processed the last time that we reparsed the file. + /// + /// This hash value is used to determine when we need to refresh the + /// global code-completion cache. + unsigned CompletionCacheTopLevelHashValue = 0; }; void initCache(); @@ -340,20 +350,10 @@ private: std::unique_ptr<CodeCompletionTUInfo> CCTUInfo; - /// \brief The set of cached code-completion results. - std::vector<CachedCodeCompletionResult> CachedCompletionResults; - /// \brief A mapping from the formatted type name to a unique number for that /// type, which is used for type equality comparisons. llvm::StringMap<unsigned> CachedCompletionTypes; - /// \brief A string hash of the top-level declaration and macro definition - /// names processed the last time that we reparsed the file. - /// - /// This hash value is used to determine when we need to refresh the - /// global code-completion cache. - unsigned CompletionCacheTopLevelHashValue = 0; - /// \brief The current hash value for the top-level declaration and macro /// definition names unsigned CurrentTopLevelHashValue; @@ -609,15 +609,15 @@ public: cached_completion_iterator; cached_completion_iterator cached_completion_begin() { - return CachedCompletionResults.begin(); + return ASTUnitCacheMap[getMainFileName()].CachedCompletionResults.begin(); } cached_completion_iterator cached_completion_end() { - return CachedCompletionResults.end(); + return ASTUnitCacheMap[getMainFileName()].CachedCompletionResults.end(); } unsigned cached_completion_size() const { - return CachedCompletionResults.size(); + return ASTUnitCacheMap[getMainFileName()].CachedCompletionResults.size(); } /// \brief Returns an iterator range for the local preprocessing entities |