Lines Matching refs:D
27 static bool hasUserDefined(const ObjCMethodDecl *D, in hasUserDefined() argument
29 const ObjCMethodDecl *MD = Container->getMethod(D->getSelector(), in hasUserDefined()
30 D->isInstanceMethod()); in hasUserDefined()
34 void handleDeclarator(const DeclaratorDecl *D, in handleDeclarator() argument
36 if (!Parent) Parent = D; in handleDeclarator()
39 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), Parent); in handleDeclarator()
40 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent); in handleDeclarator()
42 if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) { in handleDeclarator()
44 } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in handleDeclarator()
52 void handleObjCMethod(const ObjCMethodDecl *D) { in handleObjCMethod() argument
53 IndexCtx.handleObjCMethod(D); in handleObjCMethod()
54 if (D->isImplicit()) in handleObjCMethod()
57 IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D); in handleObjCMethod()
58 for (const auto *I : D->params()) in handleObjCMethod()
59 handleDeclarator(I, D); in handleObjCMethod()
61 if (D->isThisDeclarationADefinition()) { in handleObjCMethod()
62 const Stmt *Body = D->getBody(); in handleObjCMethod()
64 IndexCtx.indexBody(Body, D, D); in handleObjCMethod()
69 bool VisitFunctionDecl(const FunctionDecl *D) { in VisitFunctionDecl() argument
70 IndexCtx.handleFunction(D); in VisitFunctionDecl()
71 handleDeclarator(D); in VisitFunctionDecl()
73 if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) { in VisitFunctionDecl()
77 IndexCtx.indexTypeSourceInfo(Init->getTypeSourceInfo(), D); in VisitFunctionDecl()
79 IndexCtx.handleReference(Member, Init->getMemberLocation(), D, D); in VisitFunctionDecl()
80 IndexCtx.indexBody(Init->getInit(), D, D); in VisitFunctionDecl()
85 if (D->isThisDeclarationADefinition()) { in VisitFunctionDecl()
86 const Stmt *Body = D->getBody(); in VisitFunctionDecl()
88 IndexCtx.indexBody(Body, D, D); in VisitFunctionDecl()
94 bool VisitVarDecl(const VarDecl *D) { in VisitVarDecl() argument
95 IndexCtx.handleVar(D); in VisitVarDecl()
96 handleDeclarator(D); in VisitVarDecl()
97 IndexCtx.indexBody(D->getInit(), D); in VisitVarDecl()
101 bool VisitFieldDecl(const FieldDecl *D) { in VisitFieldDecl() argument
102 IndexCtx.handleField(D); in VisitFieldDecl()
103 handleDeclarator(D); in VisitFieldDecl()
104 if (D->isBitField()) in VisitFieldDecl()
105 IndexCtx.indexBody(D->getBitWidth(), D); in VisitFieldDecl()
106 else if (D->hasInClassInitializer()) in VisitFieldDecl()
107 IndexCtx.indexBody(D->getInClassInitializer(), D); in VisitFieldDecl()
111 bool VisitMSPropertyDecl(const MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
112 handleDeclarator(D); in VisitMSPropertyDecl()
116 bool VisitEnumConstantDecl(const EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
117 IndexCtx.handleEnumerator(D); in VisitEnumConstantDecl()
118 IndexCtx.indexBody(D->getInitExpr(), D); in VisitEnumConstantDecl()
122 bool VisitTypedefNameDecl(const TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
123 IndexCtx.handleTypedefName(D); in VisitTypedefNameDecl()
124 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D); in VisitTypedefNameDecl()
128 bool VisitTagDecl(const TagDecl *D) { in VisitTagDecl() argument
130 if (D->isFreeStanding()) in VisitTagDecl()
131 IndexCtx.indexTagDecl(D); in VisitTagDecl()
135 bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
136 IndexCtx.handleObjCInterface(D); in VisitObjCInterfaceDecl()
138 if (D->isThisDeclarationADefinition()) { in VisitObjCInterfaceDecl()
140 IndexCtx.indexDeclContext(D); in VisitObjCInterfaceDecl()
145 bool VisitObjCProtocolDecl(const ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
146 IndexCtx.handleObjCProtocol(D); in VisitObjCProtocolDecl()
148 if (D->isThisDeclarationADefinition()) { in VisitObjCProtocolDecl()
150 IndexCtx.indexDeclContext(D); in VisitObjCProtocolDecl()
155 bool VisitObjCImplementationDecl(const ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
156 const ObjCInterfaceDecl *Class = D->getClassInterface(); in VisitObjCImplementationDecl()
163 IndexCtx.handleObjCImplementation(D); in VisitObjCImplementationDecl()
169 for (const auto *IvarI : D->ivars()) in VisitObjCImplementationDecl()
171 for (const auto *I : D->decls()) { in VisitObjCImplementationDecl()
179 bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
180 IndexCtx.handleObjCCategory(D); in VisitObjCCategoryDecl()
183 IndexCtx.indexDeclContext(D); in VisitObjCCategoryDecl()
187 bool VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
188 const ObjCCategoryDecl *Cat = D->getCategoryDecl(); in VisitObjCCategoryImplDecl()
192 IndexCtx.handleObjCCategoryImpl(D); in VisitObjCCategoryImplDecl()
195 IndexCtx.indexDeclContext(D); in VisitObjCCategoryImplDecl()
199 bool VisitObjCMethodDecl(const ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
202 if (D->isPropertyAccessor()) in VisitObjCMethodDecl()
205 handleObjCMethod(D); in VisitObjCMethodDecl()
209 bool VisitObjCPropertyDecl(const ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
210 if (ObjCMethodDecl *MD = D->getGetterMethodDecl()) in VisitObjCPropertyDecl()
211 if (MD->getLexicalDeclContext() == D->getLexicalDeclContext()) in VisitObjCPropertyDecl()
213 if (ObjCMethodDecl *MD = D->getSetterMethodDecl()) in VisitObjCPropertyDecl()
214 if (MD->getLexicalDeclContext() == D->getLexicalDeclContext()) in VisitObjCPropertyDecl()
216 IndexCtx.handleObjCProperty(D); in VisitObjCPropertyDecl()
217 IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D); in VisitObjCPropertyDecl()
221 bool VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
222 ObjCPropertyDecl *PD = D->getPropertyDecl(); in VisitObjCPropertyImplDecl()
223 IndexCtx.handleSynthesizedObjCProperty(D); in VisitObjCPropertyImplDecl()
225 if (D->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) in VisitObjCPropertyImplDecl()
227 assert(D->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize); in VisitObjCPropertyImplDecl()
229 if (ObjCIvarDecl *IvarD = D->getPropertyIvarDecl()) { in VisitObjCPropertyImplDecl()
231 IndexCtx.handleReference(IvarD, D->getPropertyIvarDeclLoc(), nullptr, in VisitObjCPropertyImplDecl()
232 D->getDeclContext()); in VisitObjCPropertyImplDecl()
237 !hasUserDefined(MD, cast<ObjCImplDecl>(D->getDeclContext()))) in VisitObjCPropertyImplDecl()
238 IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation(), in VisitObjCPropertyImplDecl()
239 D->getLexicalDeclContext()); in VisitObjCPropertyImplDecl()
243 !hasUserDefined(MD, cast<ObjCImplDecl>(D->getDeclContext()))) in VisitObjCPropertyImplDecl()
244 IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation(), in VisitObjCPropertyImplDecl()
245 D->getLexicalDeclContext()); in VisitObjCPropertyImplDecl()
250 bool VisitNamespaceDecl(const NamespaceDecl *D) { in VisitNamespaceDecl() argument
251 IndexCtx.handleNamespace(D); in VisitNamespaceDecl()
252 IndexCtx.indexDeclContext(D); in VisitNamespaceDecl()
256 bool VisitUsingDecl(const UsingDecl *D) { in VisitUsingDecl() argument
260 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D); in VisitUsingDecl()
261 for (const auto *I : D->shadows()) in VisitUsingDecl()
262 IndexCtx.handleReference(I->getUnderlyingDecl(), D->getLocation(), D, in VisitUsingDecl()
263 D->getLexicalDeclContext()); in VisitUsingDecl()
267 bool VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
271 IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D); in VisitUsingDirectiveDecl()
272 IndexCtx.handleReference(D->getNominatedNamespaceAsWritten(), in VisitUsingDirectiveDecl()
273 D->getLocation(), D, D->getLexicalDeclContext()); in VisitUsingDirectiveDecl()
277 bool VisitClassTemplateDecl(const ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
278 IndexCtx.handleClassTemplate(D); in VisitClassTemplateDecl()
279 if (D->isThisDeclarationADefinition()) in VisitClassTemplateDecl()
280 IndexCtx.indexDeclContext(D->getTemplatedDecl()); in VisitClassTemplateDecl()
285 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
288 if (D->isThisDeclarationADefinition() && in VisitClassTemplateSpecializationDecl()
290 !IndexCtx.isTemplateImplicitInstantiation(D))) in VisitClassTemplateSpecializationDecl()
291 IndexCtx.indexTagDecl(D); in VisitClassTemplateSpecializationDecl()
295 bool VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
296 IndexCtx.handleFunctionTemplate(D); in VisitFunctionTemplateDecl()
297 FunctionDecl *FD = D->getTemplatedDecl(); in VisitFunctionTemplateDecl()
298 handleDeclarator(FD, D); in VisitFunctionTemplateDecl()
302 IndexCtx.indexBody(Body, D, FD); in VisitFunctionTemplateDecl()
308 bool VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) { in VisitTypeAliasTemplateDecl() argument
309 IndexCtx.handleTypeAliasTemplate(D); in VisitTypeAliasTemplateDecl()
310 IndexCtx.indexTypeSourceInfo(D->getTemplatedDecl()->getTypeSourceInfo(), D); in VisitTypeAliasTemplateDecl()
314 bool VisitImportDecl(const ImportDecl *D) { in VisitImportDecl() argument
315 IndexCtx.importedModule(D); in VisitImportDecl()
322 void IndexingContext::indexDecl(const Decl *D) { in indexDecl() argument
323 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in indexDecl()
326 bool Handled = IndexingDeclVisitor(*this).Visit(D); in indexDecl()
327 if (!Handled && isa<DeclContext>(D)) in indexDecl()
328 indexDeclContext(cast<DeclContext>(D)); in indexDecl()
336 void IndexingContext::indexTopLevelDecl(const Decl *D) { in indexTopLevelDecl() argument
337 if (isNotFromSourceFile(D->getLocation())) in indexTopLevelDecl()
340 if (isa<ObjCMethodDecl>(D)) in indexTopLevelDecl()
343 indexDecl(D); in indexTopLevelDecl()