13 using namespace clang;
14 using namespace index;
30 : IndexCtx(indexCtx), Parent(parent), ParentDC(DC), IsBase(isBase) {
37 bool shouldWalkTypesOfTypeLocs()
const {
return false; }
45 #define TRY_TO(CALL_EXPR) \
65 if (
auto FD = dyn_cast<FunctionDecl>(D->getDeclContext())) {
66 if (FD->isThisDeclarationADefinition()) {
67 return traverseParamVarHelper(D);
71 return base::TraverseParmVarDecl(D);
75 IndexCtx.indexNestedNameSpecifierLoc(NNS, Parent, ParentDC);
81 if (D->getParentFunctionOrMethod())
85 IndexCtx.indexTagDecl(D);
89 return IndexCtx.handleReference(D, TL.
getNameLoc(),
109 if (IndexCtx.shouldIndexImplicitTemplateInsts()) {
114 if (
const TemplateDecl *D = T->getTemplateName().getAsTemplateDecl())
122 bool TraverseStmt(
Stmt *
S) {
123 IndexCtx.indexBody(S, Parent, ParentDC);
148 DC = Parent->getLexicalDeclContext();
149 TypeIndexer(*
this, Parent, DC, isBase).TraverseTypeLoc(TL);
162 DC = Parent->getLexicalDeclContext();
194 if (
auto CXXRD = dyn_cast<CXXRecordDecl>(D)) {
195 for (
const auto &
I : CXXRD->bases()) {
Wrapper for source info for tag types.
void indexTypeLoc(TypeLoc TL, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false)
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range covering the entirety of this nested-name-specifier.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
bool handleReference(const NamedDecl *D, SourceLocation Loc, const NamedDecl *Parent, const DeclContext *DC, SymbolRoleSet Roles, ArrayRef< SymbolRelation > Relations=None, const Expr *RefE=nullptr, const Decl *RefD=nullptr)
Wrapper for source info for typedefs.
A container of type source information.
An identifier, stored as an IdentifierInfo*.
TRY_TO(TraverseType(T->getPointeeType()))
A namespace, stored as a NamespaceDecl*.
ParmVarDecl - Represents a parameter to a function.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Base wrapper for a particular "section" of type source info.
bool isDefinition() const
True if the tag was defined in this type specifier.
A C++ nested-name-specifier augmented with source location information.
unsigned getNumProtocols() const
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Wrapper for source info for ObjC interfaces.
A class that does preordor or postorder depth-first traversal on the entire Clang AST and visits each...
detail::InMemoryDirectory::const_iterator I
TypedefNameDecl * getTypedefNameDecl() const
void indexTypeSourceInfo(TypeSourceInfo *TInfo, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false)
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
TagDecl * getDecl() const
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
bool indexDeclContext(const DeclContext *DC)
A namespace alias, stored as a NamespaceAliasDecl*.
SourceLocation getTemplateNameLoc() const
A type, stored as a Type*.
TypeSourceInfo * getTypeSourceInfo() const
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
static bool isFunctionLocalDecl(const Decl *D)
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Encodes a location in the source.
TagDecl - Represents the declaration of a struct/union/class/enum.
SourceLocation getNameLoc() const
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
SourceLocation getBegin() const
SourceLocation getNameLoc() const
bool handleDecl(const Decl *D, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The base class of all kinds of template declarations (e.g., class, function, etc.).
ObjCInterfaceDecl * getIFaceDecl() const
A type that was preceded by the 'template' keyword, stored as a Type*.
void indexNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, const NamedDecl *Parent, const DeclContext *DC=nullptr)
bool shouldIndexFunctionLocalSymbols() const
ObjCProtocolDecl * getProtocol(unsigned i) const
const TypeClass * getTypePtr() const
SourceLocation getProtocolLoc(unsigned i) const
Represents a C++ struct/union/class.
void indexTagDecl(const TagDecl *D)
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
NamedDecl - This represents a decl with a name.
The global specifier '::'. There is no stored value.
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)