clang
9.0.0
include
clang
Index
IndexDataConsumer.h
Go to the documentation of this file.
1
//===--- IndexDataConsumer.h - Abstract index data consumer -----*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
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
/// \returns true to continue indexing, or false to abort.
42
virtual
bool
handleDeclOccurence
(
const
Decl
*D,
SymbolRoleSet
Roles,
43
ArrayRef<SymbolRelation>
Relations,
44
SourceLocation
Loc,
ASTNodeInfo
ASTNode);
45
46
/// \returns true to continue indexing, or false to abort.
47
virtual
bool
handleMacroOccurence
(
const
IdentifierInfo
*Name,
48
const
MacroInfo
*MI,
SymbolRoleSet
Roles,
49
SourceLocation
Loc);
50
51
/// \returns true to continue indexing, or false to abort.
52
///
53
/// This will be called for each module reference in an import decl.
54
/// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the
55
/// 'reference' role, and a call for 'SubMod' with the 'declaration' role.
56
virtual
bool
handleModuleOccurence
(
const
ImportDecl
*ImportD,
57
const
Module
*Mod,
58
SymbolRoleSet
Roles,
SourceLocation
Loc);
59
60
virtual
void
finish
() {}
61
};
62
63
}
// namespace index
64
}
// namespace clang
65
66
#endif
clang::index::IndexDataConsumer::setPreprocessor
virtual void setPreprocessor(std::shared_ptr< Preprocessor > PP)
Definition:
IndexDataConsumer.h:39
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition:
DeclBase.h:88
clang::index::IndexDataConsumer::handleDeclOccurence
virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations, SourceLocation Loc, ASTNodeInfo ASTNode)
Definition:
IndexingAction.cpp:24
clang::index::IndexDataConsumer::~IndexDataConsumer
virtual ~IndexDataConsumer()
Definition:
IndexDataConsumer.h:35
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition:
IdentifierTable.h:57
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition:
ASTContext.h:154
clang::Module
Describes a module or submodule.
Definition:
Module.h:64
clang::index::IndexDataConsumer::ASTNodeInfo
Definition:
IndexDataConsumer.h:28
clang::index::IndexDataConsumer
Definition:
IndexDataConsumer.h:26
llvm::ArrayRef
Definition:
LLVM.h:31
clang::index::SymbolRoleSet
unsigned SymbolRoleSet
Definition:
IndexSymbol.h:127
clang::index::IndexDataConsumer::ASTNodeInfo::OrigD
const Decl * OrigD
Definition:
IndexDataConsumer.h:30
clang::Expr
This represents one expression.
Definition:
Expr.h:108
Preprocessor.h
Defines the clang::Preprocessor interface.
IndexSymbol.h
clang::index::IndexDataConsumer::initialize
virtual void initialize(ASTContext &Ctx)
Definition:
IndexDataConsumer.h:37
clang::SourceLocation
Encodes a location in the source.
Definition:
SourceLocation.h:86
clang::index::IndexDataConsumer::handleModuleOccurence
virtual bool handleModuleOccurence(const ImportDecl *ImportD, const Module *Mod, SymbolRoleSet Roles, SourceLocation Loc)
Definition:
IndexingAction.cpp:38
clang::index::IndexDataConsumer::ASTNodeInfo::Parent
const Decl * Parent
Definition:
IndexDataConsumer.h:31
clang::ImportDecl
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition:
Decl.h:4213
clang
Dataflow Directional Tag Classes.
Definition:
CFGReachabilityAnalysis.h:21
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition:
DeclBase.h:1271
clang::index::IndexDataConsumer::handleMacroOccurence
virtual bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI, SymbolRoleSet Roles, SourceLocation Loc)
Definition:
IndexingAction.cpp:31
clang::MacroInfo
Encapsulates the data about a macro definition (e.g.
Definition:
MacroInfo.h:39
clang::index::IndexDataConsumer::finish
virtual void finish()
Definition:
IndexDataConsumer.h:60
clang::index::IndexDataConsumer::ASTNodeInfo::ContainerDC
const DeclContext * ContainerDC
Definition:
IndexDataConsumer.h:32
clang::index::IndexDataConsumer::ASTNodeInfo::OrigE
const Expr * OrigE
Definition:
IndexDataConsumer.h:29
Generated on Thu Sep 19 2019 15:18:16 for clang by
1.8.13