Lines Matching refs:D
34 bool VisitFunctionDecl(const FunctionDecl *D) { in VisitFunctionDecl() argument
35 DataConsumer.handleFunction(D); in VisitFunctionDecl()
39 bool VisitVarDecl(const VarDecl *D) { in VisitVarDecl() argument
40 DataConsumer.handleVar(D); in VisitVarDecl()
44 bool VisitFieldDecl(const FieldDecl *D) { in VisitFieldDecl() argument
45 DataConsumer.handleField(D); in VisitFieldDecl()
49 bool VisitMSPropertyDecl(const MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
53 bool VisitEnumConstantDecl(const EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
54 DataConsumer.handleEnumerator(D); in VisitEnumConstantDecl()
58 bool VisitTypedefNameDecl(const TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
59 DataConsumer.handleTypedefName(D); in VisitTypedefNameDecl()
63 bool VisitTagDecl(const TagDecl *D) { in VisitTagDecl() argument
64 DataConsumer.handleTagDecl(D); in VisitTagDecl()
68 bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
69 DataConsumer.handleObjCInterface(D); in VisitObjCInterfaceDecl()
73 bool VisitObjCProtocolDecl(const ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
74 DataConsumer.handleObjCProtocol(D); in VisitObjCProtocolDecl()
78 bool VisitObjCImplementationDecl(const ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
79 DataConsumer.handleObjCImplementation(D); in VisitObjCImplementationDecl()
83 bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
84 DataConsumer.handleObjCCategory(D); in VisitObjCCategoryDecl()
88 bool VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
89 DataConsumer.handleObjCCategoryImpl(D); in VisitObjCCategoryImplDecl()
93 bool VisitObjCMethodDecl(const ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
94 if (isa<ObjCImplDecl>(LexicalDC) && !D->isThisDeclarationADefinition()) in VisitObjCMethodDecl()
95 DataConsumer.handleSynthesizedObjCMethod(D, DeclLoc, LexicalDC); in VisitObjCMethodDecl()
97 DataConsumer.handleObjCMethod(D, DeclLoc); in VisitObjCMethodDecl()
101 bool VisitObjCPropertyDecl(const ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
102 DataConsumer.handleObjCProperty(D); in VisitObjCPropertyDecl()
106 bool VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
107 DataConsumer.handleSynthesizedObjCProperty(D); in VisitObjCPropertyImplDecl()
111 bool VisitNamespaceDecl(const NamespaceDecl *D) { in VisitNamespaceDecl() argument
112 DataConsumer.handleNamespace(D); in VisitNamespaceDecl()
116 bool VisitUsingDecl(const UsingDecl *D) { in VisitUsingDecl() argument
120 bool VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
124 bool VisitClassTemplateDecl(const ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
125 DataConsumer.handleClassTemplate(D); in VisitClassTemplateDecl()
130 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
131 DataConsumer.handleTagDecl(D); in VisitClassTemplateSpecializationDecl()
135 bool VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
136 DataConsumer.handleFunctionTemplate(D); in VisitFunctionTemplateDecl()
140 bool VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) { in VisitTypeAliasTemplateDecl() argument
141 DataConsumer.handleTypeAliasTemplate(D); in VisitTypeAliasTemplateDecl()
145 bool VisitImportDecl(const ImportDecl *D) { in VisitImportDecl() argument
146 DataConsumer.importedModule(D); in VisitImportDecl()
150 bool VisitConceptDecl(const ConceptDecl *D) { in VisitConceptDecl() argument
151 DataConsumer.handleConcept(D); in VisitConceptDecl()
163 const Decl *D, SymbolRoleSet Roles, ArrayRef<SymbolRelation> Relations, in handleDeclOccurrence() argument
168 const NamedDecl *ND = dyn_cast<NamedDecl>(D); in handleDeclOccurrence()
284 AttrListInfo::AttrListInfo(const Decl *D, CXIndexDataConsumer &IdxCtx) in AttrListInfo() argument
287 if (!D->hasAttrs()) in AttrListInfo()
290 for (const auto *A : D->attrs()) { in AttrListInfo()
291 CXCursor C = MakeCXCursor(A, D, IdxCtx.CXTU); in AttrListInfo()
337 AttrListInfo::create(const Decl *D, CXIndexDataConsumer &IdxCtx) { in create() argument
340 return new (attrs) AttrListInfo(D, IdxCtx); in create()
343 CXIndexDataConsumer::CXXBasesListInfo::CXXBasesListInfo(const CXXRecordDecl *D, in CXXBasesListInfo() argument
346 for (const auto &Base : D->bases()) { in CXXBasesListInfo()
425 bool CXIndexDataConsumer::isFunctionLocalDecl(const Decl *D) { in isFunctionLocalDecl() argument
426 assert(D); in isFunctionLocalDecl()
428 if (!D->getParentFunctionOrMethod()) in isFunctionLocalDecl()
431 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) { in isFunctionLocalDecl()
548 bool CXIndexDataConsumer::handleDecl(const NamedDecl *D, in handleDecl() argument
553 if (!CB.indexDeclaration || !D) in handleDecl()
555 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleDecl()
559 getEntityInfo(D, DInfo.EntInfo, SA); in handleDecl()
565 LexicalDC = D->getLexicalDeclContext(); in handleDecl()
568 markEntityOccurrenceInFile(D, Loc); in handleDecl()
573 DInfo.isImplicit = D->isImplicit(); in handleDecl()
579 SemaDC = D->getDeclContext(); in handleDecl()
585 } else if (isTemplateImplicitInstantiation(D)) { in handleDecl()
599 getContainerInfo(getEntityContainer(D), DInfo.DeclAsContainer); in handleDecl()
607 bool CXIndexDataConsumer::handleObjCContainer(const ObjCContainerDecl *D, in handleObjCContainer() argument
611 return handleDecl(D, Loc, Cursor, ContDInfo); in handleObjCContainer()
614 bool CXIndexDataConsumer::handleFunction(const FunctionDecl *D) { in handleFunction() argument
615 bool isDef = D->isThisDeclarationADefinition(); in handleFunction()
618 if (D->hasSkippedBody()) { in handleFunction()
624 DeclInfo DInfo(!D->isFirstDecl(), isDef, isContainer); in handleFunction()
627 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunction()
630 bool CXIndexDataConsumer::handleVar(const VarDecl *D) { in handleVar() argument
631 DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(), in handleVar()
633 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleVar()
636 bool CXIndexDataConsumer::handleField(const FieldDecl *D) { in handleField() argument
639 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleField()
642 bool CXIndexDataConsumer::handleEnumerator(const EnumConstantDecl *D) { in handleEnumerator() argument
645 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleEnumerator()
648 bool CXIndexDataConsumer::handleTagDecl(const TagDecl *D) { in handleTagDecl() argument
649 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(D)) in handleTagDecl()
650 return handleCXXRecordDecl(CXXRD, D); in handleTagDecl()
652 DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(), in handleTagDecl()
653 D->isThisDeclarationADefinition()); in handleTagDecl()
654 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTagDecl()
657 bool CXIndexDataConsumer::handleTypedefName(const TypedefNameDecl *D) { in handleTypedefName() argument
658 DeclInfo DInfo(!D->isFirstDecl(), /*isDefinition=*/true, in handleTypedefName()
660 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypedefName()
663 bool CXIndexDataConsumer::handleObjCInterface(const ObjCInterfaceDecl *D) { in handleObjCInterface() argument
665 if (!D->isThisDeclarationADefinition()) { in handleObjCInterface()
666 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCInterface()
670 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCInterface()
673 return handleObjCContainer(D, D->getLocation(), in handleObjCInterface()
674 MakeCursorObjCClassRef(D, D->getLocation(), in handleObjCInterface()
684 if (ObjCInterfaceDecl *SuperD = D->getSuperClass()) { in handleObjCInterface()
686 SourceLocation SuperLoc = D->getSuperClassLoc(); in handleObjCInterface()
696 ObjCProtocolListInfo ProtInfo(D->isThisDeclarationADefinition() in handleObjCInterface()
697 ? D->getReferencedProtocols() in handleObjCInterface()
701 ObjCInterfaceDeclInfo InterInfo(D); in handleObjCInterface()
704 InterInfo.ObjCInterDeclInfo.superInfo = D->getSuperClass() ? &BaseClass in handleObjCInterface()
708 return handleObjCContainer(D, D->getLocation(), getCursor(D), InterInfo); in handleObjCInterface()
712 const ObjCImplementationDecl *D) { in handleObjCImplementation() argument
716 return handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo); in handleObjCImplementation()
719 bool CXIndexDataConsumer::handleObjCProtocol(const ObjCProtocolDecl *D) { in handleObjCProtocol() argument
720 if (!D->isThisDeclarationADefinition()) { in handleObjCProtocol()
721 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCProtocol()
725 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCProtocol()
729 return handleObjCContainer(D, D->getLocation(), in handleObjCProtocol()
730 MakeCursorObjCProtocolRef(D, D->getLocation(), in handleObjCProtocol()
737 ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition() in handleObjCProtocol()
738 ? D->getReferencedProtocols() in handleObjCProtocol()
742 ObjCProtocolDeclInfo ProtInfo(D); in handleObjCProtocol()
745 return handleObjCContainer(D, D->getLocation(), getCursor(D), ProtInfo); in handleObjCProtocol()
748 bool CXIndexDataConsumer::handleObjCCategory(const ObjCCategoryDecl *D) { in handleObjCCategory() argument
753 const ObjCInterfaceDecl *IFaceD = D->getClassInterface(); in handleObjCCategory()
754 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategory()
755 SourceLocation CategoryLoc = D->IsClassExtension() ? ClassLoc in handleObjCCategory()
756 : D->getCategoryNameLoc(); in handleObjCCategory()
762 ObjCProtocolListInfo ProtInfo(D->getReferencedProtocols(), *this, SA); in handleObjCCategory()
777 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategory()
780 bool CXIndexDataConsumer::handleObjCCategoryImpl(const ObjCCategoryImplDecl *D) { in handleObjCCategoryImpl() argument
783 const ObjCCategoryDecl *CatD = D->getCategoryDecl(); in handleObjCCategoryImpl()
787 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategoryImpl()
788 SourceLocation CategoryLoc = D->getCategoryNameLoc(); in handleObjCCategoryImpl()
806 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategoryImpl()
809 bool CXIndexDataConsumer::handleObjCMethod(const ObjCMethodDecl *D, in handleObjCMethod() argument
811 bool isDef = D->isThisDeclarationADefinition(); in handleObjCMethod()
814 if (D->hasSkippedBody()) { in handleObjCMethod()
820 DeclInfo DInfo(!D->isCanonicalDecl(), isDef, isContainer); in handleObjCMethod()
823 return handleDecl(D, Loc, getCursor(D), DInfo); in handleObjCMethod()
827 const ObjCPropertyImplDecl *D) { in handleSynthesizedObjCProperty() argument
828 ObjCPropertyDecl *PD = D->getPropertyDecl(); in handleSynthesizedObjCProperty()
829 auto *DC = D->getDeclContext(); in handleSynthesizedObjCProperty()
830 return handleReference(PD, D->getLocation(), getCursor(D), in handleSynthesizedObjCProperty()
834 bool CXIndexDataConsumer::handleSynthesizedObjCMethod(const ObjCMethodDecl *D, in handleSynthesizedObjCMethod() argument
839 return handleDecl(D, Loc, getCursor(D), DInfo, LexicalDC, D->getDeclContext()); in handleSynthesizedObjCMethod()
842 bool CXIndexDataConsumer::handleObjCProperty(const ObjCPropertyDecl *D) { in handleObjCProperty() argument
851 if (ObjCMethodDecl *Getter = D->getGetterMethodDecl()) { in handleObjCProperty()
857 if (ObjCMethodDecl *Setter = D->getSetterMethodDecl()) { in handleObjCProperty()
864 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleObjCProperty()
867 bool CXIndexDataConsumer::handleNamespace(const NamespaceDecl *D) { in handleNamespace() argument
868 DeclInfo DInfo(/*isRedeclaration=*/!D->isOriginalNamespace(), in handleNamespace()
871 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleNamespace()
874 bool CXIndexDataConsumer::handleClassTemplate(const ClassTemplateDecl *D) { in handleClassTemplate() argument
875 return handleCXXRecordDecl(D->getTemplatedDecl(), D); in handleClassTemplate()
878 bool CXIndexDataConsumer::handleFunctionTemplate(const FunctionTemplateDecl *D) { in handleFunctionTemplate() argument
879 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleFunctionTemplate()
880 /*isDefinition=*/D->isThisDeclarationADefinition(), in handleFunctionTemplate()
881 /*isContainer=*/D->isThisDeclarationADefinition()); in handleFunctionTemplate()
882 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunctionTemplate()
885 bool CXIndexDataConsumer::handleTypeAliasTemplate(const TypeAliasTemplateDecl *D) { in handleTypeAliasTemplate() argument
886 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleTypeAliasTemplate()
888 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypeAliasTemplate()
891 bool CXIndexDataConsumer::handleConcept(const ConceptDecl *D) { in handleConcept() argument
892 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleConcept()
894 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleConcept()
897 bool CXIndexDataConsumer::handleReference(const NamedDecl *D, SourceLocation Loc, in handleReference() argument
907 if (!D || !DC) in handleReference()
911 if (!shouldIndexFunctionLocalSymbols() && isFunctionLocalDecl(D)) in handleReference()
913 if (isNotFromSourceFile(D->getLocation())) in handleReference()
915 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleReference()
919 if (markEntityOccurrenceInFile(D, Loc)) in handleReference()
925 getEntityInfo(D, RefEntity, SA); in handleReference()
973 CXIdxClientEntity CXIndexDataConsumer::getClientEntity(const Decl *D) const { in getClientEntity()
974 if (!D) in getClientEntity()
976 EntityMapTy::const_iterator I = EntityMap.find(D); in getClientEntity()
982 void CXIndexDataConsumer::setClientEntity(const Decl *D, CXIdxClientEntity client) { in setClientEntity() argument
983 if (!D) in setClientEntity()
985 EntityMap[D] = client; in setClientEntity()
1021 bool CXIndexDataConsumer::markEntityOccurrenceInFile(const NamedDecl *D, in markEntityOccurrenceInFile() argument
1023 if (!D || Loc.isInvalid()) in markEntityOccurrenceInFile()
1027 D = getEntityDecl(D); in markEntityOccurrenceInFile()
1037 RefFileOccurrence RefOccur(FE, D); in markEntityOccurrenceInFile()
1043 const NamedDecl *CXIndexDataConsumer::getEntityDecl(const NamedDecl *D) const { in getEntityDecl()
1044 assert(D); in getEntityDecl()
1045 D = cast<NamedDecl>(D->getCanonicalDecl()); in getEntityDecl()
1048 ImplD = dyn_cast<ObjCImplementationDecl>(D)) { in getEntityDecl()
1052 CatImplD = dyn_cast<ObjCCategoryImplDecl>(D)) { in getEntityDecl()
1054 } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in getEntityDecl()
1057 } else if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { in getEntityDecl()
1062 return D; in getEntityDecl()
1066 CXIndexDataConsumer::getEntityContainer(const Decl *D) const { in getEntityContainer()
1067 const DeclContext *DC = dyn_cast<DeclContext>(D); in getEntityContainer()
1071 if (const ClassTemplateDecl *ClassTempl = dyn_cast<ClassTemplateDecl>(D)) { in getEntityContainer()
1074 FuncTempl = dyn_cast<FunctionTemplateDecl>(D)) { in getEntityContainer()
1149 void CXIndexDataConsumer::getEntityInfo(const NamedDecl *D, in getEntityInfo() argument
1152 if (!D) in getEntityInfo()
1155 D = getEntityDecl(D); in getEntityInfo()
1156 EntityInfo.cursor = getCursor(D); in getEntityInfo()
1157 EntityInfo.Dcl = D; in getEntityInfo()
1160 SymbolInfo SymInfo = getSymbolInfo(D); in getEntityInfo()
1165 if (D->hasAttrs()) { in getEntityInfo()
1166 EntityInfo.AttrList = AttrListInfo::create(D, *this); in getEntityInfo()
1174 if (IdentifierInfo *II = D->getIdentifier()) { in getEntityInfo()
1177 } else if (isa<TagDecl>(D) || isa<FieldDecl>(D) || isa<NamespaceDecl>(D)) { in getEntityInfo()
1184 D->printName(OS); in getEntityInfo()
1191 bool Ignore = getDeclCursorUSR(D, StrBuf); in getEntityInfo()
1207 CXCursor CXIndexDataConsumer::getRefCursor(const NamedDecl *D, SourceLocation Loc) { in getRefCursor() argument
1208 if (const TypeDecl *TD = dyn_cast<TypeDecl>(D)) in getRefCursor()
1210 if (const ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D)) in getRefCursor()
1212 if (const ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)) in getRefCursor()
1214 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(D)) in getRefCursor()
1216 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(D)) in getRefCursor()
1218 if (const NamespaceAliasDecl *Namespace = dyn_cast<NamespaceAliasDecl>(D)) in getRefCursor()
1220 if (const FieldDecl *Field = dyn_cast<FieldDecl>(D)) in getRefCursor()
1222 if (const VarDecl *Var = dyn_cast<VarDecl>(D)) in getRefCursor()
1228 bool CXIndexDataConsumer::shouldIgnoreIfImplicit(const Decl *D) { in shouldIgnoreIfImplicit() argument
1229 if (isa<ObjCInterfaceDecl>(D)) in shouldIgnoreIfImplicit()
1231 if (isa<ObjCCategoryDecl>(D)) in shouldIgnoreIfImplicit()
1233 if (isa<ObjCIvarDecl>(D)) in shouldIgnoreIfImplicit()
1235 if (isa<ObjCMethodDecl>(D)) in shouldIgnoreIfImplicit()
1237 if (isa<ImportDecl>(D)) in shouldIgnoreIfImplicit()
1242 bool CXIndexDataConsumer::isTemplateImplicitInstantiation(const Decl *D) { in isTemplateImplicitInstantiation() argument
1244 SD = dyn_cast<ClassTemplateSpecializationDecl>(D)) { in isTemplateImplicitInstantiation()
1247 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in isTemplateImplicitInstantiation()