Lines Matching refs:D
64 AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx) in AttrListInfo() argument
67 if (!D->hasAttrs()) in AttrListInfo()
70 for (AttrVec::const_iterator AttrI = D->attr_begin(), AttrE = D->attr_end(); in AttrListInfo()
73 CXCursor C = MakeCXCursor(A, const_cast<Decl *>(D), IdxCtx.CXTU); in AttrListInfo()
117 AttrListInfo::create(const Decl *D, IndexingContext &IdxCtx) { in create() argument
120 return new (attrs) AttrListInfo(D, IdxCtx); in create()
123 IndexingContext::CXXBasesListInfo::CXXBasesListInfo(const CXXRecordDecl *D, in CXXBasesListInfo() argument
127 I = D->bases_begin(), E = D->bases_end(); I != E; ++I) { in CXXBasesListInfo()
250 bool IndexingContext::handleDecl(const NamedDecl *D, in handleDecl() argument
254 if (!CB.indexDeclaration || !D) in handleDecl()
256 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleDecl()
260 getEntityInfo(D, DInfo.EntInfo, SA); in handleDecl()
266 LexicalDC = D->getLexicalDeclContext(); in handleDecl()
269 markEntityOccurrenceInFile(D, Loc); in handleDecl()
274 DInfo.isImplicit = D->isImplicit(); in handleDecl()
279 getContainerInfo(D->getDeclContext(), DInfo.SemanticContainer); in handleDecl()
282 if (LexicalDC == D->getDeclContext()) { in handleDecl()
284 } else if (isTemplateImplicitInstantiation(D)) { in handleDecl()
298 getContainerInfo(getEntityContainer(D), DInfo.DeclAsContainer); in handleDecl()
306 bool IndexingContext::handleObjCContainer(const ObjCContainerDecl *D, in handleObjCContainer() argument
310 return handleDecl(D, Loc, Cursor, ContDInfo); in handleObjCContainer()
313 bool IndexingContext::handleFunction(const FunctionDecl *D) { in handleFunction() argument
314 DeclInfo DInfo(!D->isFirstDeclaration(), D->isThisDeclarationADefinition(), in handleFunction()
315 D->isThisDeclarationADefinition()); in handleFunction()
316 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunction()
319 bool IndexingContext::handleVar(const VarDecl *D) { in handleVar() argument
320 DeclInfo DInfo(!D->isFirstDeclaration(), D->isThisDeclarationADefinition(), in handleVar()
322 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleVar()
325 bool IndexingContext::handleField(const FieldDecl *D) { in handleField() argument
328 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleField()
331 bool IndexingContext::handleEnumerator(const EnumConstantDecl *D) { in handleEnumerator() argument
334 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleEnumerator()
337 bool IndexingContext::handleTagDecl(const TagDecl *D) { in handleTagDecl() argument
338 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(D)) in handleTagDecl()
339 return handleCXXRecordDecl(CXXRD, D); in handleTagDecl()
341 DeclInfo DInfo(!D->isFirstDeclaration(), D->isThisDeclarationADefinition(), in handleTagDecl()
342 D->isThisDeclarationADefinition()); in handleTagDecl()
343 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTagDecl()
346 bool IndexingContext::handleTypedefName(const TypedefNameDecl *D) { in handleTypedefName() argument
347 DeclInfo DInfo(!D->isFirstDeclaration(), /*isDefinition=*/true, in handleTypedefName()
349 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypedefName()
352 bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) { in handleObjCInterface() argument
354 if (!D->isThisDeclarationADefinition()) { in handleObjCInterface()
355 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCInterface()
359 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCInterface()
362 return handleObjCContainer(D, D->getLocation(), in handleObjCInterface()
363 MakeCursorObjCClassRef(D, D->getLocation(), in handleObjCInterface()
373 if (ObjCInterfaceDecl *SuperD = D->getSuperClass()) { in handleObjCInterface()
375 SourceLocation SuperLoc = D->getSuperClassLoc(); in handleObjCInterface()
385 ObjCProtocolListInfo ProtInfo(D->isThisDeclarationADefinition() in handleObjCInterface()
386 ? D->getReferencedProtocols() in handleObjCInterface()
390 ObjCInterfaceDeclInfo InterInfo(D); in handleObjCInterface()
393 InterInfo.ObjCInterDeclInfo.superInfo = D->getSuperClass() ? &BaseClass : 0; in handleObjCInterface()
396 return handleObjCContainer(D, D->getLocation(), getCursor(D), InterInfo); in handleObjCInterface()
400 const ObjCImplementationDecl *D) { in handleObjCImplementation() argument
404 return handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo); in handleObjCImplementation()
407 bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) { in handleObjCProtocol() argument
408 if (!D->isThisDeclarationADefinition()) { in handleObjCProtocol()
409 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCProtocol()
413 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCProtocol()
417 return handleObjCContainer(D, D->getLocation(), in handleObjCProtocol()
418 MakeCursorObjCProtocolRef(D, D->getLocation(), in handleObjCProtocol()
425 ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition() in handleObjCProtocol()
426 ? D->getReferencedProtocols() in handleObjCProtocol()
430 ObjCProtocolDeclInfo ProtInfo(D); in handleObjCProtocol()
433 return handleObjCContainer(D, D->getLocation(), getCursor(D), ProtInfo); in handleObjCProtocol()
436 bool IndexingContext::handleObjCCategory(const ObjCCategoryDecl *D) { in handleObjCCategory() argument
441 const ObjCInterfaceDecl *IFaceD = D->getClassInterface(); in handleObjCCategory()
442 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategory()
443 SourceLocation CategoryLoc = D->IsClassExtension() ? ClassLoc in handleObjCCategory()
444 : D->getCategoryNameLoc(); in handleObjCCategory()
450 ObjCProtocolListInfo ProtInfo(D->getReferencedProtocols(), *this, SA); in handleObjCCategory()
465 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategory()
468 bool IndexingContext::handleObjCCategoryImpl(const ObjCCategoryImplDecl *D) { in handleObjCCategoryImpl() argument
471 const ObjCCategoryDecl *CatD = D->getCategoryDecl(); in handleObjCCategoryImpl()
475 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategoryImpl()
476 SourceLocation CategoryLoc = D->getCategoryNameLoc(); in handleObjCCategoryImpl()
494 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategoryImpl()
497 bool IndexingContext::handleObjCMethod(const ObjCMethodDecl *D) { in handleObjCMethod() argument
498 DeclInfo DInfo(!D->isCanonicalDecl(), D->isThisDeclarationADefinition(), in handleObjCMethod()
499 D->isThisDeclarationADefinition()); in handleObjCMethod()
500 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleObjCMethod()
504 const ObjCPropertyImplDecl *D) { in handleSynthesizedObjCProperty() argument
505 ObjCPropertyDecl *PD = D->getPropertyDecl(); in handleSynthesizedObjCProperty()
506 return handleReference(PD, D->getLocation(), getCursor(D), 0, D->getDeclContext()); in handleSynthesizedObjCProperty()
509 bool IndexingContext::handleSynthesizedObjCMethod(const ObjCMethodDecl *D, in handleSynthesizedObjCMethod() argument
514 return handleDecl(D, Loc, getCursor(D), DInfo, LexicalDC); in handleSynthesizedObjCMethod()
517 bool IndexingContext::handleObjCProperty(const ObjCPropertyDecl *D) { in handleObjCProperty() argument
526 if (ObjCMethodDecl *Getter = D->getGetterMethodDecl()) { in handleObjCProperty()
532 if (ObjCMethodDecl *Setter = D->getSetterMethodDecl()) { in handleObjCProperty()
539 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleObjCProperty()
542 bool IndexingContext::handleNamespace(const NamespaceDecl *D) { in handleNamespace() argument
543 DeclInfo DInfo(/*isRedeclaration=*/!D->isOriginalNamespace(), in handleNamespace()
546 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleNamespace()
549 bool IndexingContext::handleClassTemplate(const ClassTemplateDecl *D) { in handleClassTemplate() argument
550 return handleCXXRecordDecl(D->getTemplatedDecl(), D); in handleClassTemplate()
553 bool IndexingContext::handleFunctionTemplate(const FunctionTemplateDecl *D) { in handleFunctionTemplate() argument
554 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleFunctionTemplate()
555 /*isDefinition=*/D->isThisDeclarationADefinition(), in handleFunctionTemplate()
556 /*isContainer=*/D->isThisDeclarationADefinition()); in handleFunctionTemplate()
557 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunctionTemplate()
560 bool IndexingContext::handleTypeAliasTemplate(const TypeAliasTemplateDecl *D) { in handleTypeAliasTemplate() argument
561 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleTypeAliasTemplate()
563 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypeAliasTemplate()
566 bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc, in handleReference() argument
571 if (!D) in handleReference()
576 : getRefCursor(D, Loc); in handleReference()
577 return handleReference(D, Loc, Cursor, Parent, DC, E, Kind); in handleReference()
580 bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc, in handleReference() argument
589 if (!D) in handleReference()
593 if (!shouldIndexFunctionLocalSymbols() && D->getParentFunctionOrMethod()) in handleReference()
595 if (isNotFromSourceFile(D->getLocation())) in handleReference()
597 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleReference()
601 if (markEntityOccurrenceInFile(D, Loc)) in handleReference()
607 getEntityInfo(D, RefEntity, SA); in handleReference()
654 CXIdxClientEntity IndexingContext::getClientEntity(const Decl *D) const { in getClientEntity()
655 if (!D) in getClientEntity()
657 EntityMapTy::const_iterator I = EntityMap.find(D); in getClientEntity()
663 void IndexingContext::setClientEntity(const Decl *D, CXIdxClientEntity client) { in setClientEntity() argument
664 if (!D) in setClientEntity()
666 EntityMap[D] = client; in setClientEntity()
702 bool IndexingContext::markEntityOccurrenceInFile(const NamedDecl *D, in markEntityOccurrenceInFile() argument
704 if (!D || Loc.isInvalid()) in markEntityOccurrenceInFile()
708 D = getEntityDecl(D); in markEntityOccurrenceInFile()
718 RefFileOccurence RefOccur(FE, D); in markEntityOccurrenceInFile()
727 const NamedDecl *IndexingContext::getEntityDecl(const NamedDecl *D) const { in getEntityDecl()
728 assert(D); in getEntityDecl()
729 D = cast<NamedDecl>(D->getCanonicalDecl()); in getEntityDecl()
732 ImplD = dyn_cast<ObjCImplementationDecl>(D)) { in getEntityDecl()
736 CatImplD = dyn_cast<ObjCCategoryImplDecl>(D)) { in getEntityDecl()
738 } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in getEntityDecl()
741 } else if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { in getEntityDecl()
746 return D; in getEntityDecl()
750 IndexingContext::getEntityContainer(const Decl *D) const { in getEntityContainer()
751 const DeclContext *DC = dyn_cast<DeclContext>(D); in getEntityContainer()
755 if (const ClassTemplateDecl *ClassTempl = dyn_cast<ClassTemplateDecl>(D)) { in getEntityContainer()
758 FuncTempl = dyn_cast<FunctionTemplateDecl>(D)) { in getEntityContainer()
828 void IndexingContext::getEntityInfo(const NamedDecl *D, in getEntityInfo() argument
831 if (!D) in getEntityInfo()
834 D = getEntityDecl(D); in getEntityInfo()
835 EntityInfo.cursor = getCursor(D); in getEntityInfo()
836 EntityInfo.Dcl = D; in getEntityInfo()
842 if (D->hasAttrs()) { in getEntityInfo()
843 EntityInfo.AttrList = AttrListInfo::create(D, *this); in getEntityInfo()
848 if (const TagDecl *TD = dyn_cast<TagDecl>(D)) { in getEntityInfo()
866 if (const CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(D)) in getEntityInfo()
870 if (isa<ClassTemplatePartialSpecializationDecl>(D)) { in getEntityInfo()
872 } else if (isa<ClassTemplateSpecializationDecl>(D)) { in getEntityInfo()
877 switch (D->getKind()) { in getEntityInfo()
888 if (isa<CXXRecordDecl>(D->getDeclContext())) { in getEntityInfo()
896 CXXRec = dyn_cast<CXXRecordDecl>(D->getDeclContext())) { in getEntityInfo()
918 if (cast<ObjCMethodDecl>(D)->isInstanceMethod()) in getEntityInfo()
953 const CXXMethodDecl *MD = cast<CXXMethodDecl>(D); in getEntityInfo()
969 cast<FunctionTemplateDecl>(D)->getTemplatedDecl())) { in getEntityInfo()
1000 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in getEntityInfo()
1009 if (IdentifierInfo *II = D->getIdentifier()) { in getEntityInfo()
1012 } else if (isa<TagDecl>(D) || isa<FieldDecl>(D) || isa<NamespaceDecl>(D)) { in getEntityInfo()
1019 D->printName(OS); in getEntityInfo()
1026 bool Ignore = getDeclCursorUSR(D, StrBuf); in getEntityInfo()
1042 CXCursor IndexingContext::getRefCursor(const NamedDecl *D, SourceLocation Loc) { in getRefCursor() argument
1043 if (const TypeDecl *TD = dyn_cast<TypeDecl>(D)) in getRefCursor()
1045 if (const ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D)) in getRefCursor()
1047 if (const ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)) in getRefCursor()
1049 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(D)) in getRefCursor()
1051 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(D)) in getRefCursor()
1053 if (const NamespaceAliasDecl *Namespace = dyn_cast<NamespaceAliasDecl>(D)) in getRefCursor()
1055 if (const FieldDecl *Field = dyn_cast<FieldDecl>(D)) in getRefCursor()
1057 if (const VarDecl *Var = dyn_cast<VarDecl>(D)) in getRefCursor()
1063 bool IndexingContext::shouldIgnoreIfImplicit(const Decl *D) { in shouldIgnoreIfImplicit() argument
1064 if (isa<ObjCInterfaceDecl>(D)) in shouldIgnoreIfImplicit()
1066 if (isa<ObjCCategoryDecl>(D)) in shouldIgnoreIfImplicit()
1068 if (isa<ObjCIvarDecl>(D)) in shouldIgnoreIfImplicit()
1070 if (isa<ObjCMethodDecl>(D)) in shouldIgnoreIfImplicit()
1075 bool IndexingContext::isTemplateImplicitInstantiation(const Decl *D) { in isTemplateImplicitInstantiation() argument
1077 SD = dyn_cast<ClassTemplateSpecializationDecl>(D)) { in isTemplateImplicitInstantiation()
1080 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in isTemplateImplicitInstantiation()