Home | History | Annotate | Download | only in Sema

Lines Matching defs:const

49     typedef bool (ResultBuilder::*LookupFilter)(const NamedDecl *) const;
60 llvm::SmallPtrSet<const Decl*, 16> AllDeclsFound;
62 typedef std::pair<const NamedDecl *, unsigned> DeclIndexPair;
72 llvm::PointerUnion<const NamedDecl *, DeclIndexPairVector*> DeclOrVector;
81 void Add(const NamedDecl *ND, unsigned Index) {
89 if (const NamedDecl *PrevND =
90 DeclOrVector.dyn_cast<const NamedDecl *>()) {
113 iterator begin() const;
114 iterator end() const;
174 const CodeCompletionContext &CompletionContext,
202 unsigned getBasePriority(const NamedDecl *D);
206 bool includeCodePatterns() const {
217 unsigned size() const { return Results.size(); }
218 bool empty() const { return Results.empty(); }
248 const CodeCompletionContext &getCompletionContext() const {
259 Sema &getSema() const { return SemaRef; }
262 CodeCompletionAllocator &getAllocator() const { return Allocator; }
264 CodeCompletionTUInfo &getCodeCompletionTUInfo() const { return CCTUInfo; }
273 bool isInterestingDecl(const NamedDecl *ND,
274 bool &AsNestedNameSpecifier) const;
283 const NamedDecl *Hiding);
318 void Ignore(const Decl *D) { AllDeclsFound.insert(D->getCanonicalDecl()); }
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;
348 llvm::PointerUnion<const NamedDecl *, const DeclIndexPair *> DeclOrIterator;
361 pointer(const DeclIndexPair &Value) : Value(Value) { }
363 const DeclIndexPair *operator->() const {
370 iterator(const NamedDecl *SingleDecl, unsigned Index)
373 iterator(const DeclIndexPair *Iterator)
377 if (DeclOrIterator.is<const NamedDecl *>()) {
383 const DeclIndexPair *I = DeclOrIterator.get<const DeclIndexPair*>();
395 reference operator*() const {
396 if (const NamedDecl *ND = DeclOrIterator.dyn_cast<const NamedDecl *>())
399 return *DeclOrIterator.get<const DeclIndexPair*>();
402 pointer operator->() const {
406 friend bool operator==(const iterator &X, const iterator &Y) {
412 friend bool operator!=(const iterator &X, const iterator &Y) {
418 ResultBuilder::ShadowMapEntry::begin() const {
422 if (const NamedDecl *ND = DeclOrVector.dyn_cast<const NamedDecl *>())
429 ResultBuilder::ShadowMapEntry::end() const {
430 if (DeclOrVector.is<const NamedDecl *>() || DeclOrVector.isNull())
451 const DeclContext *CurContext,
452 const DeclContext *TargetContext) {
453 const DeclContext *, 4> TargetParents;
455 for (const DeclContext *CommonAncestor = TargetContext;
467 const DeclContext *Parent = TargetParents.pop_back_val();
469 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(Parent)) {
475 else if (const TagDecl *TD = dyn_cast<TagDecl>(Parent))
485 static bool isReservedName(const IdentifierInfo *Id) {
488 const char *Name = Id->getNameStart();
493 bool ResultBuilder::isInterestingDecl(const NamedDecl *ND,
494 bool &AsNestedNameSpecifier) const {
521 if (const IdentifierInfo *Id = ND->getIdentifier())
554 const NamedDecl *Hiding) {
561 const DeclContext *HiddenCtx =
653 QualType clang::getDeclUsageType(ASTContext &C, const NamedDecl *ND) {
656 if (const TypeDecl *Type = dyn_cast<TypeDecl>(ND))
658 if (const ObjCInterfaceDecl *Iface = dyn_cast<ObjCInterfaceDecl>(ND))
662 if (const FunctionDecl *Function = ND->getAsFunction())
664 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND))
666 else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND))
668 else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND))
670 else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND))
679 if (const ReferenceType *Ref = T->getAs<ReferenceType>()) {
684 if (const PointerType *Pointer = T->getAs<PointerType>()) {
693 if (const BlockPointerType *Block = T->getAs<BlockPointerType>()) {
698 if (const FunctionType *Function = T->getAs<FunctionType>()) {
709 unsigned ResultBuilder::getBasePriority(const NamedDecl *ND) {
714 const DeclContext *LexicalDC = ND->getLexicalDeclContext();
717 if (const ImplicitParamDecl *ImplicitParam =
726 const DeclContext *DC = ND->getDeclContext()->getRedeclContext();
752 if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(R.Declaration))
780 const NamedDecl *D = R.Declaration;
781 const CXXRecordDecl *Record = nullptr;
782 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(D))
822 if (const UsingShadowDecl *Using =
831 const Decl *CanonDecl = R.Declaration->getCanonicalDecl();
851 const NamedDecl *ND = I->first;
910 const DeclContext *Ctx = R.Declaration->getDeclContext();
911 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(Ctx))
914 else if (const TagDecl *Tag = dyn_cast<TagDecl>(Ctx))
939 const UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(R.Declaration)) {
976 const DeclContext *Ctx = R.Declaration->getDeclContext();
977 if (const NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(Ctx))
980 else if (const TagDecl *Tag = dyn_cast<TagDecl>(Ctx))
994 if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(R.Declaration))
1036 bool ResultBuilder::IsOrdinaryName(const NamedDecl *ND) const {
1054 bool ResultBuilder::IsOrdinaryNonTypeName(const NamedDecl *ND) const {
1070 bool ResultBuilder::IsIntegralConstantValue(const NamedDecl *ND) const {
1074 if (const ValueDecl *VD = dyn_cast<ValueDecl>(ND->getUnderlyingDecl()))
1083 bool ResultBuilder::IsOrdinaryNonValueName(const NamedDecl *ND) const {
1097 bool ResultBuilder::IsNestedNameSpecifier(const NamedDecl *ND) const {
1099 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1106 bool ResultBuilder::IsEnum(const NamedDecl *ND) const {
1111 bool ResultBuilder::IsClassOrStruct(const NamedDecl *ND) const {
1113 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1117 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND))
1126 bool ResultBuilder::IsUnion(const NamedDecl *ND) const {
1128 if (const ClassTemplateDecl *ClassTemplate = dyn_cast<ClassTemplateDecl>(ND))
1131 if (const RecordDecl *RD = dyn_cast<RecordDecl>(ND))
1138 bool ResultBuilder::IsNamespace(const NamedDecl *ND) const {
1144 bool ResultBuilder::IsNamespaceOrAlias(const NamedDecl *ND) const {
1149 bool ResultBuilder::IsType(const NamedDecl *ND) const {
1150 if (const UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
1159 bool ResultBuilder::IsMember(const NamedDecl *ND) const {
1160 if (const UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
1200 bool ResultBuilder::IsObjCMessageReceiver(const NamedDecl *ND) const {
1209 bool ResultBuilder::IsObjCMessageReceiverOrLambdaCapture(const NamedDecl *ND) const {
1213 const VarDecl *Var = dyn_cast<VarDecl>(ND);
1220 bool ResultBuilder::IsObjCCollection(const NamedDecl *ND) const {
1235 bool ResultBuilder::IsImpossibleToSatisfy(const NamedDecl *ND) const {
1241 bool ResultBuilder::IsObjCIvar(const NamedDecl *ND) const {
1270 static void AddTypeSpecifierResults(const LangOptions &LangOpts,
1285 Results.AddResult(Result("const", CCP_Type));
1352 const LangOptions &LangOpts,
1363 const LangOptions &LangOpts,
1400 static void AddObjCVisibilityResults(const LangOptions &LangOpts,
1403 static void AddObjCImplementationResults(const LangOptions &LangOpts,
1406 static void AddObjCInterfaceResults(const LangOptions &LangOpts,
1423 const LangOptions &LangOpts) {
1452 static PrintingPolicy getCompletionPrintingPolicy(const ASTContext &Context,
1453 const Preprocessor &PP) {
1471 static const char *GetCompletionTypeString(QualType T,
1473 const PrintingPolicy &Policy,
1477 if (const BuiltinType *BT = dyn_cast<BuiltinType>(T))
1481 if (const TagType *TagT = dyn_cast<TagType>(T))
2058 const PrintingPolicy &Policy,
2059 const NamedDecl *ND,
2072 if (const FunctionDecl *Function = ND->getAsFunction())
2074 else if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) {
2079 } else if (const EnumConstantDecl *Enumerator = dyn_cast<EnumConstantDecl>(ND))
2083 } else if (const ObjCIvarDecl *Ivar = dyn_cast<ObjCIvarDecl>(ND)) {
2088 } else if (const ValueDecl *Value = dyn_cast<ValueDecl>(ND)) {
2090 } else if (const ObjCPropertyDecl *Property = dyn_cast<ObjCPropertyDecl>(ND)) {
2105 const NamedDecl *FunctionOrMethod,
2153 static std::string FormatFunctionParameter(const PrintingPolicy &Policy,
2154 const ParmVarDecl *Param,
2302 const PrintingPolicy &Policy,
2303 const FunctionDecl *Function,
2310 const ParmVarDecl *Param = Function->getParamDecl(P);
2342 if (const FunctionProtoType *Proto
2354 const PrintingPolicy &Policy,
2355 const TemplateDecl *Template,
2440 const PrintingPolicy &Policy) {
2457 const FunctionDecl *Function) {
2458 const FunctionProtoType *Proto
2466 if (Proto->getTypeQuals() == Qualifiers::Const) {
2467 Result.AddInformativeChunk(" const");
2484 QualsStr += " const";
2493 static void AddTypedNameChunk(ASTContext &Context, const PrintingPolicy &Policy,
2494 const NamedDecl *ND,
2502 const char *OperatorName = nullptr;
2543 if (const RecordType *RecordTy = Ty->getAs<RecordType>())
2545 else if (const InjectedClassNameType *InjectedTy
2567 const CodeCompletionContext &CCContext,
2584 const CodeCompletionContext &CCContext,
2602 const NamedDecl *ND = Declaration;
2603 if (const ObjCMethodDecl *M = dyn_cast<ObjCMethodDecl>(ND))
2605 if (const ObjCPropertyDecl *PDecl = M->findPropertyDecl())
2608 if (const RawComment *RC =
2613 else if (const RawComment *RC =
2630 const MacroInfo *MI = PP.getMacroInfo(Macro);
2673 const NamedDecl *ND = Declaration;
2678 if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(ND)) {
2681 else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND))
2683 if (const ObjCPropertyDecl *PDecl = OMD->findPropertyDecl())
2684 if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(PDecl))
2695 for (const auto *I : ND->specific_attrs<AnnotateAttr>())
2700 if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(ND)) {
2711 if (const FunctionTemplateDecl *FunTmpl = dyn_cast<FunctionTemplateDecl>(ND)) {
2765 if (const TemplateDecl *Template = dyn_cast<TemplateDecl>(ND)) {
2776 if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(ND)) {
2878 const PrintingPolicy &Policy,
2879 const FunctionDecl *Function,
2880 const FunctionProtoType *Prototype,
2945 bool IncludeBriefComments) const {
2951 const FunctionProtoType *Proto
2956 const FunctionType *FT = getFunctionType();
2988 const LangOptions &LangOpts,
3011 CXCursorKind clang::getCursorKindForDecl(const Decl *D) {
3074 if (const TagDecl *TD = dyn_cast<TagDecl>(D)) {
3115 static void AddPrettyFunctionResults(const LangOptions &LangOpts,
3225 const CXXMethodDecl *Overridden = *M;
3423 Results.AddResult(Result("const"));
3487 const CodeCompleteExpressionData &Data) {
3563 static void AddObjCProperties(const CodeCompletionContext &CCContext,
3576 for (const auto *P : Container->properties())
3627 } else if (const ObjCCategoryDecl *Category
3652 if (const PointerType *Ptr = BaseType->getAs<PointerType>())
3681 if (const RecordType *Record = BaseType->getAs<RecordType>()) {
3715 const ObjCObjectPointerType *ObjCPtr
3730 if (const ObjCObjectPointerType *ObjCPtr
3809 Results.AddResult("const");
3937 [&](const OverloadCandidate &X, const OverloadCandidate &Y) {
4445 for (const auto &Base : ClassDecl->bases()) {
4469 for (const auto &Base : ClassDecl->vbases()) {
4544 for (const auto &C : Intro.Captures) {
4555 for (const auto *D : S->decls()) {
4556 const auto *Var = dyn_cast<VarDecl>(D);
4582 static void AddObjCImplementationResults(const LangOptions &LangOpts,
4606 static void AddObjCInterfaceResults(const LangOptions &LangOpts,
4699 const char *EncodeType = "char[]";
4702 EncodeType = "const char[]";
4804 static void AddObjCVisibilityResults(const LangOptions &LangOpts,
5052 const ObjCList<ObjCProtocolDecl> &Protocols
5077 const ObjCList<ObjCProtocolDecl> &Protocols
5265 if (const ObjCObjectType *ObjType
5272 if (const ObjCObjectPointerType *Ptr = T->getAs<ObjCObjectPointerType>())
5348 for (const auto *Cat : Class->known_categories()) {
5502 if (const ObjCObjectType *Iface
5546 const ObjCMethodDecl *Method = cast<ObjCMethodDecl>(R.Declaration);
5579 if (const ObjCObjectType *Interface = T->getAs<ObjCObjectType>())
5757 else if (const ObjCObjectPointerType *QualID
5765 else if (const ObjCObjectPointerType *IFacePtr
5920 for (const auto *D : Ctx->decls()) {
5922 if (const auto *Proto = dyn_cast<ObjCProtocolDecl>(D))
5986 for (const auto *D : Ctx->decls()) {
5988 if (const auto *Class = dyn_cast<ObjCInterfaceDecl>(D))
6075 for (const auto *Cat : Class->visible_categories())
6082 for (const auto *D : TU->decls())
6083 if (const auto *Category = dyn_cast<ObjCCategoryDecl>(D))
6120 for (const auto *Cat : Class->visible_categories()) {
6153 for (const auto *D : Container->decls())
6154 if (const auto *PropertyImpl = dyn_cast<ObjCPropertyImplDecl>(D))
6293 const ObjCList<ObjCProtocolDecl> &Protocols
6316 const ObjCList<ObjCProtocolDecl> &Protocols
6339 const ObjCList<ObjCProtocolDecl> &Protocols
6368 const PrintingPolicy &Policy,
6419 const char *CopiedKey;
6424 operator const char *() {
6509 if (const ObjCObjectPointerType *ObjCPointer