| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | #ifndef LLVM_CLANG_INDEX_INDEXDATACONSUMER_H |
| 10 | #define LLVM_CLANG_INDEX_INDEXDATACONSUMER_H |
| 11 | |
| 12 | #include "clang/Index/IndexSymbol.h" |
| 13 | #include "clang/Lex/Preprocessor.h" |
| 14 | |
| 15 | namespace clang { |
| 16 | class ASTContext; |
| 17 | class DeclContext; |
| 18 | class Expr; |
| 19 | class FileID; |
| 20 | class IdentifierInfo; |
| 21 | class ImportDecl; |
| 22 | class MacroInfo; |
| 23 | |
| 24 | namespace index { |
| 25 | |
| 26 | class IndexDataConsumer { |
| 27 | public: |
| 28 | struct ASTNodeInfo { |
| 29 | const Expr *OrigE; |
| 30 | const Decl *OrigD; |
| 31 | const Decl *Parent; |
| 32 | const DeclContext *ContainerDC; |
| 33 | }; |
| 34 | |
| 35 | virtual ~IndexDataConsumer() {} |
| 36 | |
| 37 | virtual void initialize(ASTContext &Ctx) {} |
| 38 | |
| 39 | virtual void setPreprocessor(std::shared_ptr<Preprocessor> PP) {} |
| 40 | |
| 41 | |
| 42 | virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, |
| 43 | ArrayRef<SymbolRelation> Relations, |
| 44 | SourceLocation Loc, ASTNodeInfo ASTNode); |
| 45 | |
| 46 | |
| 47 | virtual bool handleMacroOccurence(const IdentifierInfo *Name, |
| 48 | const MacroInfo *MI, SymbolRoleSet Roles, |
| 49 | SourceLocation Loc); |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | virtual bool handleModuleOccurence(const ImportDecl *ImportD, |
| 57 | const Module *Mod, |
| 58 | SymbolRoleSet Roles, SourceLocation Loc); |
| 59 | |
| 60 | virtual void finish() {} |
| 61 | }; |
| 62 | |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | #endif |
| 67 | |