aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Index/IndexProvider.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:38:21 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:38:21 +0000
commitb17dc46c795d5eceeceb1424b96d63739d12a522 (patch)
treed41ccd8f87a22fa6ff2efea2375c96c088b1a640 /include/clang/Index/IndexProvider.h
parent8e9e9ef5348bce1a8f0741a5684fac3de9701c28 (diff)
-Make IndexProvider an abstract interface for getting indexing information.
-Introduce Indexer as an IndexProvider implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Index/IndexProvider.h')
-rw-r--r--include/clang/Index/IndexProvider.h35
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