Lines Matching refs:D
35 bool VisitFunctionDecl(const FunctionDecl *D) { in VisitFunctionDecl() argument
36 DataConsumer.handleFunction(D); in VisitFunctionDecl()
40 bool VisitVarDecl(const VarDecl *D) { in VisitVarDecl() argument
41 DataConsumer.handleVar(D); in VisitVarDecl()
45 bool VisitFieldDecl(const FieldDecl *D) { in VisitFieldDecl() argument
46 DataConsumer.handleField(D); in VisitFieldDecl()
50 bool VisitMSPropertyDecl(const MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
54 bool VisitEnumConstantDecl(const EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
55 DataConsumer.handleEnumerator(D); in VisitEnumConstantDecl()
59 bool VisitTypedefNameDecl(const TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
60 DataConsumer.handleTypedefName(D); in VisitTypedefNameDecl()
64 bool VisitTagDecl(const TagDecl *D) { in VisitTagDecl() argument
65 DataConsumer.handleTagDecl(D); in VisitTagDecl()
69 bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
70 DataConsumer.handleObjCInterface(D); in VisitObjCInterfaceDecl()
74 bool VisitObjCProtocolDecl(const ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
75 DataConsumer.handleObjCProtocol(D); in VisitObjCProtocolDecl()
79 bool VisitObjCImplementationDecl(const ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
80 DataConsumer.handleObjCImplementation(D); in VisitObjCImplementationDecl()
84 bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
85 DataConsumer.handleObjCCategory(D); in VisitObjCCategoryDecl()
89 bool VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
90 DataConsumer.handleObjCCategoryImpl(D); in VisitObjCCategoryImplDecl()
94 bool VisitObjCMethodDecl(const ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
95 if (isa<ObjCImplDecl>(LexicalDC) && !D->isThisDeclarationADefinition()) in VisitObjCMethodDecl()
96 DataConsumer.handleSynthesizedObjCMethod(D, DeclLoc, LexicalDC); in VisitObjCMethodDecl()
98 DataConsumer.handleObjCMethod(D); in VisitObjCMethodDecl()
102 bool VisitObjCPropertyDecl(const ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
103 DataConsumer.handleObjCProperty(D); in VisitObjCPropertyDecl()
107 bool VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
108 DataConsumer.handleSynthesizedObjCProperty(D); in VisitObjCPropertyImplDecl()
112 bool VisitNamespaceDecl(const NamespaceDecl *D) { in VisitNamespaceDecl() argument
113 DataConsumer.handleNamespace(D); in VisitNamespaceDecl()
117 bool VisitUsingDecl(const UsingDecl *D) { in VisitUsingDecl() argument
121 bool VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
125 bool VisitClassTemplateDecl(const ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
126 DataConsumer.handleClassTemplate(D); in VisitClassTemplateDecl()
131 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
132 DataConsumer.handleTagDecl(D); in VisitClassTemplateSpecializationDecl()
136 bool VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
137 DataConsumer.handleFunctionTemplate(D); in VisitFunctionTemplateDecl()
141 bool VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) { in VisitTypeAliasTemplateDecl() argument
142 DataConsumer.handleTypeAliasTemplate(D); in VisitTypeAliasTemplateDecl()
146 bool VisitImportDecl(const ImportDecl *D) { in VisitImportDecl() argument
147 DataConsumer.importedModule(D); in VisitImportDecl()
153 bool CXIndexDataConsumer::handleDeclOccurence(const Decl *D, in handleDeclOccurence() argument
162 const NamedDecl *ND = dyn_cast<NamedDecl>(D); in handleDeclOccurence()
276 AttrListInfo::AttrListInfo(const Decl *D, CXIndexDataConsumer &IdxCtx) in AttrListInfo() argument
279 if (!D->hasAttrs()) in AttrListInfo()
282 for (const auto *A : D->attrs()) { in AttrListInfo()
283 CXCursor C = MakeCXCursor(A, D, IdxCtx.CXTU); in AttrListInfo()
329 AttrListInfo::create(const Decl *D, CXIndexDataConsumer &IdxCtx) { in create() argument
332 return new (attrs) AttrListInfo(D, IdxCtx); in create()
335 CXIndexDataConsumer::CXXBasesListInfo::CXXBasesListInfo(const CXXRecordDecl *D, in CXXBasesListInfo() argument
338 for (const auto &Base : D->bases()) { in CXXBasesListInfo()
417 bool CXIndexDataConsumer::isFunctionLocalDecl(const Decl *D) { in isFunctionLocalDecl() argument
418 assert(D); in isFunctionLocalDecl()
420 if (!D->getParentFunctionOrMethod()) in isFunctionLocalDecl()
423 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) { in isFunctionLocalDecl()
529 bool CXIndexDataConsumer::handleDecl(const NamedDecl *D, in handleDecl() argument
534 if (!CB.indexDeclaration || !D) in handleDecl()
536 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleDecl()
540 getEntityInfo(D, DInfo.EntInfo, SA); in handleDecl()
546 LexicalDC = D->getLexicalDeclContext(); in handleDecl()
549 markEntityOccurrenceInFile(D, Loc); in handleDecl()
554 DInfo.isImplicit = D->isImplicit(); in handleDecl()
560 SemaDC = D->getDeclContext(); in handleDecl()
566 } else if (isTemplateImplicitInstantiation(D)) { in handleDecl()
580 getContainerInfo(getEntityContainer(D), DInfo.DeclAsContainer); in handleDecl()
588 bool CXIndexDataConsumer::handleObjCContainer(const ObjCContainerDecl *D, in handleObjCContainer() argument
592 return handleDecl(D, Loc, Cursor, ContDInfo); in handleObjCContainer()
595 bool CXIndexDataConsumer::handleFunction(const FunctionDecl *D) { in handleFunction() argument
596 bool isDef = D->isThisDeclarationADefinition(); in handleFunction()
599 if (D->hasSkippedBody()) { in handleFunction()
605 DeclInfo DInfo(!D->isFirstDecl(), isDef, isContainer); in handleFunction()
608 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunction()
611 bool CXIndexDataConsumer::handleVar(const VarDecl *D) { in handleVar() argument
612 DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(), in handleVar()
614 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleVar()
617 bool CXIndexDataConsumer::handleField(const FieldDecl *D) { in handleField() argument
620 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleField()
623 bool CXIndexDataConsumer::handleMSProperty(const MSPropertyDecl *D) { in handleMSProperty() argument
626 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleMSProperty()
629 bool CXIndexDataConsumer::handleEnumerator(const EnumConstantDecl *D) { in handleEnumerator() argument
632 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleEnumerator()
635 bool CXIndexDataConsumer::handleTagDecl(const TagDecl *D) { in handleTagDecl() argument
636 if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(D)) in handleTagDecl()
637 return handleCXXRecordDecl(CXXRD, D); in handleTagDecl()
639 DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(), in handleTagDecl()
640 D->isThisDeclarationADefinition()); in handleTagDecl()
641 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTagDecl()
644 bool CXIndexDataConsumer::handleTypedefName(const TypedefNameDecl *D) { in handleTypedefName() argument
645 DeclInfo DInfo(!D->isFirstDecl(), /*isDefinition=*/true, in handleTypedefName()
647 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypedefName()
650 bool CXIndexDataConsumer::handleObjCInterface(const ObjCInterfaceDecl *D) { in handleObjCInterface() argument
652 if (!D->isThisDeclarationADefinition()) { in handleObjCInterface()
653 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCInterface()
657 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCInterface()
660 return handleObjCContainer(D, D->getLocation(), in handleObjCInterface()
661 MakeCursorObjCClassRef(D, D->getLocation(), in handleObjCInterface()
671 if (ObjCInterfaceDecl *SuperD = D->getSuperClass()) { in handleObjCInterface()
673 SourceLocation SuperLoc = D->getSuperClassLoc(); in handleObjCInterface()
683 ObjCProtocolListInfo ProtInfo(D->isThisDeclarationADefinition() in handleObjCInterface()
684 ? D->getReferencedProtocols() in handleObjCInterface()
688 ObjCInterfaceDeclInfo InterInfo(D); in handleObjCInterface()
691 InterInfo.ObjCInterDeclInfo.superInfo = D->getSuperClass() ? &BaseClass in handleObjCInterface()
695 return handleObjCContainer(D, D->getLocation(), getCursor(D), InterInfo); in handleObjCInterface()
699 const ObjCImplementationDecl *D) { in handleObjCImplementation() argument
703 return handleObjCContainer(D, D->getLocation(), getCursor(D), ContDInfo); in handleObjCImplementation()
706 bool CXIndexDataConsumer::handleObjCProtocol(const ObjCProtocolDecl *D) { in handleObjCProtocol() argument
707 if (!D->isThisDeclarationADefinition()) { in handleObjCProtocol()
708 if (shouldSuppressRefs() && markEntityOccurrenceInFile(D, D->getLocation())) in handleObjCProtocol()
712 bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); in handleObjCProtocol()
716 return handleObjCContainer(D, D->getLocation(), in handleObjCProtocol()
717 MakeCursorObjCProtocolRef(D, D->getLocation(), in handleObjCProtocol()
724 ObjCProtocolListInfo ProtListInfo(D->isThisDeclarationADefinition() in handleObjCProtocol()
725 ? D->getReferencedProtocols() in handleObjCProtocol()
729 ObjCProtocolDeclInfo ProtInfo(D); in handleObjCProtocol()
732 return handleObjCContainer(D, D->getLocation(), getCursor(D), ProtInfo); in handleObjCProtocol()
735 bool CXIndexDataConsumer::handleObjCCategory(const ObjCCategoryDecl *D) { in handleObjCCategory() argument
740 const ObjCInterfaceDecl *IFaceD = D->getClassInterface(); in handleObjCCategory()
741 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategory()
742 SourceLocation CategoryLoc = D->IsClassExtension() ? ClassLoc in handleObjCCategory()
743 : D->getCategoryNameLoc(); in handleObjCCategory()
749 ObjCProtocolListInfo ProtInfo(D->getReferencedProtocols(), *this, SA); in handleObjCCategory()
764 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategory()
767 bool CXIndexDataConsumer::handleObjCCategoryImpl(const ObjCCategoryImplDecl *D) { in handleObjCCategoryImpl() argument
770 const ObjCCategoryDecl *CatD = D->getCategoryDecl(); in handleObjCCategoryImpl()
774 SourceLocation ClassLoc = D->getLocation(); in handleObjCCategoryImpl()
775 SourceLocation CategoryLoc = D->getCategoryNameLoc(); in handleObjCCategoryImpl()
793 return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); in handleObjCCategoryImpl()
796 bool CXIndexDataConsumer::handleObjCMethod(const ObjCMethodDecl *D) { in handleObjCMethod() argument
797 bool isDef = D->isThisDeclarationADefinition(); in handleObjCMethod()
800 if (D->hasSkippedBody()) { in handleObjCMethod()
806 DeclInfo DInfo(!D->isCanonicalDecl(), isDef, isContainer); in handleObjCMethod()
809 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleObjCMethod()
813 const ObjCPropertyImplDecl *D) { in handleSynthesizedObjCProperty() argument
814 ObjCPropertyDecl *PD = D->getPropertyDecl(); in handleSynthesizedObjCProperty()
815 auto *DC = D->getDeclContext(); in handleSynthesizedObjCProperty()
816 return handleReference(PD, D->getLocation(), getCursor(D), in handleSynthesizedObjCProperty()
820 bool CXIndexDataConsumer::handleSynthesizedObjCMethod(const ObjCMethodDecl *D, in handleSynthesizedObjCMethod() argument
825 return handleDecl(D, Loc, getCursor(D), DInfo, LexicalDC, D->getDeclContext()); in handleSynthesizedObjCMethod()
828 bool CXIndexDataConsumer::handleObjCProperty(const ObjCPropertyDecl *D) { in handleObjCProperty() argument
837 if (ObjCMethodDecl *Getter = D->getGetterMethodDecl()) { in handleObjCProperty()
843 if (ObjCMethodDecl *Setter = D->getSetterMethodDecl()) { in handleObjCProperty()
850 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleObjCProperty()
853 bool CXIndexDataConsumer::handleNamespace(const NamespaceDecl *D) { in handleNamespace() argument
854 DeclInfo DInfo(/*isRedeclaration=*/!D->isOriginalNamespace(), in handleNamespace()
857 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleNamespace()
860 bool CXIndexDataConsumer::handleClassTemplate(const ClassTemplateDecl *D) { in handleClassTemplate() argument
861 return handleCXXRecordDecl(D->getTemplatedDecl(), D); in handleClassTemplate()
864 bool CXIndexDataConsumer::handleFunctionTemplate(const FunctionTemplateDecl *D) { in handleFunctionTemplate() argument
865 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleFunctionTemplate()
866 /*isDefinition=*/D->isThisDeclarationADefinition(), in handleFunctionTemplate()
867 /*isContainer=*/D->isThisDeclarationADefinition()); in handleFunctionTemplate()
868 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleFunctionTemplate()
871 bool CXIndexDataConsumer::handleTypeAliasTemplate(const TypeAliasTemplateDecl *D) { in handleTypeAliasTemplate() argument
872 DeclInfo DInfo(/*isRedeclaration=*/!D->isCanonicalDecl(), in handleTypeAliasTemplate()
874 return handleDecl(D, D->getLocation(), getCursor(D), DInfo); in handleTypeAliasTemplate()
877 bool CXIndexDataConsumer::handleReference(const NamedDecl *D, SourceLocation Loc, in handleReference() argument
882 if (!D) in handleReference()
886 : getRefCursor(D, Loc); in handleReference()
887 return handleReference(D, Loc, Cursor, Parent, DC, E, Kind); in handleReference()
890 bool CXIndexDataConsumer::handleReference(const NamedDecl *D, SourceLocation Loc, in handleReference() argument
899 if (!D) in handleReference()
903 if (!shouldIndexFunctionLocalSymbols() && isFunctionLocalDecl(D)) in handleReference()
905 if (isNotFromSourceFile(D->getLocation())) in handleReference()
907 if (D->isImplicit() && shouldIgnoreIfImplicit(D)) in handleReference()
911 if (markEntityOccurrenceInFile(D, Loc)) in handleReference()
917 getEntityInfo(D, RefEntity, SA); in handleReference()
964 CXIdxClientEntity CXIndexDataConsumer::getClientEntity(const Decl *D) const { in getClientEntity()
965 if (!D) in getClientEntity()
967 EntityMapTy::const_iterator I = EntityMap.find(D); in getClientEntity()
973 void CXIndexDataConsumer::setClientEntity(const Decl *D, CXIdxClientEntity client) { in setClientEntity() argument
974 if (!D) in setClientEntity()
976 EntityMap[D] = client; in setClientEntity()
1012 bool CXIndexDataConsumer::markEntityOccurrenceInFile(const NamedDecl *D, in markEntityOccurrenceInFile() argument
1014 if (!D || Loc.isInvalid()) in markEntityOccurrenceInFile()
1018 D = getEntityDecl(D); in markEntityOccurrenceInFile()
1028 RefFileOccurrence RefOccur(FE, D); in markEntityOccurrenceInFile()
1034 const NamedDecl *CXIndexDataConsumer::getEntityDecl(const NamedDecl *D) const { in getEntityDecl()
1035 assert(D); in getEntityDecl()
1036 D = cast<NamedDecl>(D->getCanonicalDecl()); in getEntityDecl()
1039 ImplD = dyn_cast<ObjCImplementationDecl>(D)) { in getEntityDecl()
1043 CatImplD = dyn_cast<ObjCCategoryImplDecl>(D)) { in getEntityDecl()
1045 } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in getEntityDecl()
1048 } else if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { in getEntityDecl()
1053 return D; in getEntityDecl()
1057 CXIndexDataConsumer::getEntityContainer(const Decl *D) const { in getEntityContainer()
1058 const DeclContext *DC = dyn_cast<DeclContext>(D); in getEntityContainer()
1062 if (const ClassTemplateDecl *ClassTempl = dyn_cast<ClassTemplateDecl>(D)) { in getEntityContainer()
1065 FuncTempl = dyn_cast<FunctionTemplateDecl>(D)) { in getEntityContainer()
1140 void CXIndexDataConsumer::getEntityInfo(const NamedDecl *D, in getEntityInfo() argument
1143 if (!D) in getEntityInfo()
1146 D = getEntityDecl(D); in getEntityInfo()
1147 EntityInfo.cursor = getCursor(D); in getEntityInfo()
1148 EntityInfo.Dcl = D; in getEntityInfo()
1151 SymbolInfo SymInfo = getSymbolInfo(D); in getEntityInfo()
1156 if (D->hasAttrs()) { in getEntityInfo()
1157 EntityInfo.AttrList = AttrListInfo::create(D, *this); in getEntityInfo()
1165 if (IdentifierInfo *II = D->getIdentifier()) { in getEntityInfo()
1168 } else if (isa<TagDecl>(D) || isa<FieldDecl>(D) || isa<NamespaceDecl>(D)) { in getEntityInfo()
1175 D->printName(OS); in getEntityInfo()
1182 bool Ignore = getDeclCursorUSR(D, StrBuf); in getEntityInfo()
1198 CXCursor CXIndexDataConsumer::getRefCursor(const NamedDecl *D, SourceLocation Loc) { in getRefCursor() argument
1199 if (const TypeDecl *TD = dyn_cast<TypeDecl>(D)) in getRefCursor()
1201 if (const ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D)) in getRefCursor()
1203 if (const ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)) in getRefCursor()
1205 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(D)) in getRefCursor()
1207 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(D)) in getRefCursor()
1209 if (const NamespaceAliasDecl *Namespace = dyn_cast<NamespaceAliasDecl>(D)) in getRefCursor()
1211 if (const FieldDecl *Field = dyn_cast<FieldDecl>(D)) in getRefCursor()
1213 if (const VarDecl *Var = dyn_cast<VarDecl>(D)) in getRefCursor()
1219 bool CXIndexDataConsumer::shouldIgnoreIfImplicit(const Decl *D) { in shouldIgnoreIfImplicit() argument
1220 if (isa<ObjCInterfaceDecl>(D)) in shouldIgnoreIfImplicit()
1222 if (isa<ObjCCategoryDecl>(D)) in shouldIgnoreIfImplicit()
1224 if (isa<ObjCIvarDecl>(D)) in shouldIgnoreIfImplicit()
1226 if (isa<ObjCMethodDecl>(D)) in shouldIgnoreIfImplicit()
1228 if (isa<ImportDecl>(D)) in shouldIgnoreIfImplicit()
1233 bool CXIndexDataConsumer::isTemplateImplicitInstantiation(const Decl *D) { in isTemplateImplicitInstantiation() argument
1235 SD = dyn_cast<ClassTemplateSpecializationDecl>(D)) { in isTemplateImplicitInstantiation()
1238 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in isTemplateImplicitInstantiation()