diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:41:18 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:41:18 +0000 |
commit | d88284b4386169bb165d70796953ef802f2e90a5 (patch) | |
tree | ee6ffe1e2c029cb06a1129f17631e422d3b2cfc1 /include | |
parent | 0f3984809f998cdfcdef9880fcdade12c9f9b5f6 (diff) |
Index the selectors and provide the translation units that contain them
through the IndexProvider.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Index/IndexProvider.h | 3 | ||||
-rw-r--r-- | include/clang/Index/Indexer.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Index/IndexProvider.h b/include/clang/Index/IndexProvider.h index f69945eb2b..187dd9393c 100644 --- a/include/clang/Index/IndexProvider.h +++ b/include/clang/Index/IndexProvider.h @@ -19,6 +19,7 @@ namespace clang { namespace idx { class Entity; class TranslationUnitHandler; + class GlobalSelector; /// \brief Maps information to TranslationUnits. class IndexProvider { @@ -26,6 +27,8 @@ public: virtual ~IndexProvider(); virtual void GetTranslationUnitsFor(Entity Ent, TranslationUnitHandler &Handler) = 0; + virtual void GetTranslationUnitsFor(GlobalSelector Sel, + TranslationUnitHandler &Handler) = 0; }; } // namespace idx diff --git a/include/clang/Index/Indexer.h b/include/clang/Index/Indexer.h index 4fa3616064..98cce9e44b 100644 --- a/include/clang/Index/Indexer.h +++ b/include/clang/Index/Indexer.h @@ -15,6 +15,8 @@ #define LLVM_CLANG_INDEX_INDEXER_H #include "clang/Index/IndexProvider.h" +#include "clang/Index/Entity.h" +#include "clang/Index/GlobalSelector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMap.h" #include <map> @@ -32,6 +34,7 @@ public: typedef llvm::SmallPtrSet<TranslationUnit *, 4> TUSetTy; typedef llvm::DenseMap<ASTContext *, TranslationUnit *> CtxTUMapTy; typedef std::map<Entity, TUSetTy> MapTy; + typedef std::map<GlobalSelector, TUSetTy> SelMapTy; explicit Indexer(Program &prog) : Prog(prog) { } @@ -42,11 +45,14 @@ public: virtual void GetTranslationUnitsFor(Entity Ent, TranslationUnitHandler &Handler); + virtual void GetTranslationUnitsFor(GlobalSelector Sel, + TranslationUnitHandler &Handler); private: Program &Prog; MapTy Map; CtxTUMapTy CtxTUMap; + SelMapTy SelMap; }; } // namespace idx |