diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-17 22:10:55 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-17 22:10:55 +0000 |
commit | 87f9d81d0ab806dcf6ca50a0c068dcb2ba7f51b3 (patch) | |
tree | c8136fa64b9cee546774304b7375893b1208e58b /include | |
parent | 9753d462fabba1db75a977cb1f75ea66e9081120 (diff) | |
download | clang-87f9d81d0ab806dcf6ca50a0c068dcb2ba7f51b3.tar.gz |
[Modules] Use global index to improve typo correction performance
Typo correction for an unqualified name needs to walk through all of the identifier tables of all modules.
When we have a global index, just walk its identifier table only.
rdar://13425732
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 2 | ||||
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 2 | ||||
-rw-r--r-- | include/clang/Serialization/GlobalModuleIndex.h | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index c04a893c6f..d4d53390bd 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -394,7 +394,7 @@ public: /// /// \returns A new iterator into the set of known identifiers. The /// caller is responsible for deleting this iterator. - virtual IdentifierIterator *getIdentifiers() const; + virtual IdentifierIterator *getIdentifiers(); }; /// \brief An abstract class used to resolve numerical identifier diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 925533678c..a773e41667 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -1558,7 +1558,7 @@ public: /// \brief Retrieve an iterator into the set of all identifiers /// in all loaded AST files. - virtual IdentifierIterator *getIdentifiers() const; + virtual IdentifierIterator *getIdentifiers(); /// \brief Load the contents of the global method pool for a given /// selector. diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h index eaf26d1df1..ab91f4009c 100644 --- a/include/clang/Serialization/GlobalModuleIndex.h +++ b/include/clang/Serialization/GlobalModuleIndex.h @@ -146,6 +146,11 @@ public: static std::pair<GlobalModuleIndex *, ErrorCode> readIndex(StringRef Path); + /// \brief Returns an iterator for identifiers stored in the index table. + /// + /// The caller accepts ownership of the returned object. + IdentifierIterator *createIdentifierIterator() const; + /// \brief Retrieve the set of modules that have up-to-date indexes. /// /// \param ModuleFiles Will be populated with the set of module files that |