clang  14.0.0git
IndexTypeSourceInfo.cpp
Go to the documentation of this file.
1 //===- IndexTypeSourceInfo.cpp - Indexing types ---------------------------===//
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 #include "IndexingContext.h"
11 #include "llvm/ADT/ScopeExit.h"
12 
13 using namespace clang;
14 using namespace index;
15 
16 namespace {
17 
18 class TypeIndexer : public RecursiveASTVisitor<TypeIndexer> {
19  IndexingContext &IndexCtx;
20  const NamedDecl *Parent;
21  const DeclContext *ParentDC;
22  bool IsBase;
24 
26 
27 public:
28  TypeIndexer(IndexingContext &indexCtx, const NamedDecl *parent,
29  const DeclContext *DC, bool isBase, bool isIBType)
30  : IndexCtx(indexCtx), Parent(parent), ParentDC(DC), IsBase(isBase) {
31  if (IsBase) {
32  assert(Parent);
33  Relations.emplace_back((unsigned)SymbolRole::RelationBaseOf, Parent);
34  }
35  if (isIBType) {
36  assert(Parent);
37  Relations.emplace_back((unsigned)SymbolRole::RelationIBTypeOf, Parent);
38  }
39  }
40 
41  bool shouldWalkTypesOfTypeLocs() const { return false; }
42 
43 #define TRY_TO(CALL_EXPR) \
44  do { \
45  if (!CALL_EXPR) \
46  return false; \
47  } while (0)
48 
49  bool VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TTPL) {
50  SourceLocation Loc = TTPL.getNameLoc();
51  TemplateTypeParmDecl *TTPD = TTPL.getDecl();
52  return IndexCtx.handleReference(TTPD, Loc, Parent, ParentDC,
53  SymbolRoleSet());
54  }
55 
56  bool VisitTypedefTypeLoc(TypedefTypeLoc TL) {
57  SourceLocation Loc = TL.getNameLoc();
59  if (ND->isTransparentTag()) {
60  TagDecl *Underlying = ND->getUnderlyingType()->getAsTagDecl();
61  return IndexCtx.handleReference(Underlying, Loc, Parent,
62  ParentDC, SymbolRoleSet(), Relations);
63  }
64  if (IsBase) {
65  TRY_TO(IndexCtx.handleReference(ND, Loc,
66  Parent, ParentDC, SymbolRoleSet()));
67  if (auto *CD = TL.getType()->getAsCXXRecordDecl()) {
68  TRY_TO(IndexCtx.handleReference(CD, Loc, Parent, ParentDC,
69  (unsigned)SymbolRole::Implicit,
70  Relations));
71  }
72  } else {
73  TRY_TO(IndexCtx.handleReference(ND, Loc,
74  Parent, ParentDC, SymbolRoleSet(),
75  Relations));
76  }
77  return true;
78  }
79 
80  bool traverseParamVarHelper(ParmVarDecl *D) {
81  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
82  if (D->getTypeSourceInfo())
83  TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
84  return true;
85  }
86 
87  bool TraverseParmVarDecl(ParmVarDecl *D) {
88  // Avoid visiting default arguments from the definition that were already
89  // visited in the declaration.
90  // FIXME: A free function definition can have default arguments.
91  // Avoiding double visitaiton of default arguments should be handled by the
92  // visitor probably with a bit in the AST to indicate if the attached
93  // default argument was 'inherited' or written in source.
94  if (auto FD = dyn_cast<FunctionDecl>(D->getDeclContext())) {
95  if (FD->isThisDeclarationADefinition()) {
96  return traverseParamVarHelper(D);
97  }
98  }
99 
100  return base::TraverseParmVarDecl(D);
101  }
102 
103  bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS) {
104  IndexCtx.indexNestedNameSpecifierLoc(NNS, Parent, ParentDC);
105  return true;
106  }
107 
108  bool VisitTagTypeLoc(TagTypeLoc TL) {
109  TagDecl *D = TL.getDecl();
110  if (!IndexCtx.shouldIndexFunctionLocalSymbols() &&
112  return true;
113 
114  if (TL.isDefinition()) {
115  IndexCtx.indexTagDecl(D);
116  return true;
117  }
118 
119  return IndexCtx.handleReference(D, TL.getNameLoc(),
120  Parent, ParentDC, SymbolRoleSet(),
121  Relations);
122  }
123 
124  bool VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {
125  return IndexCtx.handleReference(TL.getIFaceDecl(), TL.getNameLoc(),
126  Parent, ParentDC, SymbolRoleSet(), Relations);
127  }
128 
129  bool VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) {
130  for (unsigned i = 0, e = TL.getNumProtocols(); i != e; ++i) {
131  IndexCtx.handleReference(TL.getProtocol(i), TL.getProtocolLoc(i),
132  Parent, ParentDC, SymbolRoleSet(), Relations);
133  }
134  return true;
135  }
136 
137  void HandleTemplateSpecializationTypeLoc(TemplateName TemplName,
138  SourceLocation TemplNameLoc,
139  CXXRecordDecl *ResolvedClass,
140  bool IsTypeAlias) {
141  // In presence of type aliases, the resolved class was never written in
142  // the code so don't report it.
143  if (!IsTypeAlias && ResolvedClass &&
144  (!ResolvedClass->isImplicit() ||
145  IndexCtx.shouldIndexImplicitInstantiation())) {
146  IndexCtx.handleReference(ResolvedClass, TemplNameLoc, Parent, ParentDC,
147  SymbolRoleSet(), Relations);
148  } else if (const TemplateDecl *D = TemplName.getAsTemplateDecl()) {
149  IndexCtx.handleReference(D, TemplNameLoc, Parent, ParentDC,
150  SymbolRoleSet(), Relations);
151  }
152  }
153 
154  bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL) {
155  auto *T = TL.getTypePtr();
156  if (!T)
157  return true;
158  HandleTemplateSpecializationTypeLoc(
159  T->getTemplateName(), TL.getTemplateNameLoc(), T->getAsCXXRecordDecl(),
160  T->isTypeAlias());
161  return true;
162  }
163 
164  bool TraverseTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL) {
165  if (!WalkUpFromTemplateSpecializationTypeLoc(TL))
166  return false;
167  if (!TraverseTemplateName(TL.getTypePtr()->getTemplateName()))
168  return false;
169 
170  // The relations we have to `Parent` do not apply to our template arguments,
171  // so clear them while visiting the args.
172  SmallVector<SymbolRelation, 3> SavedRelations = Relations;
173  Relations.clear();
174  auto ResetSavedRelations =
175  llvm::make_scope_exit([&] { this->Relations = SavedRelations; });
176  for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) {
177  if (!TraverseTemplateArgumentLoc(TL.getArgLoc(I)))
178  return false;
179  }
180 
181  return true;
182  }
183 
184  bool VisitDeducedTemplateSpecializationTypeLoc(DeducedTemplateSpecializationTypeLoc TL) {
185  auto *T = TL.getTypePtr();
186  if (!T)
187  return true;
188  HandleTemplateSpecializationTypeLoc(
189  T->getTemplateName(), TL.getTemplateNameLoc(), T->getAsCXXRecordDecl(),
190  /*IsTypeAlias=*/false);
191  return true;
192  }
193 
194  bool VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) {
195  return IndexCtx.handleReference(TL.getDecl(), TL.getNameLoc(), Parent,
196  ParentDC, SymbolRoleSet(), Relations);
197  }
198 
199  bool VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
200  const DependentNameType *DNT = TL.getTypePtr();
201  const NestedNameSpecifier *NNS = DNT->getQualifier();
202  const Type *T = NNS->getAsType();
203  if (!T)
204  return true;
205  const TemplateSpecializationType *TST =
207  if (!TST)
208  return true;
209  TemplateName TN = TST->getTemplateName();
210  const ClassTemplateDecl *TD =
211  dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl());
212  if (!TD)
213  return true;
214  CXXRecordDecl *RD = TD->getTemplatedDecl();
215  if (!RD->hasDefinition())
216  return true;
217  RD = RD->getDefinition();
218  DeclarationName Name(DNT->getIdentifier());
219  std::vector<const NamedDecl *> Symbols = RD->lookupDependentName(
220  Name, [](const NamedDecl *ND) { return isa<TypeDecl>(ND); });
221  if (Symbols.size() != 1)
222  return true;
223  return IndexCtx.handleReference(Symbols[0], TL.getNameLoc(), Parent,
224  ParentDC, SymbolRoleSet(), Relations);
225  }
226 
227  bool TraverseStmt(Stmt *S) {
228  IndexCtx.indexBody(S, Parent, ParentDC);
229  return true;
230  }
231 };
232 
233 } // anonymous namespace
234 
236  const NamedDecl *Parent,
237  const DeclContext *DC,
238  bool isBase,
239  bool isIBType) {
240  if (!TInfo || TInfo->getTypeLoc().isNull())
241  return;
242 
243  indexTypeLoc(TInfo->getTypeLoc(), Parent, DC, isBase, isIBType);
244 }
245 
247  const NamedDecl *Parent,
248  const DeclContext *DC,
249  bool isBase,
250  bool isIBType) {
251  if (TL.isNull())
252  return;
253 
254  if (!DC)
255  DC = Parent->getLexicalDeclContext();
256  TypeIndexer(*this, Parent, DC, isBase, isIBType).TraverseTypeLoc(TL);
257 }
258 
260  const NamedDecl *Parent,
261  const DeclContext *DC) {
262  if (!NNS)
263  return;
264 
265  if (NestedNameSpecifierLoc Prefix = NNS.getPrefix())
266  indexNestedNameSpecifierLoc(Prefix, Parent, DC);
267 
268  if (!DC)
269  DC = Parent->getLexicalDeclContext();
270  SourceLocation Loc = NNS.getLocalBeginLoc();
271 
272  switch (NNS.getNestedNameSpecifier()->getKind()) {
276  break;
277 
280  Loc, Parent, DC, SymbolRoleSet());
281  break;
284  Loc, Parent, DC, SymbolRoleSet());
285  break;
286 
289  indexTypeLoc(NNS.getTypeLoc(), Parent, DC);
290  break;
291  }
292 }
293 
295  ArrayRef<SymbolRelation> Relations) {
296  if (!shouldIndex(D))
297  return;
299  return;
300 
301  if (handleDecl(D, /*Roles=*/SymbolRoleSet(), Relations)) {
302  if (D->isThisDeclarationADefinition()) {
304  if (auto CXXRD = dyn_cast<CXXRecordDecl>(D)) {
305  for (const auto &I : CXXRD->bases()) {
306  indexTypeSourceInfo(I.getTypeSourceInfo(), CXXRD, CXXRD, /*isBase=*/true);
307  }
308  }
309  indexDeclContext(D);
310  }
311  }
312 }
clang::TemplateSpecializationTypeLoc
Definition: TypeLoc.h:1573
clang::index::IndexingContext::shouldIndex
bool shouldIndex(const Decl *D)
Definition: IndexingContext.cpp:28
clang::NestedNameSpecifier::Identifier
@ Identifier
An identifier, stored as an IdentifierInfo*.
Definition: NestedNameSpecifier.h:81
IndexingContext.h
clang::NestedNameSpecifier::Super
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
Definition: NestedNameSpecifier.h:101
clang::index::IndexingContext::indexTypeSourceInfo
void indexTypeSourceInfo(TypeSourceInfo *TInfo, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false, bool isIBType=false)
Definition: IndexTypeSourceInfo.cpp:235
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1347
clang::Decl::getParentFunctionOrMethod
const DeclContext * getParentFunctionOrMethod() const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
Definition: DeclBase.cpp:286
clang::index::IndexingContext::indexTypeLoc
void indexTypeLoc(TypeLoc TL, const NamedDecl *Parent, const DeclContext *DC=nullptr, bool isBase=false, bool isIBType=false)
Definition: IndexTypeSourceInfo.cpp:246
clang::DependentNameType::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5508
clang::index::IndexingContext::indexTagDecl
void indexTagDecl(const TagDecl *D, ArrayRef< SymbolRelation > Relations=None)
Definition: IndexTypeSourceInfo.cpp:294
llvm::SmallVector
Definition: LLVM.h:38
clang::NestedNameSpecifier::NamespaceAlias
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
Definition: NestedNameSpecifier.h:87
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::CXXRecordDecl::getDefinition
CXXRecordDecl * getDefinition() const
Definition: DeclCXX.h:535
clang::TemplateName::getAsTemplateDecl
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known.
Definition: TemplateName.cpp:101
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:50
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1665
clang::TemplateSpecializationType
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5103
clang::TagTypeLoc::isDefinition
bool isDefinition() const
True if the tag was defined in this type specifier.
Definition: TypeLoc.cpp:298
clang::index::IndexingContext::handleReference
bool handleReference(const NamedDecl *D, SourceLocation Loc, const NamedDecl *Parent, const DeclContext *DC, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None, const Expr *RefE=nullptr, const Decl *RefD=nullptr)
Definition: IndexingContext.cpp:74
clang::NestedNameSpecifierLoc::getLocalBeginLoc
SourceLocation getLocalBeginLoc() const
Retrieve the location of the beginning of this component of the nested-name-specifier.
Definition: NestedNameSpecifier.h:311
clang::TypeSpecTypeLoc::getNameLoc
SourceLocation getNameLoc() const
Definition: TypeLoc.h:523
clang::ObjCInterfaceTypeLoc
Wrapper for source info for ObjC interfaces.
Definition: TypeLoc.h:1039
clang::TemplateSpecializationTypeLoc::getArgLoc
TemplateArgumentLoc getArgLoc(unsigned i) const
Definition: TypeLoc.h:1615
clang::ConcreteTypeLoc::getTypePtr
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:409
clang::DeclarationName
The name of a declaration.
Definition: DeclarationName.h:145
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
clang::TRY_TO
TRY_TO(TraverseType(T->getPointeeType()))
clang::index::IndexingContext::indexDeclContext
bool indexDeclContext(const DeclContext *DC)
Definition: IndexDecl.cpp:754
clang::NestedNameSpecifier::Namespace
@ Namespace
A namespace, stored as a NamespaceDecl*.
Definition: NestedNameSpecifier.h:84
clang::TemplateSpecializationTypeLoc::getTemplateNameLoc
SourceLocation getTemplateNameLoc() const
Definition: TypeLoc.h:1619
clang::Type::getAsTagDecl
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
Definition: Type.cpp:1761
clang::TagDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Definition: Decl.h:3555
clang::ObjCObjectTypeLoc::getProtocolLoc
SourceLocation getProtocolLoc(unsigned i) const
Definition: TypeLoc.h:973
clang::index::SymbolRole::Implicit
@ Implicit
clang::DeclaratorDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Definition: Decl.h:794
clang::TagTypeLoc::getDecl
TagDecl * getDecl() const
Definition: TypeLoc.h:710
clang::RecursiveASTVisitor
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Definition: RecursiveASTVisitor.h:164
clang::DependentNameTypeLoc
Definition: TypeLoc.h:2257
clang::Type::getAs
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7162
clang::DependentNameTypeLoc::getNameLoc
SourceLocation getNameLoc() const
Definition: TypeLoc.h:2282
clang::TagDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
Definition: Decl.h:3428
clang::TypedefNameDecl::getUnderlyingType
QualType getUnderlyingType() const
Definition: Decl.h:3235
clang::index::IndexingContext::indexNestedNameSpecifierLoc
void indexNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS, const NamedDecl *Parent, const DeclContext *DC=nullptr)
Definition: IndexTypeSourceInfo.cpp:259
clang::index::SymbolRole::RelationIBTypeOf
@ RelationIBTypeOf
clang::InjectedClassNameTypeLoc
Wrapper for source info for injected class names of class templates.
Definition: TypeLoc.h:680
clang::ObjCObjectTypeLoc::getNumProtocols
unsigned getNumProtocols() const
Definition: TypeLoc.h:969
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3328
clang::NestedNameSpecifier::Global
@ Global
The global specifier '::'. There is no stored value.
Definition: NestedNameSpecifier.h:97
clang::Type::getAsCXXRecordDecl
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Definition: Type.cpp:1753
clang::NestedNameSpecifierLoc
A C++ nested-name-specifier augmented with source location information.
Definition: NestedNameSpecifier.h:243
clang::TypeLoc::isNull
bool isNull() const
Definition: TypeLoc.h:120
clang::index::isFunctionLocalSymbol
bool isFunctionLocalSymbol(const Decl *D)
Definition: IndexSymbol.cpp:53
clang::ObjCInterfaceTypeLoc::getNameLoc
SourceLocation getNameLoc() const
Definition: TypeLoc.h:1048
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1174
clang::NestedNameSpecifier::TypeSpecWithTemplate
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
Definition: NestedNameSpecifier.h:94
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:563
clang::index::IndexingContext
Definition: IndexingContext.h:38
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
clang::NestedNameSpecifier::getAsNamespaceAlias
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:177
clang::index::IndexingContext::shouldIndexImplicitInstantiation
bool shouldIndexImplicitInstantiation() const
Definition: IndexingContext.cpp:40
clang::NestedNameSpecifier::getAsNamespace
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:169
clang::TagTypeLoc
Wrapper for source info for tag types.
Definition: TypeLoc.h:706
clang::index::IndexingContext::shouldIndexFunctionLocalSymbols
bool shouldIndexFunctionLocalSymbols() const
Definition: IndexingContext.cpp:36
clang::ObjCObjectTypeLoc
Definition: TypeLoc.h:907
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2243
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:192
clang::DeducedTemplateSpecializationTypeLoc::getTemplateNameLoc
SourceLocation getTemplateNameLoc() const
Definition: TypeLoc.h:2182
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:399
clang::TemplateSpecializationTypeLoc::getNumArgs
unsigned getNumArgs() const
Definition: TypeLoc.h:1603
llvm::ArrayRef
Definition: LLVM.h:34
clang::TypeLoc
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:58
clang::TypeLoc::getType
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:132
clang::ClassTemplateDecl::getTemplatedDecl
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
Definition: DeclTemplate.h:2291
clang::TemplateTypeParmTypeLoc
Wrapper for template type parameters.
Definition: TypeLoc.h:733
clang::ObjCObjectTypeLoc::getProtocol
ObjCProtocolDecl * getProtocol(unsigned i) const
Definition: TypeLoc.h:983
clang::NestedNameSpecifierLoc::getPrefix
NestedNameSpecifierLoc getPrefix() const
Return the prefix of this nested-name-specifier.
Definition: NestedNameSpecifier.h:327
clang::TemplateTypeParmTypeLoc::getDecl
TemplateTypeParmDecl * getDecl() const
Definition: TypeLoc.h:738
clang::index::SymbolRoleSet
unsigned SymbolRoleSet
Definition: IndexSymbol.h:131
clang::TypedefTypeLoc::getTypedefNameDecl
TypedefNameDecl * getTypedefNameDecl() const
Definition: TypeLoc.h:673
clang::InjectedClassNameTypeLoc::getDecl
CXXRecordDecl * getDecl() const
Definition: TypeLoc.h:685
clang::index::IndexingContext::indexBody
void indexBody(const Stmt *S, const NamedDecl *Parent, const DeclContext *DC=nullptr)
Definition: IndexBody.cpp:479
clang
Definition: CalledOnceCheck.h:17
RecursiveASTVisitor.h
clang::NestedNameSpecifier::getAsType
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
Definition: NestedNameSpecifier.h:196
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:68
clang::NestedNameSpecifierLoc::getNestedNameSpecifier
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Definition: NestedNameSpecifier.h:274
clang::CXXRecordDecl::hasDefinition
bool hasDefinition() const
Definition: DeclCXX.h:542
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6396
unsigned
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3180
clang::DependentNameType
Represents a qualified type name for which the type name is dependent.
Definition: Type.h:5490
clang::InheritingConcreteTypeLoc::getTypePtr
const TypeClass * getTypePtr() const
Definition: TypeLoc.h:502
Parent
NodeId Parent
Definition: ASTDiff.cpp:192
clang::ObjCInterfaceTypeLoc::getIFaceDecl
ObjCInterfaceDecl * getIFaceDecl() const
Definition: TypeLoc.h:1044
clang::NestedNameSpecifier::TypeSpec
@ TypeSpec
A type, stored as a Type*.
Definition: NestedNameSpecifier.h:90
clang::NestedNameSpecifierLoc::getTypeLoc
TypeLoc getTypeLoc() const
For a nested-name-specifier that refers to a type, retrieve the type with source-location information...
Definition: NestedNameSpecifier.cpp:453
clang::index::IndexingContext::handleDecl
bool handleDecl(const Decl *D, SymbolRoleSet Roles=SymbolRoleSet(), ArrayRef< SymbolRelation > Relations=None)
Definition: IndexingContext.cpp:52
clang::CXXRecordDecl::lookupDependentName
std::vector< const NamedDecl * > lookupDependentName(DeclarationName Name, llvm::function_ref< bool(const NamedDecl *ND)> Filter)
Performs an imprecise lookup of a dependent name in this class.
Definition: CXXInheritance.cpp:432
clang::NestedNameSpecifier::getKind
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
Definition: NestedNameSpecifier.cpp:143
clang::DependentNameType::getIdentifier
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
Definition: Type.h:5515
clang::index::SymbolRole::RelationBaseOf
@ RelationBaseOf
clang::DeclaratorDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:757
clang::DeducedTemplateSpecializationTypeLoc
Definition: TypeLoc.h:2177
clang::TypedefNameDecl::isTransparentTag
bool isTransparentTag() const
Determines if this typedef shares a name and spelling location with its underlying tag type,...
Definition: Decl.h:3264
clang::TypeSourceInfo::getTypeLoc
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Definition: TypeLoc.h:244
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:439
clang::TemplateSpecializationType::getTemplateName
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5179
clang::TypedefTypeLoc
Wrapper for source info for typedefs.
Definition: TypeLoc.h:669