Lines Matching refs:ND
115 void Add(const NamedDecl *ND, unsigned Index) { in Add() argument
118 DeclOrVector = ND; in Add()
134 DeclIndexPair(ND, Index)); in Add()
310 bool isInterestingDecl(const NamedDecl *ND,
319 bool canFunctionBeCalled(const NamedDecl *ND, QualType BaseExprType) const;
388 bool IsOrdinaryName(const NamedDecl *ND) const;
389 bool IsOrdinaryNonTypeName(const NamedDecl *ND) const;
390 bool IsIntegralConstantValue(const NamedDecl *ND) const;
391 bool IsOrdinaryNonValueName(const NamedDecl *ND) const;
392 bool IsNestedNameSpecifier(const NamedDecl *ND) const;
393 bool IsEnum(const NamedDecl *ND) const;
394 bool IsClassOrStruct(const NamedDecl *ND) const;
395 bool IsUnion(const NamedDecl *ND) const;
396 bool IsNamespace(const NamedDecl *ND) const;
397 bool IsNamespaceOrAlias(const NamedDecl *ND) const;
398 bool IsType(const NamedDecl *ND) const;
399 bool IsMember(const NamedDecl *ND) const;
400 bool IsObjCIvar(const NamedDecl *ND) const;
401 bool IsObjCMessageReceiver(const NamedDecl *ND) const;
402 bool IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const;
403 bool IsObjCCollection(const NamedDecl *ND) const;
404 bool IsImpossibleToSatisfy(const NamedDecl *ND) const;
681 if (const NamedDecl *ND = DeclOrIterator.dyn_cast<const NamedDecl *>()) in operator *() local
682 return reference(ND, SingleDeclIndex); in operator *()
705 if (const NamedDecl *ND = DeclOrVector.dyn_cast<const NamedDecl *>()) in begin() local
706 return iterator(ND, SingleDeclIndex); in begin()
766 static bool shouldIgnoreDueToReservedName(const NamedDecl *ND, Sema &SemaRef) { in shouldIgnoreDueToReservedName() argument
767 ReservedIdentifierStatus Status = ND->isReserved(SemaRef.getLangOpts()); in shouldIgnoreDueToReservedName()
769 if (isReservedInAllContexts(Status) && ND->getLocation().isInvalid()) in shouldIgnoreDueToReservedName()
777 SemaRef.SourceMgr.getSpellingLoc(ND->getLocation()))) in shouldIgnoreDueToReservedName()
783 bool ResultBuilder::isInterestingDecl(const NamedDecl *ND, in isInterestingDecl() argument
787 auto *Named = ND; in isInterestingDecl()
788 ND = ND->getUnderlyingDecl(); in isInterestingDecl()
791 if (!ND->getDeclName()) in isInterestingDecl()
796 if (ND->getFriendObjectKind() == Decl::FOK_Undeclared) in isInterestingDecl()
800 if (isa<ClassTemplateSpecializationDecl>(ND) || in isInterestingDecl()
801 isa<ClassTemplatePartialSpecializationDecl>(ND)) in isInterestingDecl()
805 if (isa<UsingDecl>(ND)) in isInterestingDecl()
808 if (shouldIgnoreDueToReservedName(ND, SemaRef)) in isInterestingDecl()
812 (isa<NamespaceDecl>(ND) && Filter != &ResultBuilder::IsNamespace && in isInterestingDecl()
820 IsNestedNameSpecifier(ND) && in isInterestingDecl()
822 (isa<CXXRecordDecl>(ND) && in isInterestingDecl()
823 cast<CXXRecordDecl>(ND)->isInjectedClassName()))) { in isInterestingDecl()
933 QualType clang::getDeclUsageType(ASTContext &C, const NamedDecl *ND) { in getDeclUsageType() argument
934 ND = ND->getUnderlyingDecl(); in getDeclUsageType()
936 if (const auto *Type = dyn_cast<TypeDecl>(ND)) in getDeclUsageType()
938 if (const auto *Iface = dyn_cast<ObjCInterfaceDecl>(ND)) in getDeclUsageType()
942 if (const FunctionDecl *Function = ND->getAsFunction()) in getDeclUsageType()
944 else if (const auto *Method = dyn_cast<ObjCMethodDecl>(ND)) in getDeclUsageType()
946 else if (const auto *Enumerator = dyn_cast<EnumConstantDecl>(ND)) in getDeclUsageType()
948 else if (const auto *Property = dyn_cast<ObjCPropertyDecl>(ND)) in getDeclUsageType()
950 else if (const auto *Value = dyn_cast<ValueDecl>(ND)) in getDeclUsageType()
990 unsigned ResultBuilder::getBasePriority(const NamedDecl *ND) { in getBasePriority() argument
991 if (!ND) in getBasePriority()
995 const DeclContext *LexicalDC = ND->getLexicalDeclContext(); in getBasePriority()
998 if (const auto *ImplicitParam = dyn_cast<ImplicitParamDecl>(ND)) in getBasePriority()
1006 const DeclContext *DC = ND->getDeclContext()->getRedeclContext(); in getBasePriority()
1009 if (isa<CXXDestructorDecl>(ND)) in getBasePriority()
1012 auto DeclNameKind = ND->getDeclName().getNameKind(); in getBasePriority()
1021 if (isa<EnumConstantDecl>(ND)) in getBasePriority()
1027 if ((isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND)) && in getBasePriority()
1102 static bool isConstructor(const Decl *ND) { in isConstructor() argument
1103 if (const auto *Tmpl = dyn_cast<FunctionTemplateDecl>(ND)) in isConstructor()
1104 ND = Tmpl->getTemplatedDecl(); in isConstructor()
1105 return isa<CXXConstructorDecl>(ND); in isConstructor()
1150 const NamedDecl *ND = I->first; in MaybeAddResult() local
1152 if (ND->getCanonicalDecl() == CanonDecl) { in MaybeAddResult()
1323 bool ResultBuilder::canFunctionBeCalled(const NamedDecl *ND, in canFunctionBeCalled() argument
1334 if (const auto *FuncTmpl = dyn_cast<FunctionTemplateDecl>(ND)) { in canFunctionBeCalled()
1335 ND = FuncTmpl->getTemplatedDecl(); in canFunctionBeCalled()
1337 const auto *Method = dyn_cast<CXXMethodDecl>(ND); in canFunctionBeCalled()
1491 bool ResultBuilder::IsOrdinaryName(const NamedDecl *ND) const { in IsOrdinaryName()
1492 ND = ND->getUnderlyingDecl(); in IsOrdinaryName()
1500 if (isa<ObjCIvarDecl>(ND)) in IsOrdinaryName()
1504 return ND->getIdentifierNamespace() & IDNS; in IsOrdinaryName()
1509 bool ResultBuilder::IsOrdinaryNonTypeName(const NamedDecl *ND) const { in IsOrdinaryNonTypeName()
1510 ND = ND->getUnderlyingDecl(); in IsOrdinaryNonTypeName()
1511 if (isa<TypeDecl>(ND)) in IsOrdinaryNonTypeName()
1516 if (const auto *ID = dyn_cast<ObjCInterfaceDecl>(ND)) { in IsOrdinaryNonTypeName()
1525 if (isa<ObjCIvarDecl>(ND)) in IsOrdinaryNonTypeName()
1529 return ND->getIdentifierNamespace() & IDNS; in IsOrdinaryNonTypeName()
1532 bool ResultBuilder::IsIntegralConstantValue(const NamedDecl *ND) const { in IsIntegralConstantValue()
1533 if (!IsOrdinaryNonTypeName(ND)) in IsIntegralConstantValue()
1536 if (const auto *VD = dyn_cast<ValueDecl>(ND->getUnderlyingDecl())) in IsIntegralConstantValue()
1545 bool ResultBuilder::IsOrdinaryNonValueName(const NamedDecl *ND) const { in IsOrdinaryNonValueName()
1546 ND = ND->getUnderlyingDecl(); in IsOrdinaryNonValueName()
1552 return (ND->getIdentifierNamespace() & IDNS) && !isa<ValueDecl>(ND) && in IsOrdinaryNonValueName()
1553 !isa<FunctionTemplateDecl>(ND) && !isa<ObjCPropertyDecl>(ND); in IsOrdinaryNonValueName()
1558 bool ResultBuilder::IsNestedNameSpecifier(const NamedDecl *ND) const { in IsNestedNameSpecifier()
1560 if (const auto *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsNestedNameSpecifier()
1561 ND = ClassTemplate->getTemplatedDecl(); in IsNestedNameSpecifier()
1563 return SemaRef.isAcceptableNestedNameSpecifier(ND); in IsNestedNameSpecifier()
1567 bool ResultBuilder::IsEnum(const NamedDecl *ND) const { in IsEnum()
1568 return isa<EnumDecl>(ND); in IsEnum()
1572 bool ResultBuilder::IsClassOrStruct(const NamedDecl *ND) const { in IsClassOrStruct()
1574 if (const auto *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsClassOrStruct()
1575 ND = ClassTemplate->getTemplatedDecl(); in IsClassOrStruct()
1578 if (const auto *RD = dyn_cast<RecordDecl>(ND)) in IsClassOrStruct()
1587 bool ResultBuilder::IsUnion(const NamedDecl *ND) const { in IsUnion()
1589 if (const auto *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND)) in IsUnion()
1590 ND = ClassTemplate->getTemplatedDecl(); in IsUnion()
1592 if (const auto *RD = dyn_cast<RecordDecl>(ND)) in IsUnion()
1599 bool ResultBuilder::IsNamespace(const NamedDecl *ND) const { in IsNamespace()
1600 return isa<NamespaceDecl>(ND); in IsNamespace()
1605 bool ResultBuilder::IsNamespaceOrAlias(const NamedDecl *ND) const { in IsNamespaceOrAlias()
1606 return isa<NamespaceDecl>(ND->getUnderlyingDecl()); in IsNamespaceOrAlias()
1610 bool ResultBuilder::IsType(const NamedDecl *ND) const { in IsType()
1611 ND = ND->getUnderlyingDecl(); in IsType()
1612 return isa<TypeDecl>(ND) || isa<ObjCInterfaceDecl>(ND); in IsType()
1618 bool ResultBuilder::IsMember(const NamedDecl *ND) const { in IsMember()
1619 ND = ND->getUnderlyingDecl(); in IsMember()
1620 return isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND) || in IsMember()
1621 isa<ObjCPropertyDecl>(ND); in IsMember()
1657 bool ResultBuilder::IsObjCMessageReceiver(const NamedDecl *ND) const { in IsObjCMessageReceiver()
1658 QualType T = getDeclUsageType(SemaRef.Context, ND); in IsObjCMessageReceiver()
1667 const NamedDecl *ND) const { in IsObjCMessageReceiverOrLambdaCapture()
1668 if (IsObjCMessageReceiver(ND)) in IsObjCMessageReceiverOrLambdaCapture()
1671 const auto *Var = dyn_cast<VarDecl>(ND); in IsObjCMessageReceiverOrLambdaCapture()
1678 bool ResultBuilder::IsObjCCollection(const NamedDecl *ND) const { in IsObjCCollection()
1679 if ((SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryName(ND)) || in IsObjCCollection()
1680 (!SemaRef.getLangOpts().CPlusPlus && !IsOrdinaryNonTypeName(ND))) in IsObjCCollection()
1683 QualType T = getDeclUsageType(SemaRef.Context, ND); in IsObjCCollection()
1693 bool ResultBuilder::IsImpossibleToSatisfy(const NamedDecl *ND) const { in IsImpossibleToSatisfy()
1699 bool ResultBuilder::IsObjCIvar(const NamedDecl *ND) const { in IsObjCIvar()
1700 return isa<ObjCIvarDecl>(ND); in IsObjCIvar()
1737 void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx, in FoundDecl() argument
1739 ResultBuilder::Result Result(ND, Results.getBasePriority(ND), nullptr, in FoundDecl()
1740 false, IsAccessible(ND, Ctx), FixIts); in FoundDecl()
1749 bool IsAccessible(NamedDecl *ND, DeclContext *Ctx) { in IsAccessible() argument
1774 return Results.getSema().IsSimplyAccessible(ND, NamingClass, BaseType); in IsAccessible()
2771 const NamedDecl *ND, QualType BaseType, in AddResultTypeChunk() argument
2773 if (!ND) in AddResultTypeChunk()
2778 if (isConstructor(ND) || isa<CXXConversionDecl>(ND)) in AddResultTypeChunk()
2783 if (const FunctionDecl *Function = ND->getAsFunction()) in AddResultTypeChunk()
2785 else if (const auto *Method = dyn_cast<ObjCMethodDecl>(ND)) { in AddResultTypeChunk()
2790 } else if (const auto *Enumerator = dyn_cast<EnumConstantDecl>(ND)) { in AddResultTypeChunk()
2793 } else if (isa<UnresolvedUsingValueDecl>(ND)) { in AddResultTypeChunk()
2795 } else if (const auto *Ivar = dyn_cast<ObjCIvarDecl>(ND)) { in AddResultTypeChunk()
2800 } else if (const auto *Value = dyn_cast<ValueDecl>(ND)) { in AddResultTypeChunk()
2802 } else if (const auto *Property = dyn_cast<ObjCPropertyDecl>(ND)) { in AddResultTypeChunk()
3297 const NamedDecl *ND, in AddTypedNameChunk() argument
3299 DeclarationName Name = ND->getDeclName(); in AddTypedNameChunk()
3348 Result.getAllocator().CopyString(ND->getNameAsString())); in AddTypedNameChunk()
3367 Result.getAllocator().CopyString(ND->getNameAsString())); in AddTypedNameChunk()
3520 static const NamedDecl *extractFunctorCallOperator(const NamedDecl *ND) { in extractFunctorCallOperator() argument
3521 const auto *VD = dyn_cast<VarDecl>(ND); in extractFunctorCallOperator()
3534 const NamedDecl *ND = Declaration; in createCodeCompletionStringForDecl() local
3535 Result.addParentContext(ND->getDeclContext()); in createCodeCompletionStringForDecl()
3546 Result.getAllocator().CopyString(ND->getNameAsString())); in createCodeCompletionStringForDecl()
3551 for (const auto *I : ND->specific_attrs<AnnotateAttr>()) in createCodeCompletionStringForDecl()
3558 AddTypedNameChunk(Ctx, Policy, ND, Result); in createCodeCompletionStringForDecl()
3565 if (const auto *Function = dyn_cast<FunctionDecl>(ND)) { in createCodeCompletionStringForDecl()
3571 dyn_cast_or_null<FunctionDecl>(extractFunctorCallOperator(ND))) { in createCodeCompletionStringForDecl()
3576 AddResultTypeChunk(Ctx, Policy, ND, CCContext.getBaseType(), Result); in createCodeCompletionStringForDecl()
3579 dyn_cast<FunctionTemplateDecl>(ND)) { in createCodeCompletionStringForDecl()
3648 if (const auto *Template = dyn_cast<TemplateDecl>(ND)) { in createCodeCompletionStringForDecl()
3659 if (const auto *Method = dyn_cast<ObjCMethodDecl>(ND)) { in createCodeCompletionStringForDecl()
3755 Result.getAllocator().CopyString(ND->getNameAsString())); in createCodeCompletionStringForDecl()
3760 const NamedDecl *ND) { in getCompletionComment() argument
3761 if (!ND) in getCompletionComment()
3763 if (auto *RC = Ctx.getRawCommentForAnyRedecl(ND)) in getCompletionComment()
3767 const auto *M = dyn_cast<ObjCMethodDecl>(ND); in getCompletionComment()
3778 const NamedDecl *ND) { in getPatternCompletionComment() argument
3779 const auto *M = dyn_cast_or_null<ObjCMethodDecl>(ND); in getPatternCompletionComment()
6495 for (const NamedDecl *ND : *OTS) in ProduceTemplateArgumentSignatureHelp()
6496 if (const auto *TD = llvm::dyn_cast<TemplateDecl>(ND)) in ProduceTemplateArgumentSignatureHelp()
6916 auto GenerateCCS = [&](const NamedDecl *ND, const char *Name) { in CodeCompleteConstructorInitializer() argument
6921 if (const auto *Function = dyn_cast<FunctionDecl>(ND)) in CodeCompleteConstructorInitializer()
6923 else if (const auto *FunTemplDecl = dyn_cast<FunctionTemplateDecl>(ND)) in CodeCompleteConstructorInitializer()
6930 const NamedDecl *ND) { in CodeCompleteConstructorInitializer() argument
6937 if (ND) { in CodeCompleteConstructorInitializer()
6939 Builder.TakeString(), ND, in CodeCompleteConstructorInitializer()
6941 if (isa<FieldDecl>(ND)) in CodeCompleteConstructorInitializer()
8048 NamedDecl *ND = LookupSingleName(S, Super, SuperLoc, LookupOrdinaryName); in CodeCompleteObjCSuperMessage() local
8049 if ((CDecl = dyn_cast_or_null<ObjCInterfaceDecl>(ND))) { in CodeCompleteObjCSuperMessage()
8051 } else if (TypeDecl *TD = dyn_cast_or_null<TypeDecl>(ND)) { in CodeCompleteObjCSuperMessage()
8055 } else if (ND && isa<UnresolvedUsingTypenameDecl>(ND)) { in CodeCompleteObjCSuperMessage()