diff options
Diffstat (limited to 'include/clang/Index/IndexProvider.h')
-rw-r--r-- | include/clang/Index/IndexProvider.h | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/include/clang/Index/IndexProvider.h b/include/clang/Index/IndexProvider.h index ab86474f9a..bf776eee4f 100644 --- a/include/clang/Index/IndexProvider.h +++ b/include/clang/Index/IndexProvider.h @@ -1,4 +1,4 @@ -//===--- IndexProvider.h - Map of entities to translation units -*- C++ -*-===// +//===--- IndexProvider.h - Maps information to translation units -*- C++ -*-==// // // The LLVM Compiler Infrastructure // @@ -7,46 +7,25 @@ // //===----------------------------------------------------------------------===// // -// Maps Entities to TranslationUnits +// Maps information to TranslationUnits. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_INDEX_INDEXPROVIDER_H #define LLVM_CLANG_INDEX_INDEXPROVIDER_H -#include "llvm/ADT/SmallPtrSet.h" -#include <map> - namespace clang { namespace idx { - class Program; class Entity; - class TranslationUnit; + class TranslationUnitHandler; -/// \brief Maps Entities to TranslationUnits. +/// \brief Maps information to TranslationUnits. class IndexProvider { public: - typedef llvm::SmallPtrSet<TranslationUnit *, 4> TUSetTy; - typedef std::map<Entity, TUSetTy> MapTy; - class Indexer; - - explicit IndexProvider(Program &prog) : Prog(prog) { } - - Program &getProgram() const { return Prog; } - - /// \brief Find all Entities and map them to the given translation unit. - void IndexAST(TranslationUnit *TU); - - typedef TUSetTy::iterator translation_unit_iterator; - - translation_unit_iterator translation_units_begin(Entity Ent) const; - translation_unit_iterator translation_units_end(Entity Ent) const; - bool translation_units_empty(Entity Ent) const; - -private: - Program &Prog; - mutable MapTy Map; + virtual ~IndexProvider(); + virtual void GetTranslationUnitsFor(Entity Ent, + TranslationUnitHandler *Handler) = 0; }; } // namespace idx |