• Home
  • Raw
  • Download

Lines Matching refs:D

34   bool VisitDecl(const Decl *D) {  in VisitDecl()  argument
41 static bool hasUserDefined(const ObjCMethodDecl *D, in hasUserDefined() argument
43 const ObjCMethodDecl *MD = Container->getMethod(D->getSelector(), in hasUserDefined()
44 D->isInstanceMethod()); in hasUserDefined()
48 void handleDeclarator(const DeclaratorDecl *D, in handleDeclarator() argument
50 if (!Parent) Parent = D; in handleDeclarator()
52 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), Parent); in handleDeclarator()
53 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent); in handleDeclarator()
57 if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) { in handleDeclarator()
68 } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in handleDeclarator()
78 bool handleObjCMethod(const ObjCMethodDecl *D) { in handleObjCMethod() argument
79 if (!IndexCtx.handleDecl(D, (unsigned)SymbolRole::Dynamic)) in handleObjCMethod()
81 IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D); in handleObjCMethod()
82 for (const auto *I : D->parameters()) in handleObjCMethod()
83 handleDeclarator(I, D); in handleObjCMethod()
85 if (D->isThisDeclarationADefinition()) { in handleObjCMethod()
86 const Stmt *Body = D->getBody(); in handleObjCMethod()
88 IndexCtx.indexBody(Body, D, D); in handleObjCMethod()
94 bool VisitFunctionDecl(const FunctionDecl *D) { in VisitFunctionDecl() argument
95 if (D->isDeleted()) in VisitFunctionDecl()
100 if (auto *CXXMD = dyn_cast<CXXMethodDecl>(D)) { in VisitFunctionDecl()
109 if (!IndexCtx.handleDecl(D, Roles, Relations)) in VisitFunctionDecl()
111 handleDeclarator(D); in VisitFunctionDecl()
113 if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) { in VisitFunctionDecl()
117 IndexCtx.indexTypeSourceInfo(Init->getTypeSourceInfo(), D); in VisitFunctionDecl()
119 IndexCtx.handleReference(Member, Init->getMemberLocation(), D, D, in VisitFunctionDecl()
121 IndexCtx.indexBody(Init->getInit(), D, D); in VisitFunctionDecl()
126 if (D->isThisDeclarationADefinition()) { in VisitFunctionDecl()
127 const Stmt *Body = D->getBody(); in VisitFunctionDecl()
129 IndexCtx.indexBody(Body, D, D); in VisitFunctionDecl()
135 bool VisitVarDecl(const VarDecl *D) { in VisitVarDecl() argument
136 if (!IndexCtx.handleDecl(D)) in VisitVarDecl()
138 handleDeclarator(D); in VisitVarDecl()
139 IndexCtx.indexBody(D->getInit(), D); in VisitVarDecl()
143 bool VisitFieldDecl(const FieldDecl *D) { in VisitFieldDecl() argument
144 if (!IndexCtx.handleDecl(D)) in VisitFieldDecl()
146 handleDeclarator(D); in VisitFieldDecl()
147 if (D->isBitField()) in VisitFieldDecl()
148 IndexCtx.indexBody(D->getBitWidth(), D); in VisitFieldDecl()
149 else if (D->hasInClassInitializer()) in VisitFieldDecl()
150 IndexCtx.indexBody(D->getInClassInitializer(), D); in VisitFieldDecl()
154 bool VisitObjCIvarDecl(const ObjCIvarDecl *D) { in VisitObjCIvarDecl() argument
155 if (D->getSynthesize()) { in VisitObjCIvarDecl()
161 return IndexCtx.handleDecl(D, in VisitObjCIvarDecl()
162 cast<Decl>(D->getDeclContext())->getLocation(), in VisitObjCIvarDecl()
165 if (!IndexCtx.handleDecl(D)) in VisitObjCIvarDecl()
167 handleDeclarator(D); in VisitObjCIvarDecl()
171 bool VisitMSPropertyDecl(const MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
172 handleDeclarator(D); in VisitMSPropertyDecl()
176 bool VisitEnumConstantDecl(const EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
177 if (!IndexCtx.handleDecl(D)) in VisitEnumConstantDecl()
179 IndexCtx.indexBody(D->getInitExpr(), D); in VisitEnumConstantDecl()
183 bool VisitTypedefNameDecl(const TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
184 if (!IndexCtx.handleDecl(D)) in VisitTypedefNameDecl()
186 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D); in VisitTypedefNameDecl()
190 bool VisitTagDecl(const TagDecl *D) { in VisitTagDecl() argument
192 if (D->isFreeStanding()) { in VisitTagDecl()
193 if (D->isThisDeclarationADefinition()) { in VisitTagDecl()
194 IndexCtx.indexTagDecl(D); in VisitTagDecl()
196 auto *Parent = dyn_cast<NamedDecl>(D->getDeclContext()); in VisitTagDecl()
197 return IndexCtx.handleReference(D, D->getLocation(), Parent, in VisitTagDecl()
198 D->getLexicalDeclContext(), in VisitTagDecl()
219 bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
220 if (D->isThisDeclarationADefinition()) { in VisitObjCInterfaceDecl()
221 TRY_TO(IndexCtx.handleDecl(D)); in VisitObjCInterfaceDecl()
222 if (auto *SuperD = D->getSuperClass()) { in VisitObjCInterfaceDecl()
223 TRY_TO(IndexCtx.handleReference(SuperD, D->getSuperClassLoc(), D, D, in VisitObjCInterfaceDecl()
225 SymbolRelation{(unsigned)SymbolRole::RelationBaseOf, D})); in VisitObjCInterfaceDecl()
227 TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D)); in VisitObjCInterfaceDecl()
228 TRY_TO(IndexCtx.indexDeclContext(D)); in VisitObjCInterfaceDecl()
230 return IndexCtx.handleReference(D, D->getLocation(), nullptr, in VisitObjCInterfaceDecl()
231 D->getDeclContext(), SymbolRoleSet()); in VisitObjCInterfaceDecl()
236 bool VisitObjCProtocolDecl(const ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
237 if (D->isThisDeclarationADefinition()) { in VisitObjCProtocolDecl()
238 TRY_TO(IndexCtx.handleDecl(D)); in VisitObjCProtocolDecl()
239 TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D)); in VisitObjCProtocolDecl()
240 TRY_TO(IndexCtx.indexDeclContext(D)); in VisitObjCProtocolDecl()
242 return IndexCtx.handleReference(D, D->getLocation(), nullptr, in VisitObjCProtocolDecl()
243 D->getDeclContext(), SymbolRoleSet()); in VisitObjCProtocolDecl()
248 bool VisitObjCImplementationDecl(const ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
249 const ObjCInterfaceDecl *Class = D->getClassInterface(); in VisitObjCImplementationDecl()
256 if (!IndexCtx.handleDecl(D)) in VisitObjCImplementationDecl()
261 for (const auto *IvarI : D->ivars()) in VisitObjCImplementationDecl()
263 for (const auto *I : D->decls()) { in VisitObjCImplementationDecl()
271 bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
272 if (!IndexCtx.handleDecl(D)) in VisitObjCCategoryDecl()
274 IndexCtx.indexDeclContext(D); in VisitObjCCategoryDecl()
278 bool VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
279 const ObjCCategoryDecl *Cat = D->getCategoryDecl(); in VisitObjCCategoryImplDecl()
283 if (!IndexCtx.handleDecl(D)) in VisitObjCCategoryImplDecl()
285 IndexCtx.indexDeclContext(D); in VisitObjCCategoryImplDecl()
289 bool VisitObjCMethodDecl(const ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
292 if (D->isPropertyAccessor()) in VisitObjCMethodDecl()
295 handleObjCMethod(D); in VisitObjCMethodDecl()
299 bool VisitObjCPropertyDecl(const ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
300 if (ObjCMethodDecl *MD = D->getGetterMethodDecl()) in VisitObjCPropertyDecl()
301 if (MD->getLexicalDeclContext() == D->getLexicalDeclContext()) in VisitObjCPropertyDecl()
303 if (ObjCMethodDecl *MD = D->getSetterMethodDecl()) in VisitObjCPropertyDecl()
304 if (MD->getLexicalDeclContext() == D->getLexicalDeclContext()) in VisitObjCPropertyDecl()
306 if (!IndexCtx.handleDecl(D)) in VisitObjCPropertyDecl()
308 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D); in VisitObjCPropertyDecl()
312 bool VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
313 ObjCPropertyDecl *PD = D->getPropertyDecl(); in VisitObjCPropertyImplDecl()
314 if (!IndexCtx.handleReference(PD, D->getLocation(), in VisitObjCPropertyImplDecl()
315 /*Parent=*/cast<NamedDecl>(D->getDeclContext()), in VisitObjCPropertyImplDecl()
316 D->getDeclContext(), SymbolRoleSet(), {}, in VisitObjCPropertyImplDecl()
317 /*RefE=*/nullptr, D)) in VisitObjCPropertyImplDecl()
320 if (D->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) in VisitObjCPropertyImplDecl()
322 assert(D->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize); in VisitObjCPropertyImplDecl()
324 if (ObjCIvarDecl *IvarD = D->getPropertyIvarDecl()) { in VisitObjCPropertyImplDecl()
326 IndexCtx.handleReference(IvarD, D->getPropertyIvarDeclLoc(), nullptr, in VisitObjCPropertyImplDecl()
327 D->getDeclContext(), SymbolRoleSet()); in VisitObjCPropertyImplDecl()
330 auto *ImplD = cast<ObjCImplDecl>(D->getDeclContext()); in VisitObjCPropertyImplDecl()
334 IndexCtx.handleDecl(MD, D->getLocation(), SymbolRoleSet(), {}, ImplD); in VisitObjCPropertyImplDecl()
339 IndexCtx.handleDecl(MD, D->getLocation(), SymbolRoleSet(), {}, ImplD); in VisitObjCPropertyImplDecl()
344 bool VisitNamespaceDecl(const NamespaceDecl *D) { in VisitNamespaceDecl() argument
345 if (!IndexCtx.handleDecl(D)) in VisitNamespaceDecl()
347 IndexCtx.indexDeclContext(D); in VisitNamespaceDecl()
351 bool VisitUsingDecl(const UsingDecl *D) { in VisitUsingDecl() argument
352 const DeclContext *DC = D->getDeclContext()->getRedeclContext(); in VisitUsingDecl()
355 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent, in VisitUsingDecl()
356 D->getLexicalDeclContext()); in VisitUsingDecl()
357 for (const auto *I : D->shadows()) in VisitUsingDecl()
358 IndexCtx.handleReference(I->getUnderlyingDecl(), D->getLocation(), Parent, in VisitUsingDecl()
359 D->getLexicalDeclContext(), SymbolRoleSet()); in VisitUsingDecl()
363 bool VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
364 const DeclContext *DC = D->getDeclContext()->getRedeclContext(); in VisitUsingDirectiveDecl()
367 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent, in VisitUsingDirectiveDecl()
368 D->getLexicalDeclContext()); in VisitUsingDirectiveDecl()
369 return IndexCtx.handleReference(D->getNominatedNamespaceAsWritten(), in VisitUsingDirectiveDecl()
370 D->getLocation(), Parent, in VisitUsingDirectiveDecl()
371 D->getLexicalDeclContext(), in VisitUsingDirectiveDecl()
376 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
379 if (D->isThisDeclarationADefinition()) in VisitClassTemplateSpecializationDecl()
380 IndexCtx.indexTagDecl(D); in VisitClassTemplateSpecializationDecl()
384 bool VisitTemplateDecl(const TemplateDecl *D) { in VisitTemplateDecl() argument
386 return Visit(D->getTemplatedDecl()); in VisitTemplateDecl()
389 bool VisitFriendDecl(const FriendDecl *D) { in VisitFriendDecl() argument
390 if (auto ND = D->getFriendDecl()) { in VisitFriendDecl()
397 if (isa<ClassTemplateDecl>(ND) && D->getDeclContext()->isDependentContext()) in VisitFriendDecl()
401 if (auto Ty = D->getFriendType()) { in VisitFriendDecl()
402 IndexCtx.indexTypeSourceInfo(Ty, cast<NamedDecl>(D->getDeclContext())); in VisitFriendDecl()
407 bool VisitImportDecl(const ImportDecl *D) { in VisitImportDecl() argument
408 return IndexCtx.importedModule(D); in VisitImportDecl()
414 bool IndexingContext::indexDecl(const Decl *D) { in indexDecl() argument
415 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in indexDecl()
418 if (isTemplateImplicitInstantiation(D)) in indexDecl()
422 bool ShouldContinue = Visitor.Visit(D); in indexDecl()
426 if (!Visitor.Handled && isa<DeclContext>(D)) in indexDecl()
427 return indexDeclContext(cast<DeclContext>(D)); in indexDecl()
439 bool IndexingContext::indexTopLevelDecl(const Decl *D) { in indexTopLevelDecl() argument
440 if (D->getLocation().isInvalid()) in indexTopLevelDecl()
443 if (isa<ObjCMethodDecl>(D)) in indexTopLevelDecl()
446 return indexDecl(D); in indexTopLevelDecl()