Lines Matching refs:ND
80 void Add(const NamedDecl *ND, unsigned Index) { in Add() argument
83 DeclOrVector = ND; in Add()
99 DeclIndexPair(ND, Index)); in Add()
272 bool isInterestingDecl(const NamedDecl *ND,
325 bool IsOrdinaryName(const NamedDecl *ND) const;
326 bool IsOrdinaryNonTypeName(const NamedDecl *ND) const;
327 bool IsIntegralConstantValue(const NamedDecl *ND) const;
328 bool IsOrdinaryNonValueName(const NamedDecl *ND) const;
329 bool IsNestedNameSpecifier(const NamedDecl *ND) const;
330 bool IsEnum(const NamedDecl *ND) const;
331 bool IsClassOrStruct(const NamedDecl *ND) const;
332 bool IsUnion(const NamedDecl *ND) const;
333 bool IsNamespace(const NamedDecl *ND) const;
334 bool IsNamespaceOrAlias(const NamedDecl *ND) const;
335 bool IsType(const NamedDecl *ND) const;
336 bool IsMember(const NamedDecl *ND) const;
337 bool IsObjCIvar(const NamedDecl *ND) const;
338 bool IsObjCMessageReceiver(const NamedDecl *ND) const;
339 bool IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const;
340 bool IsObjCCollection(const NamedDecl *ND) const;
341 bool IsImpossibleToSatisfy(const NamedDecl *ND) const;
395 if (const NamedDecl *ND = DeclOrIterator.dyn_cast<const NamedDecl *>()) in operator *() local
396 return reference(ND, SingleDeclIndex); in operator *()
421 if (const NamedDecl *ND = DeclOrVector.dyn_cast<const NamedDecl *>()) in begin() local
422 return iterator(ND, SingleDeclIndex); in begin()
497 static bool shouldIgnoreDueToReservedName(const NamedDecl *ND, Sema &SemaRef) { in shouldIgnoreDueToReservedName() argument
498 const IdentifierInfo *Id = ND->getIdentifier(); in shouldIgnoreDueToReservedName()
503 if (isReservedName(Id) && ND->getLocation().isInvalid()) in shouldIgnoreDueToReservedName()
511 SemaRef.SourceMgr.getSpellingLoc(ND->getLocation()))) in shouldIgnoreDueToReservedName()
517 bool ResultBuilder::isInterestingDecl(const NamedDecl *ND, in isInterestingDecl() argument
521 auto *Named = ND; in isInterestingDecl()
522 ND = ND->getUnderlyingDecl(); in isInterestingDecl()
525 if (!ND->getDeclName()) in isInterestingDecl()
530 if (ND->getFriendObjectKind() == Decl::FOK_Undeclared) in isInterestingDecl()
534 if (isa<ClassTemplateSpecializationDecl>(ND) || in isInterestingDecl()
535 isa<ClassTemplatePartialSpecializationDecl>(ND)) in isInterestingDecl()
539 if (isa<UsingDecl>(ND)) in isInterestingDecl()
542 if (shouldIgnoreDueToReservedName(ND, SemaRef)) in isInterestingDecl()
546 (isa<NamespaceDecl>(ND) && in isInterestingDecl()
556 IsNestedNameSpecifier(ND) && in isInterestingDecl()
558 (isa<CXXRecordDecl>(ND) && in isInterestingDecl()
559 cast<CXXRecordDecl>(ND)->isInjectedClassName()))) { in isInterestingDecl()
670 QualType clang::getDeclUsageType(ASTContext &C, const NamedDecl *ND) { in getDeclUsageType() argument
671 ND = cast<NamedDecl>(ND->getUnderlyingDecl()); in getDeclUsageType()
673 if (const TypeDecl *Type = dyn_cast<TypeDecl>(ND)) in getDeclUsageType()
675 if (const ObjCInterfaceDecl *Iface = dyn_cast<ObjCInterfaceDecl>(ND)) in getDeclUsageType()
679 if (const FunctionDecl *Function = ND->getAsFunction()) in getDeclUsageType()
681 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) in getDeclUsageType()
683 else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND)) in getDeclUsageType()
685 else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND)) in getDeclUsageType()
687 else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND)) in getDeclUsageType()
726 unsigned ResultBuilder::getBasePriority(const NamedDecl *ND) { in getBasePriority() argument
727 if (!ND) in getBasePriority()
731 const DeclContext *LexicalDC = ND->getLexicalDeclContext(); in getBasePriority()
735 dyn_cast<ImplicitParamDecl>(ND)) in getBasePriority()
743 const DeclContext *DC = ND->getDeclContext()->getRedeclContext(); in getBasePriority()
748 if (isa<EnumConstantDecl>(ND)) in getBasePriority()
754 if ((isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND)) && in getBasePriority()
868 const NamedDecl *ND = I->first; in MaybeAddResult() local
870 if (ND->getCanonicalDecl() == CanonDecl) { in MaybeAddResult()
1053 bool ResultBuilder::IsOrdinaryName(const NamedDecl *ND) const { in IsOrdinaryName()
1054 ND = cast<NamedDecl>(ND->getUnderlyingDecl()); in IsOrdinaryName()
1062 if (isa<ObjCIvarDecl>(ND)) in IsOrdinaryName()
1066 return ND->getIdentifierNamespace() & IDNS; in IsOrdinaryName()
1071 bool ResultBuilder::IsOrdinaryNonTypeName(const NamedDecl *ND) const { in IsOrdinaryNonTypeName()
1072 ND = cast<NamedDecl>(ND->getUnderlyingDecl()); in IsOrdinaryNonTypeName()
1073 if (isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND)) in IsOrdinaryNonTypeName()
1080 if (isa<ObjCIvarDecl>(ND)) in IsOrdinaryNonTypeName()
1084 return ND->getIdentifierNamespace() & IDNS; in IsOrdinaryNonTypeName()
1087 bool ResultBuilder::IsIntegralConstantValue(const NamedDecl *ND) const { in IsIntegralConstantValue()
1088 if (!IsOrdinaryNonTypeName(ND)) in IsIntegralConstantValue()
1091 if (const ValueDecl *VD = dyn_cast<ValueDecl>(ND->getUnderlyingDecl())) in IsIntegralConstantValue()
1100 bool ResultBuilder::IsOrdinaryNonValueName(const NamedDecl *ND) const { in IsOrdinaryNonValueName()
1101 ND = cast<NamedDecl>(ND->getUnderlyingDecl()); in IsOrdinaryNonValueName()
1107 return (ND->getIdentifierNamespace() & IDNS) && in IsOrdinaryNonValueName()
1108 !isa<ValueDecl>(ND) && !isa<FunctionTemplateDecl>(ND) && in IsOrdinaryNonValueName()
1109 !isa<ObjCPropertyDecl>(ND); in IsOrdinaryNonValueName()
1114 bool ResultBuilder::IsNestedNameSpecifier(const NamedDecl *ND) const { in IsNestedNameSpecifier()
1116 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsNestedNameSpecifier()
1117 ND = ClassTemplate->getTemplatedDecl(); in IsNestedNameSpecifier()
1119 return SemaRef.isAcceptableNestedNameSpecifier(ND); in IsNestedNameSpecifier()
1123 bool ResultBuilder::IsEnum(const NamedDecl *ND) const { in IsEnum()
1124 return isa<EnumDecl>(ND); in IsEnum()
1128 bool ResultBuilder::IsClassOrStruct(const NamedDecl *ND) const { in IsClassOrStruct()
1130 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsClassOrStruct()
1131 ND = ClassTemplate->getTemplatedDecl(); in IsClassOrStruct()
1134 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND)) in IsClassOrStruct()
1143 bool ResultBuilder::IsUnion(const NamedDecl *ND) const { in IsUnion()
1145 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsUnion()
1146 ND = ClassTemplate->getTemplatedDecl(); in IsUnion()
1148 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND)) in IsUnion()
1155 bool ResultBuilder::IsNamespace(const NamedDecl *ND) const { in IsNamespace()
1156 return isa<NamespaceDecl>(ND); in IsNamespace()
1161 bool ResultBuilder::IsNamespaceOrAlias(const NamedDecl *ND) const { in IsNamespaceOrAlias()
1162 return isa<NamespaceDecl>(ND->getUnderlyingDecl()); in IsNamespaceOrAlias()
1166 bool ResultBuilder::IsType(const NamedDecl *ND) const { in IsType()
1167 ND = ND->getUnderlyingDecl(); in IsType()
1168 return isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND); in IsType()
1174 bool ResultBuilder::IsMember(const NamedDecl *ND) const { in IsMember()
1175 ND = ND->getUnderlyingDecl(); in IsMember()
1176 return isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND) || in IsMember()
1177 isa<ObjCPropertyDecl>(ND); in IsMember()
1213 bool ResultBuilder::IsObjCMessageReceiver(const NamedDecl *ND) const { in IsObjCMessageReceiver()
1214 QualType T = getDeclUsageType(SemaRef.Context, ND); in IsObjCMessageReceiver()
1222 bool ResultBuilder::IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const { in IsObjCMessageReceiverOrLambdaCapture()
1223 if (IsObjCMessageReceiver(ND)) in IsObjCMessageReceiverOrLambdaCapture()
1226 const VarDecl *Var = dyn_cast<VarDecl>(ND); in IsObjCMessageReceiverOrLambdaCapture()
1233 bool ResultBuilder::IsObjCCollection(const NamedDecl *ND) const { in IsObjCCollection()
1234 if ((SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryName(ND)) || in IsObjCCollection()
1235 (!SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryNonTypeName(ND))) in IsObjCCollection()
1238 QualType T = getDeclUsageType(SemaRef.Context, ND); in IsObjCCollection()
1248 bool ResultBuilder::IsImpossibleToSatisfy(const NamedDecl *ND) const { in IsImpossibleToSatisfy()
1254 bool ResultBuilder::IsObjCIvar(const NamedDecl *ND) const { in IsObjCIvar()
1255 return isa<ObjCIvarDecl>(ND); in IsObjCIvar()
1269 void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx, in FoundDecl() argument
1273 Accessible = Results.getSema().IsSimplyAccessible(ND, Ctx); in FoundDecl()
1275 ResultBuilder::Result Result(ND, Results.getBasePriority(ND), nullptr, in FoundDecl()
2071 const NamedDecl *ND, in AddResultTypeChunk() argument
2074 if (!ND) in AddResultTypeChunk()
2079 if (isa<CXXConstructorDecl>(ND) || isa<CXXConversionDecl>(ND)) in AddResultTypeChunk()
2084 if (const FunctionDecl *Function = ND->getAsFunction()) in AddResultTypeChunk()
2086 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) { in AddResultTypeChunk()
2091 } else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND)) in AddResultTypeChunk()
2093 else if (isa<UnresolvedUsingValueDecl>(ND)) { in AddResultTypeChunk()
2095 } else if (const ObjCIvarDecl *Ivar = dyn_cast<ObjCIvarDecl>(ND)) { in AddResultTypeChunk()
2100 } else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND)) { in AddResultTypeChunk()
2102 } else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND)) { in AddResultTypeChunk()
2506 const NamedDecl *ND, in AddTypedNameChunk() argument
2508 DeclarationName Name = ND->getDeclName(); in AddTypedNameChunk()
2543 Result.getAllocator().CopyString(ND->getNameAsString())); in AddTypedNameChunk()
2562 Result.getAllocator().CopyString(ND->getNameAsString())); in AddTypedNameChunk()
2614 const NamedDecl *ND = Declaration; in CreateCodeCompletionString() local
2615 if (const ObjCMethodDecl *M = dyn_cast<ObjCMethodDecl>(ND)) in CreateCodeCompletionString()
2685 const NamedDecl *ND = Declaration; in CreateCodeCompletionString() local
2686 Result.addParentContext(ND->getDeclContext()); in CreateCodeCompletionString()
2690 if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(ND)) { in CreateCodeCompletionString()
2693 else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND)) in CreateCodeCompletionString()
2702 Result.getAllocator().CopyString(ND->getNameAsString())); in CreateCodeCompletionString()
2707 for (const auto *I : ND->specific_attrs<AnnotateAttr>()) in CreateCodeCompletionString()
2710 AddResultTypeChunk(Ctx, Policy, ND, CCContext.getBaseType(), Result); in CreateCodeCompletionString()
2712 if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(ND)) { in CreateCodeCompletionString()
2715 AddTypedNameChunk(Ctx, Policy, ND, Result); in CreateCodeCompletionString()
2723 if (const FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(ND)) { in CreateCodeCompletionString()
2777 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(ND)) { in CreateCodeCompletionString()
2788 if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) { in CreateCodeCompletionString()
2883 Result.getAllocator().CopyString(ND->getNameAsString())); in CreateCodeCompletionString()
5517 NamedDecl *ND = LookupSingleName(S, Super, SuperLoc, in CodeCompleteObjCSuperMessage() local
5519 if ((CDecl = dyn_cast_or_null<ObjCInterfaceDecl>(ND))) { in CodeCompleteObjCSuperMessage()
5521 } else if (TypeDecl *TD = dyn_cast_or_null<TypeDecl>(ND)) { in CodeCompleteObjCSuperMessage()
5525 } else if (ND && isa<UnresolvedUsingTypenameDecl>(ND)) { in CodeCompleteObjCSuperMessage()