Home | History | Annotate | Download | only in Sema

Lines Matching refs:ND

81       void Add(const NamedDecl *ND, unsigned Index) {
84 DeclOrVector = ND;
100 DeclIndexPair(ND, Index));
269 /// \param ND the declaration that we are inspecting.
273 bool isInterestingDecl(const NamedDecl *ND,
326 bool IsOrdinaryName(const NamedDecl *ND) const;
327 bool IsOrdinaryNonTypeName(const NamedDecl *ND) const;
328 bool IsIntegralConstantValue(const NamedDecl *ND) const;
329 bool IsOrdinaryNonValueName(const NamedDecl *ND) const;
330 bool IsNestedNameSpecifier(const NamedDecl *ND) const;
331 bool IsEnum(const NamedDecl *ND) const;
332 bool IsClassOrStruct(const NamedDecl *ND) const;
333 bool IsUnion(const NamedDecl *ND) const;
334 bool IsNamespace(const NamedDecl *ND) const;
335 bool IsNamespaceOrAlias(const NamedDecl *ND) const;
336 bool IsType(const NamedDecl *ND) const;
337 bool IsMember(const NamedDecl *ND) const;
338 bool IsObjCIvar(const NamedDecl *ND) const;
339 bool IsObjCMessageReceiver(const NamedDecl *ND) const;
340 bool IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const;
341 bool IsObjCCollection(const NamedDecl *ND) const;
342 bool IsImpossibleToSatisfy(const NamedDecl *ND) const;
396 if (const NamedDecl *ND = DeclOrIterator.dyn_cast<const NamedDecl *>())
397 return reference(ND, SingleDeclIndex);
422 if (const NamedDecl *ND = DeclOrVector.dyn_cast<const NamedDecl *>())
423 return iterator(ND, SingleDeclIndex);
493 bool ResultBuilder::isInterestingDecl(const NamedDecl *ND,
497 ND = ND->getUnderlyingDecl();
498 unsigned IDNS = ND->getIdentifierNamespace();
501 if (!ND->getDeclName())
510 if (isa<ClassTemplateSpecializationDecl>(ND) ||
511 isa<ClassTemplatePartialSpecializationDecl>(ND))
515 if (isa<UsingDecl>(ND))
522 if (const IdentifierInfo *Id = ND->getIdentifier())
524 (ND->getLocation().isInvalid() ||
526 SemaRef.SourceMgr.getSpellingLoc(ND->getLocation()))))
530 ((isa<NamespaceDecl>(ND) || isa<NamespaceAliasDecl>(ND)) &&
537 if (Filter && !(this->*Filter)(ND)) {
540 IsNestedNameSpecifier(ND) &&
542 (isa<CXXRecordDecl>(ND) &&
543 cast<CXXRecordDecl>(ND)->isInjectedClassName()))) {
654 QualType clang::getDeclUsageType(ASTContext &C, const NamedDecl *ND) {
655 ND = cast<NamedDecl>(ND->getUnderlyingDecl());
657 if (const TypeDecl *Type = dyn_cast<TypeDecl>(ND))
659 if (const ObjCInterfaceDecl *Iface = dyn_cast<ObjCInterfaceDecl>(ND))
663 if (const FunctionDecl *Function = ND->getAsFunction())
665 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND))
667 else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND))
669 else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND))
671 else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND))
710 unsigned ResultBuilder::getBasePriority(const NamedDecl *ND) {
711 if (!ND)
715 const DeclContext *LexicalDC = ND->getLexicalDeclContext();
719 dyn_cast<ImplicitParamDecl>(ND))
727 const DeclContext *DC = ND->getDeclContext()->getRedeclContext();
732 if (isa<EnumConstantDecl>(ND))
738 if ((isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND)) &&
852 const NamedDecl *ND = I->first;
854 if (ND->getCanonicalDecl() == CanonDecl) {
1039 bool ResultBuilder::IsOrdinaryName(const NamedDecl *ND) const {
1040 ND = cast<NamedDecl>(ND->getUnderlyingDecl());
1048 if (isa<ObjCIvarDecl>(ND))
1052 return ND->getIdentifierNamespace() & IDNS;
1057 bool ResultBuilder::IsOrdinaryNonTypeName(const NamedDecl *ND) const {
1058 ND = cast<NamedDecl>(ND->getUnderlyingDecl());
1059 if (isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND))
1066 if (isa<ObjCIvarDecl>(ND))
1070 return ND->getIdentifierNamespace() & IDNS;
1073 bool ResultBuilder::IsIntegralConstantValue(const NamedDecl *ND) const {
1074 if (!IsOrdinaryNonTypeName(ND))
1077 if (const ValueDecl *VD = dyn_cast<ValueDecl>(ND->getUnderlyingDecl()))
1086 bool ResultBuilder::IsOrdinaryNonValueName(const NamedDecl *ND) const {
1087 ND = cast<NamedDecl>(ND->getUnderlyingDecl());
1093 return (ND->getIdentifierNamespace() & IDNS) &&
1094 !isa<ValueDecl>(ND) && !isa<FunctionTemplateDecl>(ND) &&
1095 !isa<ObjCPropertyDecl>(ND);
1100 bool ResultBuilder::IsNestedNameSpecifier(const NamedDecl *ND) const {
1102 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1103 ND = ClassTemplate->getTemplatedDecl();
1105 return SemaRef.isAcceptableNestedNameSpecifier(ND);
1109 bool ResultBuilder::IsEnum(const NamedDecl *ND) const {
1110 return isa<EnumDecl>(ND);
1114 bool ResultBuilder::IsClassOrStruct(const NamedDecl *ND) const {
1116 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1117 ND = ClassTemplate->getTemplatedDecl();
1120 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND))
1129 bool ResultBuilder::IsUnion(const NamedDecl *ND) const {
1131 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1132 ND = ClassTemplate->getTemplatedDecl();
1134 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND))
1141 bool ResultBuilder::IsNamespace(const NamedDecl *ND) const {
1142 return isa<NamespaceDecl>(ND);
1147 bool ResultBuilder::IsNamespaceOrAlias(const NamedDecl *ND) const {
1148 return isa<NamespaceDecl>(ND) || isa<NamespaceAliasDecl>(ND);
1152 bool ResultBuilder::IsType(const NamedDecl *ND) const {
1153 if (const UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
1154 ND = Using->getTargetDecl();
1156 return isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND);
1162 bool ResultBuilder::IsMember(const NamedDecl *ND) const {
1163 if (const UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
1164 ND = Using->getTargetDecl();
1166 return isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND) ||
1167 isa<ObjCPropertyDecl>(ND);
1203 bool ResultBuilder::IsObjCMessageReceiver(const NamedDecl *ND) const {
1204 QualType T = getDeclUsageType(SemaRef.Context, ND);
1212 bool ResultBuilder::IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const {
1213 if (IsObjCMessageReceiver(ND))
1216 const VarDecl *Var = dyn_cast<VarDecl>(ND);
1223 bool ResultBuilder::IsObjCCollection(const NamedDecl *ND) const {
1224 if ((SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryName(ND)) ||
1225 (!SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryNonTypeName(ND)))
1228 QualType T = getDeclUsageType(SemaRef.Context, ND);
1238 bool ResultBuilder::IsImpossibleToSatisfy(const NamedDecl *ND) const {
1244 bool ResultBuilder::IsObjCIvar(const NamedDecl *ND) const {
1245 return isa<ObjCIvarDecl>(ND);
1259 void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx,
1263 Accessible = Results.getSema().IsSimplyAccessible(ND, Ctx);
1265 ResultBuilder::Result Result(ND, Results.getBasePriority(ND), nullptr,
2057 const NamedDecl *ND,
2059 if (!ND)
2064 if (isa<CXXConstructorDecl>(ND) || isa<CXXConversionDecl>(ND))
2069 if (const FunctionDecl *Function = ND->getAsFunction())
2071 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND))
2073 else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND))
2075 else if (isa<UnresolvedUsingValueDecl>(ND)) {
2077 } else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND)) {
2079 } else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND))
2441 const NamedDecl *ND,
2443 DeclarationName Name = ND->getDeclName();
2478 Result.getAllocator().CopyString(ND->getNameAsString()));
2497 Result.getAllocator().CopyString(ND->getNameAsString()));
2547 const NamedDecl *ND = Declaration;
2548 if (const ObjCMethodDecl *M = dyn_cast<ObjCMethodDecl>(ND))
2621 const NamedDecl *ND = Declaration;
2622 Result.addParentContext(ND->getDeclContext());
2626 if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(ND)) {
2629 else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND))
2638 Result.getAllocator().CopyString(ND->getNameAsString()));
2643 for (const auto *I : ND->specific_attrs<AnnotateAttr>())
2646 AddResultTypeChunk(Ctx, Policy, ND, Result);
2648 if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(ND)) {
2651 AddTypedNameChunk(Ctx, Policy, ND, Result);
2659 if (const FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(ND)) {
2713 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(ND)) {
2724 if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) {
2810 Result.getAllocator().CopyString(ND->getNameAsString()));
5274 NamedDecl *ND = LookupSingleName(S, Super, SuperLoc,
5276 if ((CDecl = dyn_cast_or_null<ObjCInterfaceDecl>(ND))) {
5278 } else if (TypeDecl *TD = dyn_cast_or_null<TypeDecl>(ND)) {
5282 } else if (ND && isa<UnresolvedUsingTypenameDecl>(ND)) {