1 //===--- IndexDataConsumer.h - Abstract index data consumer -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
11 #define LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
13 #include "clang/Index/IndexSymbol.h"
14 #include "clang/Lex/Preprocessor.h"
27 class IndexDataConsumer {
33 const DeclContext *ContainerDC;
36 virtual ~IndexDataConsumer() {}
38 virtual void initialize(ASTContext &Ctx) {}
40 virtual void setPreprocessor(std::shared_ptr<Preprocessor> PP) {}
42 /// \returns true to continue indexing, or false to abort.
43 virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles,
44 ArrayRef<SymbolRelation> Relations,
45 SourceLocation Loc, ASTNodeInfo ASTNode);
47 /// \returns true to continue indexing, or false to abort.
48 virtual bool handleMacroOccurence(const IdentifierInfo *Name,
49 const MacroInfo *MI, SymbolRoleSet Roles,
52 /// \returns true to continue indexing, or false to abort.
53 virtual bool handleModuleOccurence(const ImportDecl *ImportD,
54 SymbolRoleSet Roles, SourceLocation Loc);
56 virtual void finish() {}