clang
8.0.0
include
clang
Index
IndexDataConsumer.h
Go to the documentation of this file.
1
//===--- IndexDataConsumer.h - Abstract index data consumer -----*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
11
#define LLVM_CLANG_INDEX_INDEXDATACONSUMER_H
12
13
#include "
clang/Index/IndexSymbol.h
"
14
#include "
clang/Lex/Preprocessor.h
"
15
16
namespace
clang
{
17
class
ASTContext;
18
class
DeclContext;
19
class
Expr;
20
class
FileID;
21
class
IdentifierInfo;
22
class
ImportDecl;
23
class
MacroInfo;
24
25
namespace
index {
26
27
class
IndexDataConsumer
{
28
public
:
29
struct
ASTNodeInfo
{
30
const
Expr
*
OrigE
;
31
const
Decl
*
OrigD
;
32
const
Decl
*
Parent
;
33
const
DeclContext
*
ContainerDC
;
34
};
35
36
virtual
~IndexDataConsumer
() {}
37
38
virtual
void
initialize
(
ASTContext
&Ctx) {}
39
40
virtual
void
setPreprocessor
(std::shared_ptr<Preprocessor> PP) {}
41
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);
46
47
/// \returns true to continue indexing, or false to abort.
48
virtual
bool
handleMacroOccurence
(
const
IdentifierInfo
*Name,
49
const
MacroInfo
*MI,
SymbolRoleSet
Roles,
50
SourceLocation
Loc);
51
52
/// \returns true to continue indexing, or false to abort.
53
///
54
/// This will be called for each module reference in an import decl.
55
/// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the
56
/// 'reference' role, and a call for 'SubMod' with the 'declaration' role.
57
virtual
bool
handleModuleOccurence
(
const
ImportDecl
*ImportD,
58
const
Module
*Mod,
59
SymbolRoleSet
Roles,
SourceLocation
Loc);
60
61
virtual
void
finish
() {}
62
};
63
64
}
// namespace index
65
}
// namespace clang
66
67
#endif
clang::index::IndexDataConsumer::setPreprocessor
virtual void setPreprocessor(std::shared_ptr< Preprocessor > PP)
Definition:
IndexDataConsumer.h:40
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition:
DeclBase.h:87
clang::index::IndexDataConsumer::handleDeclOccurence
virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations, SourceLocation Loc, ASTNodeInfo ASTNode)
Definition:
IndexingAction.cpp:25
clang::index::IndexDataConsumer::~IndexDataConsumer
virtual ~IndexDataConsumer()
Definition:
IndexDataConsumer.h:36
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition:
IdentifierTable.h:58
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition:
ASTContext.h:155
clang::Module
Describes a module or submodule.
Definition:
Module.h:65
clang::index::IndexDataConsumer::ASTNodeInfo
Definition:
IndexDataConsumer.h:29
clang::index::IndexDataConsumer
Definition:
IndexDataConsumer.h:27
llvm::ArrayRef
Definition:
LLVM.h:32
clang::index::SymbolRoleSet
unsigned SymbolRoleSet
Definition:
IndexSymbol.h:124
clang::index::IndexDataConsumer::ASTNodeInfo::OrigD
const Decl * OrigD
Definition:
IndexDataConsumer.h:31
clang::Expr
This represents one expression.
Definition:
Expr.h:106
Preprocessor.h
Defines the clang::Preprocessor interface.
IndexSymbol.h
clang::index::IndexDataConsumer::initialize
virtual void initialize(ASTContext &Ctx)
Definition:
IndexDataConsumer.h:38
clang::SourceLocation
Encodes a location in the source.
Definition:
SourceLocation.h:88
clang::index::IndexDataConsumer::handleModuleOccurence
virtual bool handleModuleOccurence(const ImportDecl *ImportD, const Module *Mod, SymbolRoleSet Roles, SourceLocation Loc)
Definition:
IndexingAction.cpp:39
clang::index::IndexDataConsumer::ASTNodeInfo::Parent
const Decl * Parent
Definition:
IndexDataConsumer.h:32
clang::ImportDecl
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition:
Decl.h:4149
clang
Dataflow Directional Tag Classes.
Definition:
CFGReachabilityAnalysis.h:22
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition:
DeclBase.h:1262
clang::index::IndexDataConsumer::handleMacroOccurence
virtual bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI, SymbolRoleSet Roles, SourceLocation Loc)
Definition:
IndexingAction.cpp:32
clang::MacroInfo
Encapsulates the data about a macro definition (e.g.
Definition:
MacroInfo.h:40
clang::index::IndexDataConsumer::finish
virtual void finish()
Definition:
IndexDataConsumer.h:61
clang::index::IndexDataConsumer::ASTNodeInfo::ContainerDC
const DeclContext * ContainerDC
Definition:
IndexDataConsumer.h:33
clang::index::IndexDataConsumer::ASTNodeInfo::OrigE
const Expr * OrigE
Definition:
IndexDataConsumer.h:30
Generated on Mon Mar 18 2019 14:16:58 for clang by
1.8.13