File indexing completed on 2026-05-10 08:36:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
0010 #define LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
0011
0012 #include "clang/Index/IndexSymbol.h"
0013 #include "clang/Lex/Preprocessor.h"
0014
0015 namespace clang {
0016 class ASTContext;
0017 class DeclContext;
0018 class Expr;
0019 class FileID;
0020 class IdentifierInfo;
0021 class ImportDecl;
0022 class MacroInfo;
0023
0024 namespace index {
0025
0026 class IndexDataConsumer {
0027 public:
0028 struct ASTNodeInfo {
0029 const Expr *OrigE;
0030 const Decl *OrigD;
0031 const Decl *Parent;
0032 const DeclContext *ContainerDC;
0033 };
0034
0035 virtual ~IndexDataConsumer() = default;
0036
0037 virtual void initialize(ASTContext &Ctx) {}
0038
0039 virtual void setPreprocessor(std::shared_ptr<Preprocessor> PP) {}
0040
0041
0042 virtual bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles,
0043 ArrayRef<SymbolRelation> Relations,
0044 SourceLocation Loc, ASTNodeInfo ASTNode) {
0045 return true;
0046 }
0047
0048
0049 virtual bool handleMacroOccurrence(const IdentifierInfo *Name,
0050 const MacroInfo *MI, SymbolRoleSet Roles,
0051 SourceLocation Loc) {
0052 return true;
0053 }
0054
0055
0056
0057
0058
0059
0060 virtual bool handleModuleOccurrence(const ImportDecl *ImportD,
0061 const Module *Mod, SymbolRoleSet Roles,
0062 SourceLocation Loc) {
0063 return true;
0064 }
0065
0066 virtual void finish() {}
0067 };
0068
0069 }
0070 }
0071
0072 #endif