• Home
  • Raw
  • Download

Lines Matching refs:D

48     uint64_t Emit(Decl *D) {  in Emit()  argument
51 D->getDeclKindName() + "'"); in Emit()
55 void Visit(Decl *D);
57 void VisitDecl(Decl *D);
58 void VisitPragmaCommentDecl(PragmaCommentDecl *D);
59 void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D);
60 void VisitTranslationUnitDecl(TranslationUnitDecl *D);
61 void VisitNamedDecl(NamedDecl *D);
63 void VisitNamespaceDecl(NamespaceDecl *D);
64 void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
65 void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
66 void VisitTypeDecl(TypeDecl *D);
67 void VisitTypedefNameDecl(TypedefNameDecl *D);
68 void VisitTypedefDecl(TypedefDecl *D);
69 void VisitTypeAliasDecl(TypeAliasDecl *D);
70 void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
71 void VisitTagDecl(TagDecl *D);
72 void VisitEnumDecl(EnumDecl *D);
73 void VisitRecordDecl(RecordDecl *D);
74 void VisitCXXRecordDecl(CXXRecordDecl *D);
76 ClassTemplateSpecializationDecl *D);
78 ClassTemplatePartialSpecializationDecl *D);
79 void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D);
81 VarTemplatePartialSpecializationDecl *D);
83 ClassScopeFunctionSpecializationDecl *D);
84 void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);
85 void VisitValueDecl(ValueDecl *D);
86 void VisitEnumConstantDecl(EnumConstantDecl *D);
87 void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
88 void VisitDeclaratorDecl(DeclaratorDecl *D);
89 void VisitFunctionDecl(FunctionDecl *D);
90 void VisitCXXMethodDecl(CXXMethodDecl *D);
91 void VisitCXXConstructorDecl(CXXConstructorDecl *D);
92 void VisitCXXDestructorDecl(CXXDestructorDecl *D);
93 void VisitCXXConversionDecl(CXXConversionDecl *D);
94 void VisitFieldDecl(FieldDecl *D);
95 void VisitMSPropertyDecl(MSPropertyDecl *D);
96 void VisitIndirectFieldDecl(IndirectFieldDecl *D);
97 void VisitVarDecl(VarDecl *D);
98 void VisitImplicitParamDecl(ImplicitParamDecl *D);
99 void VisitParmVarDecl(ParmVarDecl *D);
100 void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);
101 void VisitTemplateDecl(TemplateDecl *D);
102 void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D);
103 void VisitClassTemplateDecl(ClassTemplateDecl *D);
104 void VisitVarTemplateDecl(VarTemplateDecl *D);
105 void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
106 void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
107 void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
108 void VisitUsingDecl(UsingDecl *D);
109 void VisitUsingShadowDecl(UsingShadowDecl *D);
110 void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D);
111 void VisitLinkageSpecDecl(LinkageSpecDecl *D);
112 void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
113 void VisitImportDecl(ImportDecl *D);
114 void VisitAccessSpecDecl(AccessSpecDecl *D);
115 void VisitFriendDecl(FriendDecl *D);
116 void VisitFriendTemplateDecl(FriendTemplateDecl *D);
117 void VisitStaticAssertDecl(StaticAssertDecl *D);
118 void VisitBlockDecl(BlockDecl *D);
119 void VisitCapturedDecl(CapturedDecl *D);
120 void VisitEmptyDecl(EmptyDecl *D);
123 template <typename T> void VisitRedeclarable(Redeclarable<T> *D);
127 void VisitObjCMethodDecl(ObjCMethodDecl *D);
128 void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D);
129 void VisitObjCContainerDecl(ObjCContainerDecl *D);
130 void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
131 void VisitObjCIvarDecl(ObjCIvarDecl *D);
132 void VisitObjCProtocolDecl(ObjCProtocolDecl *D);
133 void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D);
134 void VisitObjCCategoryDecl(ObjCCategoryDecl *D);
135 void VisitObjCImplDecl(ObjCImplDecl *D);
136 void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
137 void VisitObjCImplementationDecl(ObjCImplementationDecl *D);
138 void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);
139 void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
140 void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
141 void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D);
142 void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D);
143 void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D);
164 void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal) { in AddFirstDeclFromEachModule() argument
167 for (const Decl *R = D->getMostRecentDecl(); R; R = R->getPreviousDecl()) { in AddFirstDeclFromEachModule()
194 void AddTemplateSpecializations(DeclTy *D) { in AddTemplateSpecializations() argument
195 auto *Common = D->getCommonPtr(); in AddTemplateSpecializations()
202 D->LoadLazySpecializations(); in AddTemplateSpecializations()
222 for (auto *D : Specs) { in AddTemplateSpecializations() local
223 assert(D->isCanonicalDecl() && "non-canonical decl in set"); in AddTemplateSpecializations()
224 AddFirstDeclFromEachModule(D, /*IncludeLocal*/true); in AddTemplateSpecializations()
256 void ASTDeclWriter::Visit(Decl *D) { in Visit() argument
257 DeclVisitor<ASTDeclWriter>::Visit(D); in Visit()
262 if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)) { in Visit()
269 if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in Visit()
278 if (DeclContext *DC = dyn_cast<DeclContext>(D)) in Visit()
282 void ASTDeclWriter::VisitDecl(Decl *D) { in VisitDecl() argument
283 Record.AddDeclRef(cast_or_null<Decl>(D->getDeclContext())); in VisitDecl()
284 if (D->getDeclContext() != D->getLexicalDeclContext()) in VisitDecl()
285 Record.AddDeclRef(cast_or_null<Decl>(D->getLexicalDeclContext())); in VisitDecl()
288 Record.push_back(D->isInvalidDecl()); in VisitDecl()
289 Record.push_back(D->hasAttrs()); in VisitDecl()
290 if (D->hasAttrs()) in VisitDecl()
291 Record.AddAttributes(D->getAttrs()); in VisitDecl()
292 Record.push_back(D->isImplicit()); in VisitDecl()
293 Record.push_back(D->isUsed(false)); in VisitDecl()
294 Record.push_back(D->isReferenced()); in VisitDecl()
295 Record.push_back(D->isTopLevelDeclInObjCContainer()); in VisitDecl()
296 Record.push_back(D->getAccess()); in VisitDecl()
297 Record.push_back(D->isModulePrivate()); in VisitDecl()
298 Record.push_back(Writer.inferSubmoduleIDFromLocation(D->getLocation())); in VisitDecl()
308 if (D->isOutOfLine()) { in VisitDecl()
309 auto *DC = D->getDeclContext(); in VisitDecl()
321 void ASTDeclWriter::VisitPragmaCommentDecl(PragmaCommentDecl *D) { in VisitPragmaCommentDecl() argument
322 StringRef Arg = D->getArg(); in VisitPragmaCommentDecl()
324 VisitDecl(D); in VisitPragmaCommentDecl()
325 Record.AddSourceLocation(D->getLocStart()); in VisitPragmaCommentDecl()
326 Record.push_back(D->getCommentKind()); in VisitPragmaCommentDecl()
332 PragmaDetectMismatchDecl *D) { in VisitPragmaDetectMismatchDecl() argument
333 StringRef Name = D->getName(); in VisitPragmaDetectMismatchDecl()
334 StringRef Value = D->getValue(); in VisitPragmaDetectMismatchDecl()
336 VisitDecl(D); in VisitPragmaDetectMismatchDecl()
337 Record.AddSourceLocation(D->getLocStart()); in VisitPragmaDetectMismatchDecl()
343 void ASTDeclWriter::VisitTranslationUnitDecl(TranslationUnitDecl *D) { in VisitTranslationUnitDecl() argument
347 void ASTDeclWriter::VisitNamedDecl(NamedDecl *D) { in VisitNamedDecl() argument
348 VisitDecl(D); in VisitNamedDecl()
349 Record.AddDeclarationName(D->getDeclName()); in VisitNamedDecl()
350 Record.push_back(needsAnonymousDeclarationNumber(D) in VisitNamedDecl()
351 ? Writer.getAnonymousDeclarationNumber(D) in VisitNamedDecl()
355 void ASTDeclWriter::VisitTypeDecl(TypeDecl *D) { in VisitTypeDecl() argument
356 VisitNamedDecl(D); in VisitTypeDecl()
357 Record.AddSourceLocation(D->getLocStart()); in VisitTypeDecl()
358 Record.AddTypeRef(QualType(D->getTypeForDecl(), 0)); in VisitTypeDecl()
361 void ASTDeclWriter::VisitTypedefNameDecl(TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
362 VisitRedeclarable(D); in VisitTypedefNameDecl()
363 VisitTypeDecl(D); in VisitTypedefNameDecl()
364 Record.AddTypeSourceInfo(D->getTypeSourceInfo()); in VisitTypedefNameDecl()
365 Record.push_back(D->isModed()); in VisitTypedefNameDecl()
366 if (D->isModed()) in VisitTypedefNameDecl()
367 Record.AddTypeRef(D->getUnderlyingType()); in VisitTypedefNameDecl()
370 void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { in VisitTypedefDecl() argument
371 VisitTypedefNameDecl(D); in VisitTypedefDecl()
372 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitTypedefDecl()
373 !D->hasAttrs() && in VisitTypedefDecl()
374 !D->isImplicit() && in VisitTypedefDecl()
375 D->getFirstDecl() == D->getMostRecentDecl() && in VisitTypedefDecl()
376 !D->isInvalidDecl() && in VisitTypedefDecl()
377 !D->isTopLevelDeclInObjCContainer() && in VisitTypedefDecl()
378 !D->isModulePrivate() && in VisitTypedefDecl()
379 !needsAnonymousDeclarationNumber(D) && in VisitTypedefDecl()
380 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitTypedefDecl()
386 void ASTDeclWriter::VisitTypeAliasDecl(TypeAliasDecl *D) { in VisitTypeAliasDecl() argument
387 VisitTypedefNameDecl(D); in VisitTypeAliasDecl()
388 Record.AddDeclRef(D->getDescribedAliasTemplate()); in VisitTypeAliasDecl()
392 void ASTDeclWriter::VisitTagDecl(TagDecl *D) { in VisitTagDecl() argument
393 VisitRedeclarable(D); in VisitTagDecl()
394 VisitTypeDecl(D); in VisitTagDecl()
395 Record.push_back(D->getIdentifierNamespace()); in VisitTagDecl()
396 Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding in VisitTagDecl()
397 if (!isa<CXXRecordDecl>(D)) in VisitTagDecl()
398 Record.push_back(D->isCompleteDefinition()); in VisitTagDecl()
399 Record.push_back(D->isEmbeddedInDeclarator()); in VisitTagDecl()
400 Record.push_back(D->isFreeStanding()); in VisitTagDecl()
401 Record.push_back(D->isCompleteDefinitionRequired()); in VisitTagDecl()
402 Record.AddSourceLocation(D->getRBraceLoc()); in VisitTagDecl()
404 if (D->hasExtInfo()) { in VisitTagDecl()
406 Record.AddQualifierInfo(*D->getExtInfo()); in VisitTagDecl()
407 } else if (auto *TD = D->getTypedefNameForAnonDecl()) { in VisitTagDecl()
416 void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) { in VisitEnumDecl() argument
417 VisitTagDecl(D); in VisitEnumDecl()
418 Record.AddTypeSourceInfo(D->getIntegerTypeSourceInfo()); in VisitEnumDecl()
419 if (!D->getIntegerTypeSourceInfo()) in VisitEnumDecl()
420 Record.AddTypeRef(D->getIntegerType()); in VisitEnumDecl()
421 Record.AddTypeRef(D->getPromotionType()); in VisitEnumDecl()
422 Record.push_back(D->getNumPositiveBits()); in VisitEnumDecl()
423 Record.push_back(D->getNumNegativeBits()); in VisitEnumDecl()
424 Record.push_back(D->isScoped()); in VisitEnumDecl()
425 Record.push_back(D->isScopedUsingClassTag()); in VisitEnumDecl()
426 Record.push_back(D->isFixed()); in VisitEnumDecl()
427 if (MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo()) { in VisitEnumDecl()
435 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitEnumDecl()
436 !D->hasAttrs() && in VisitEnumDecl()
437 !D->isImplicit() && in VisitEnumDecl()
438 !D->isUsed(false) && in VisitEnumDecl()
439 !D->hasExtInfo() && in VisitEnumDecl()
440 !D->getTypedefNameForAnonDecl() && in VisitEnumDecl()
441 D->getFirstDecl() == D->getMostRecentDecl() && in VisitEnumDecl()
442 !D->isInvalidDecl() && in VisitEnumDecl()
443 !D->isReferenced() && in VisitEnumDecl()
444 !D->isTopLevelDeclInObjCContainer() && in VisitEnumDecl()
445 D->getAccess() == AS_none && in VisitEnumDecl()
446 !D->isModulePrivate() && in VisitEnumDecl()
447 !CXXRecordDecl::classofKind(D->getKind()) && in VisitEnumDecl()
448 !D->getIntegerTypeSourceInfo() && in VisitEnumDecl()
449 !D->getMemberSpecializationInfo() && in VisitEnumDecl()
450 !needsAnonymousDeclarationNumber(D) && in VisitEnumDecl()
451 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitEnumDecl()
457 void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) { in VisitRecordDecl() argument
458 VisitTagDecl(D); in VisitRecordDecl()
459 Record.push_back(D->hasFlexibleArrayMember()); in VisitRecordDecl()
460 Record.push_back(D->isAnonymousStructOrUnion()); in VisitRecordDecl()
461 Record.push_back(D->hasObjectMember()); in VisitRecordDecl()
462 Record.push_back(D->hasVolatileMember()); in VisitRecordDecl()
464 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitRecordDecl()
465 !D->hasAttrs() && in VisitRecordDecl()
466 !D->isImplicit() && in VisitRecordDecl()
467 !D->isUsed(false) && in VisitRecordDecl()
468 !D->hasExtInfo() && in VisitRecordDecl()
469 !D->getTypedefNameForAnonDecl() && in VisitRecordDecl()
470 D->getFirstDecl() == D->getMostRecentDecl() && in VisitRecordDecl()
471 !D->isInvalidDecl() && in VisitRecordDecl()
472 !D->isReferenced() && in VisitRecordDecl()
473 !D->isTopLevelDeclInObjCContainer() && in VisitRecordDecl()
474 D->getAccess() == AS_none && in VisitRecordDecl()
475 !D->isModulePrivate() && in VisitRecordDecl()
476 !CXXRecordDecl::classofKind(D->getKind()) && in VisitRecordDecl()
477 !needsAnonymousDeclarationNumber(D) && in VisitRecordDecl()
478 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitRecordDecl()
484 void ASTDeclWriter::VisitValueDecl(ValueDecl *D) { in VisitValueDecl() argument
485 VisitNamedDecl(D); in VisitValueDecl()
486 Record.AddTypeRef(D->getType()); in VisitValueDecl()
489 void ASTDeclWriter::VisitEnumConstantDecl(EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
490 VisitValueDecl(D); in VisitEnumConstantDecl()
491 Record.push_back(D->getInitExpr()? 1 : 0); in VisitEnumConstantDecl()
492 if (D->getInitExpr()) in VisitEnumConstantDecl()
493 Record.AddStmt(D->getInitExpr()); in VisitEnumConstantDecl()
494 Record.AddAPSInt(D->getInitVal()); in VisitEnumConstantDecl()
499 void ASTDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) { in VisitDeclaratorDecl() argument
500 VisitValueDecl(D); in VisitDeclaratorDecl()
501 Record.AddSourceLocation(D->getInnerLocStart()); in VisitDeclaratorDecl()
502 Record.push_back(D->hasExtInfo()); in VisitDeclaratorDecl()
503 if (D->hasExtInfo()) in VisitDeclaratorDecl()
504 Record.AddQualifierInfo(*D->getExtInfo()); in VisitDeclaratorDecl()
507 void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { in VisitFunctionDecl() argument
508 VisitRedeclarable(D); in VisitFunctionDecl()
509 VisitDeclaratorDecl(D); in VisitFunctionDecl()
510 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName()); in VisitFunctionDecl()
511 Record.push_back(D->getIdentifierNamespace()); in VisitFunctionDecl()
516 Record.push_back((int)D->SClass); // FIXME: stable encoding in VisitFunctionDecl()
517 Record.push_back(D->IsInline); in VisitFunctionDecl()
518 Record.push_back(D->IsInlineSpecified); in VisitFunctionDecl()
519 Record.push_back(D->IsVirtualAsWritten); in VisitFunctionDecl()
520 Record.push_back(D->IsPure); in VisitFunctionDecl()
521 Record.push_back(D->HasInheritedPrototype); in VisitFunctionDecl()
522 Record.push_back(D->HasWrittenPrototype); in VisitFunctionDecl()
523 Record.push_back(D->IsDeleted); in VisitFunctionDecl()
524 Record.push_back(D->IsTrivial); in VisitFunctionDecl()
525 Record.push_back(D->IsDefaulted); in VisitFunctionDecl()
526 Record.push_back(D->IsExplicitlyDefaulted); in VisitFunctionDecl()
527 Record.push_back(D->HasImplicitReturnZero); in VisitFunctionDecl()
528 Record.push_back(D->IsConstexpr); in VisitFunctionDecl()
529 Record.push_back(D->HasSkippedBody); in VisitFunctionDecl()
530 Record.push_back(D->IsLateTemplateParsed); in VisitFunctionDecl()
531 Record.push_back(D->getLinkageInternal()); in VisitFunctionDecl()
532 Record.AddSourceLocation(D->getLocEnd()); in VisitFunctionDecl()
534 Record.push_back(D->getTemplatedKind()); in VisitFunctionDecl()
535 switch (D->getTemplatedKind()) { in VisitFunctionDecl()
539 Record.AddDeclRef(D->getDescribedFunctionTemplate()); in VisitFunctionDecl()
542 MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo(); in VisitFunctionDecl()
550 FTSInfo = D->getTemplateSpecializationInfo(); in VisitFunctionDecl()
552 RegisterTemplateSpecialization(FTSInfo->getTemplate(), D); in VisitFunctionDecl()
574 if (D->isCanonicalDecl()) { in VisitFunctionDecl()
583 DFTSInfo = D->getDependentSpecializationInfo(); in VisitFunctionDecl()
600 Record.push_back(D->param_size()); in VisitFunctionDecl()
601 for (auto P : D->parameters()) in VisitFunctionDecl()
606 void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
607 VisitNamedDecl(D); in VisitObjCMethodDecl()
610 bool HasBodyStuff = D->getBody() != nullptr || in VisitObjCMethodDecl()
611 D->getSelfDecl() != nullptr || D->getCmdDecl() != nullptr; in VisitObjCMethodDecl()
614 Record.AddStmt(D->getBody()); in VisitObjCMethodDecl()
615 Record.AddDeclRef(D->getSelfDecl()); in VisitObjCMethodDecl()
616 Record.AddDeclRef(D->getCmdDecl()); in VisitObjCMethodDecl()
618 Record.push_back(D->isInstanceMethod()); in VisitObjCMethodDecl()
619 Record.push_back(D->isVariadic()); in VisitObjCMethodDecl()
620 Record.push_back(D->isPropertyAccessor()); in VisitObjCMethodDecl()
621 Record.push_back(D->isDefined()); in VisitObjCMethodDecl()
622 Record.push_back(D->IsOverriding); in VisitObjCMethodDecl()
623 Record.push_back(D->HasSkippedBody); in VisitObjCMethodDecl()
625 Record.push_back(D->IsRedeclaration); in VisitObjCMethodDecl()
626 Record.push_back(D->HasRedeclaration); in VisitObjCMethodDecl()
627 if (D->HasRedeclaration) { in VisitObjCMethodDecl()
628 assert(Context.getObjCMethodRedeclaration(D)); in VisitObjCMethodDecl()
629 Record.AddDeclRef(Context.getObjCMethodRedeclaration(D)); in VisitObjCMethodDecl()
633 Record.push_back(D->getImplementationControl()); in VisitObjCMethodDecl()
635 Record.push_back(D->getObjCDeclQualifier()); in VisitObjCMethodDecl()
636 Record.push_back(D->hasRelatedResultType()); in VisitObjCMethodDecl()
637 Record.AddTypeRef(D->getReturnType()); in VisitObjCMethodDecl()
638 Record.AddTypeSourceInfo(D->getReturnTypeSourceInfo()); in VisitObjCMethodDecl()
639 Record.AddSourceLocation(D->getLocEnd()); in VisitObjCMethodDecl()
640 Record.push_back(D->param_size()); in VisitObjCMethodDecl()
641 for (const auto *P : D->parameters()) in VisitObjCMethodDecl()
644 Record.push_back(D->SelLocsKind); in VisitObjCMethodDecl()
645 unsigned NumStoredSelLocs = D->getNumStoredSelLocs(); in VisitObjCMethodDecl()
646 SourceLocation *SelLocs = D->getStoredSelLocs(); in VisitObjCMethodDecl()
654 void ASTDeclWriter::VisitObjCTypeParamDecl(ObjCTypeParamDecl *D) { in VisitObjCTypeParamDecl() argument
655 VisitTypedefNameDecl(D); in VisitObjCTypeParamDecl()
656 Record.push_back(D->Variance); in VisitObjCTypeParamDecl()
657 Record.push_back(D->Index); in VisitObjCTypeParamDecl()
658 Record.AddSourceLocation(D->VarianceLoc); in VisitObjCTypeParamDecl()
659 Record.AddSourceLocation(D->ColonLoc); in VisitObjCTypeParamDecl()
664 void ASTDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) { in VisitObjCContainerDecl() argument
665 VisitNamedDecl(D); in VisitObjCContainerDecl()
666 Record.AddSourceLocation(D->getAtStartLoc()); in VisitObjCContainerDecl()
667 Record.AddSourceRange(D->getAtEndRange()); in VisitObjCContainerDecl()
671 void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
672 VisitRedeclarable(D); in VisitObjCInterfaceDecl()
673 VisitObjCContainerDecl(D); in VisitObjCInterfaceDecl()
674 Record.AddTypeRef(QualType(D->getTypeForDecl(), 0)); in VisitObjCInterfaceDecl()
675 AddObjCTypeParamList(D->TypeParamList); in VisitObjCInterfaceDecl()
677 Record.push_back(D->isThisDeclarationADefinition()); in VisitObjCInterfaceDecl()
678 if (D->isThisDeclarationADefinition()) { in VisitObjCInterfaceDecl()
680 ObjCInterfaceDecl::DefinitionData &Data = D->data(); in VisitObjCInterfaceDecl()
682 Record.AddTypeSourceInfo(D->getSuperClassTInfo()); in VisitObjCInterfaceDecl()
683 Record.AddSourceLocation(D->getEndOfDefinitionLoc()); in VisitObjCInterfaceDecl()
688 for (const auto *P : D->protocols()) in VisitObjCInterfaceDecl()
690 for (const auto &PL : D->protocol_locs()) in VisitObjCInterfaceDecl()
702 if (ObjCCategoryDecl *Cat = D->getCategoryListRaw()) { in VisitObjCInterfaceDecl()
704 Writer.ObjCClassesWithCategories.insert(D); in VisitObjCInterfaceDecl()
715 void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { in VisitObjCIvarDecl() argument
716 VisitFieldDecl(D); in VisitObjCIvarDecl()
718 Record.push_back(D->getAccessControl()); in VisitObjCIvarDecl()
719 Record.push_back(D->getSynthesize()); in VisitObjCIvarDecl()
721 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitObjCIvarDecl()
722 !D->hasAttrs() && in VisitObjCIvarDecl()
723 !D->isImplicit() && in VisitObjCIvarDecl()
724 !D->isUsed(false) && in VisitObjCIvarDecl()
725 !D->isInvalidDecl() && in VisitObjCIvarDecl()
726 !D->isReferenced() && in VisitObjCIvarDecl()
727 !D->isModulePrivate() && in VisitObjCIvarDecl()
728 !D->getBitWidth() && in VisitObjCIvarDecl()
729 !D->hasExtInfo() && in VisitObjCIvarDecl()
730 D->getDeclName()) in VisitObjCIvarDecl()
736 void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
737 VisitRedeclarable(D); in VisitObjCProtocolDecl()
738 VisitObjCContainerDecl(D); in VisitObjCProtocolDecl()
740 Record.push_back(D->isThisDeclarationADefinition()); in VisitObjCProtocolDecl()
741 if (D->isThisDeclarationADefinition()) { in VisitObjCProtocolDecl()
742 Record.push_back(D->protocol_size()); in VisitObjCProtocolDecl()
743 for (const auto *I : D->protocols()) in VisitObjCProtocolDecl()
745 for (const auto &PL : D->protocol_locs()) in VisitObjCProtocolDecl()
752 void ASTDeclWriter::VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D) { in VisitObjCAtDefsFieldDecl() argument
753 VisitFieldDecl(D); in VisitObjCAtDefsFieldDecl()
757 void ASTDeclWriter::VisitObjCCategoryDecl(ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
758 VisitObjCContainerDecl(D); in VisitObjCCategoryDecl()
759 Record.AddSourceLocation(D->getCategoryNameLoc()); in VisitObjCCategoryDecl()
760 Record.AddSourceLocation(D->getIvarLBraceLoc()); in VisitObjCCategoryDecl()
761 Record.AddSourceLocation(D->getIvarRBraceLoc()); in VisitObjCCategoryDecl()
762 Record.AddDeclRef(D->getClassInterface()); in VisitObjCCategoryDecl()
763 AddObjCTypeParamList(D->TypeParamList); in VisitObjCCategoryDecl()
764 Record.push_back(D->protocol_size()); in VisitObjCCategoryDecl()
765 for (const auto *I : D->protocols()) in VisitObjCCategoryDecl()
767 for (const auto &PL : D->protocol_locs()) in VisitObjCCategoryDecl()
772 void ASTDeclWriter::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D) { in VisitObjCCompatibleAliasDecl() argument
773 VisitNamedDecl(D); in VisitObjCCompatibleAliasDecl()
774 Record.AddDeclRef(D->getClassInterface()); in VisitObjCCompatibleAliasDecl()
778 void ASTDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
779 VisitNamedDecl(D); in VisitObjCPropertyDecl()
780 Record.AddSourceLocation(D->getAtLoc()); in VisitObjCPropertyDecl()
781 Record.AddSourceLocation(D->getLParenLoc()); in VisitObjCPropertyDecl()
782 Record.AddTypeRef(D->getType()); in VisitObjCPropertyDecl()
783 Record.AddTypeSourceInfo(D->getTypeSourceInfo()); in VisitObjCPropertyDecl()
785 Record.push_back((unsigned)D->getPropertyAttributes()); in VisitObjCPropertyDecl()
786 Record.push_back((unsigned)D->getPropertyAttributesAsWritten()); in VisitObjCPropertyDecl()
788 Record.push_back((unsigned)D->getPropertyImplementation()); in VisitObjCPropertyDecl()
789 Record.AddDeclarationName(D->getGetterName()); in VisitObjCPropertyDecl()
790 Record.AddDeclarationName(D->getSetterName()); in VisitObjCPropertyDecl()
791 Record.AddDeclRef(D->getGetterMethodDecl()); in VisitObjCPropertyDecl()
792 Record.AddDeclRef(D->getSetterMethodDecl()); in VisitObjCPropertyDecl()
793 Record.AddDeclRef(D->getPropertyIvarDecl()); in VisitObjCPropertyDecl()
797 void ASTDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) { in VisitObjCImplDecl() argument
798 VisitObjCContainerDecl(D); in VisitObjCImplDecl()
799 Record.AddDeclRef(D->getClassInterface()); in VisitObjCImplDecl()
803 void ASTDeclWriter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
804 VisitObjCImplDecl(D); in VisitObjCCategoryImplDecl()
805 Record.AddIdentifierRef(D->getIdentifier()); in VisitObjCCategoryImplDecl()
806 Record.AddSourceLocation(D->getCategoryNameLoc()); in VisitObjCCategoryImplDecl()
810 void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
811 VisitObjCImplDecl(D); in VisitObjCImplementationDecl()
812 Record.AddDeclRef(D->getSuperClass()); in VisitObjCImplementationDecl()
813 Record.AddSourceLocation(D->getSuperClassLoc()); in VisitObjCImplementationDecl()
814 Record.AddSourceLocation(D->getIvarLBraceLoc()); in VisitObjCImplementationDecl()
815 Record.AddSourceLocation(D->getIvarRBraceLoc()); in VisitObjCImplementationDecl()
816 Record.push_back(D->hasNonZeroConstructors()); in VisitObjCImplementationDecl()
817 Record.push_back(D->hasDestructors()); in VisitObjCImplementationDecl()
818 Record.push_back(D->NumIvarInitializers); in VisitObjCImplementationDecl()
819 if (D->NumIvarInitializers) in VisitObjCImplementationDecl()
821 llvm::makeArrayRef(D->init_begin(), D->init_end())); in VisitObjCImplementationDecl()
825 void ASTDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
826 VisitDecl(D); in VisitObjCPropertyImplDecl()
827 Record.AddSourceLocation(D->getLocStart()); in VisitObjCPropertyImplDecl()
828 Record.AddDeclRef(D->getPropertyDecl()); in VisitObjCPropertyImplDecl()
829 Record.AddDeclRef(D->getPropertyIvarDecl()); in VisitObjCPropertyImplDecl()
830 Record.AddSourceLocation(D->getPropertyIvarDeclLoc()); in VisitObjCPropertyImplDecl()
831 Record.AddStmt(D->getGetterCXXConstructor()); in VisitObjCPropertyImplDecl()
832 Record.AddStmt(D->getSetterCXXAssignment()); in VisitObjCPropertyImplDecl()
836 void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) { in VisitFieldDecl() argument
837 VisitDeclaratorDecl(D); in VisitFieldDecl()
838 Record.push_back(D->isMutable()); in VisitFieldDecl()
839 if (D->InitStorage.getInt() == FieldDecl::ISK_BitWidthOrNothing && in VisitFieldDecl()
840 D->InitStorage.getPointer() == nullptr) { in VisitFieldDecl()
842 } else if (D->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) { in VisitFieldDecl()
843 Record.push_back(D->InitStorage.getInt() + 1); in VisitFieldDecl()
845 QualType(static_cast<Type *>(D->InitStorage.getPointer()), 0)); in VisitFieldDecl()
847 Record.push_back(D->InitStorage.getInt() + 1); in VisitFieldDecl()
848 Record.AddStmt(static_cast<Expr *>(D->InitStorage.getPointer())); in VisitFieldDecl()
850 if (!D->getDeclName()) in VisitFieldDecl()
851 Record.AddDeclRef(Context.getInstantiatedFromUnnamedFieldDecl(D)); in VisitFieldDecl()
853 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitFieldDecl()
854 !D->hasAttrs() && in VisitFieldDecl()
855 !D->isImplicit() && in VisitFieldDecl()
856 !D->isUsed(false) && in VisitFieldDecl()
857 !D->isInvalidDecl() && in VisitFieldDecl()
858 !D->isReferenced() && in VisitFieldDecl()
859 !D->isTopLevelDeclInObjCContainer() && in VisitFieldDecl()
860 !D->isModulePrivate() && in VisitFieldDecl()
861 !D->getBitWidth() && in VisitFieldDecl()
862 !D->hasInClassInitializer() && in VisitFieldDecl()
863 !D->hasExtInfo() && in VisitFieldDecl()
864 !ObjCIvarDecl::classofKind(D->getKind()) && in VisitFieldDecl()
865 !ObjCAtDefsFieldDecl::classofKind(D->getKind()) && in VisitFieldDecl()
866 D->getDeclName()) in VisitFieldDecl()
872 void ASTDeclWriter::VisitMSPropertyDecl(MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
873 VisitDeclaratorDecl(D); in VisitMSPropertyDecl()
874 Record.AddIdentifierRef(D->getGetterId()); in VisitMSPropertyDecl()
875 Record.AddIdentifierRef(D->getSetterId()); in VisitMSPropertyDecl()
879 void ASTDeclWriter::VisitIndirectFieldDecl(IndirectFieldDecl *D) { in VisitIndirectFieldDecl() argument
880 VisitValueDecl(D); in VisitIndirectFieldDecl()
881 Record.push_back(D->getChainingSize()); in VisitIndirectFieldDecl()
883 for (const auto *P : D->chain()) in VisitIndirectFieldDecl()
888 void ASTDeclWriter::VisitVarDecl(VarDecl *D) { in VisitVarDecl() argument
889 VisitRedeclarable(D); in VisitVarDecl()
890 VisitDeclaratorDecl(D); in VisitVarDecl()
891 Record.push_back(D->getStorageClass()); in VisitVarDecl()
892 Record.push_back(D->getTSCSpec()); in VisitVarDecl()
893 Record.push_back(D->getInitStyle()); in VisitVarDecl()
894 if (!isa<ParmVarDecl>(D)) { in VisitVarDecl()
895 Record.push_back(D->isExceptionVariable()); in VisitVarDecl()
896 Record.push_back(D->isNRVOVariable()); in VisitVarDecl()
897 Record.push_back(D->isCXXForRangeDecl()); in VisitVarDecl()
898 Record.push_back(D->isARCPseudoStrong()); in VisitVarDecl()
899 Record.push_back(D->isInline()); in VisitVarDecl()
900 Record.push_back(D->isInlineSpecified()); in VisitVarDecl()
901 Record.push_back(D->isConstexpr()); in VisitVarDecl()
902 Record.push_back(D->isInitCapture()); in VisitVarDecl()
903 Record.push_back(D->isPreviousDeclInSameBlockScope()); in VisitVarDecl()
905 Record.push_back(D->getLinkageInternal()); in VisitVarDecl()
907 if (D->getInit()) { in VisitVarDecl()
908 Record.push_back(!D->isInitKnownICE() ? 1 : (D->isInitICE() ? 3 : 2)); in VisitVarDecl()
909 Record.AddStmt(D->getInit()); in VisitVarDecl()
917 if (VarTemplateDecl *TemplD = D->getDescribedVarTemplate()) { in VisitVarDecl()
921 = D->getMemberSpecializationInfo()) { in VisitVarDecl()
930 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitVarDecl()
931 !D->hasAttrs() && in VisitVarDecl()
932 !D->isImplicit() && in VisitVarDecl()
933 !D->isUsed(false) && in VisitVarDecl()
934 !D->isInvalidDecl() && in VisitVarDecl()
935 !D->isReferenced() && in VisitVarDecl()
936 !D->isTopLevelDeclInObjCContainer() && in VisitVarDecl()
937 D->getAccess() == AS_none && in VisitVarDecl()
938 !D->isModulePrivate() && in VisitVarDecl()
939 !needsAnonymousDeclarationNumber(D) && in VisitVarDecl()
940 D->getDeclName().getNameKind() == DeclarationName::Identifier && in VisitVarDecl()
941 !D->hasExtInfo() && in VisitVarDecl()
942 D->getFirstDecl() == D->getMostRecentDecl() && in VisitVarDecl()
943 D->getInitStyle() == VarDecl::CInit && in VisitVarDecl()
944 D->getInit() == nullptr && in VisitVarDecl()
945 !isa<ParmVarDecl>(D) && in VisitVarDecl()
946 !isa<VarTemplateSpecializationDecl>(D) && in VisitVarDecl()
947 !D->isInline() && in VisitVarDecl()
948 !D->isConstexpr() && in VisitVarDecl()
949 !D->isInitCapture() && in VisitVarDecl()
950 !D->isPreviousDeclInSameBlockScope() && in VisitVarDecl()
951 !D->getMemberSpecializationInfo()) in VisitVarDecl()
957 void ASTDeclWriter::VisitImplicitParamDecl(ImplicitParamDecl *D) { in VisitImplicitParamDecl() argument
958 VisitVarDecl(D); in VisitImplicitParamDecl()
962 void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) { in VisitParmVarDecl() argument
963 VisitVarDecl(D); in VisitParmVarDecl()
964 Record.push_back(D->isObjCMethodParameter()); in VisitParmVarDecl()
965 Record.push_back(D->getFunctionScopeDepth()); in VisitParmVarDecl()
966 Record.push_back(D->getFunctionScopeIndex()); in VisitParmVarDecl()
967 Record.push_back(D->getObjCDeclQualifier()); // FIXME: stable encoding in VisitParmVarDecl()
968 Record.push_back(D->isKNRPromoted()); in VisitParmVarDecl()
969 Record.push_back(D->hasInheritedDefaultArg()); in VisitParmVarDecl()
970 Record.push_back(D->hasUninstantiatedDefaultArg()); in VisitParmVarDecl()
971 if (D->hasUninstantiatedDefaultArg()) in VisitParmVarDecl()
972 Record.AddStmt(D->getUninstantiatedDefaultArg()); in VisitParmVarDecl()
975 assert(!D->isARCPseudoStrong()); // can be true of ImplicitParamDecl in VisitParmVarDecl()
980 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitParmVarDecl()
981 !D->hasAttrs() && in VisitParmVarDecl()
982 !D->hasExtInfo() && in VisitParmVarDecl()
983 !D->isImplicit() && in VisitParmVarDecl()
984 !D->isUsed(false) && in VisitParmVarDecl()
985 !D->isInvalidDecl() && in VisitParmVarDecl()
986 !D->isReferenced() && in VisitParmVarDecl()
987 D->getAccess() == AS_none && in VisitParmVarDecl()
988 !D->isModulePrivate() && in VisitParmVarDecl()
989 D->getStorageClass() == 0 && in VisitParmVarDecl()
990 D->getInitStyle() == VarDecl::CInit && // Can params have anything else? in VisitParmVarDecl()
991 D->getFunctionScopeDepth() == 0 && in VisitParmVarDecl()
992 D->getObjCDeclQualifier() == 0 && in VisitParmVarDecl()
993 !D->isKNRPromoted() && in VisitParmVarDecl()
994 !D->hasInheritedDefaultArg() && in VisitParmVarDecl()
995 D->getInit() == nullptr && in VisitParmVarDecl()
996 !D->hasUninstantiatedDefaultArg()) // No default expr. in VisitParmVarDecl()
1001 assert(!D->getTSCSpec() && "PARM_VAR_DECL can't use TLS"); in VisitParmVarDecl()
1002 assert(D->getAccess() == AS_none && "PARM_VAR_DECL can't be public/private"); in VisitParmVarDecl()
1003 assert(!D->isExceptionVariable() && "PARM_VAR_DECL can't be exception var"); in VisitParmVarDecl()
1004 assert(D->getPreviousDecl() == nullptr && "PARM_VAR_DECL can't be redecl"); in VisitParmVarDecl()
1005 assert(!D->isStaticDataMember() && in VisitParmVarDecl()
1009 void ASTDeclWriter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { in VisitFileScopeAsmDecl() argument
1010 VisitDecl(D); in VisitFileScopeAsmDecl()
1011 Record.AddStmt(D->getAsmString()); in VisitFileScopeAsmDecl()
1012 Record.AddSourceLocation(D->getRParenLoc()); in VisitFileScopeAsmDecl()
1016 void ASTDeclWriter::VisitEmptyDecl(EmptyDecl *D) { in VisitEmptyDecl() argument
1017 VisitDecl(D); in VisitEmptyDecl()
1021 void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { in VisitBlockDecl() argument
1022 VisitDecl(D); in VisitBlockDecl()
1023 Record.AddStmt(D->getBody()); in VisitBlockDecl()
1024 Record.AddTypeSourceInfo(D->getSignatureAsWritten()); in VisitBlockDecl()
1025 Record.push_back(D->param_size()); in VisitBlockDecl()
1026 for (ParmVarDecl *P : D->parameters()) in VisitBlockDecl()
1028 Record.push_back(D->isVariadic()); in VisitBlockDecl()
1029 Record.push_back(D->blockMissingReturnType()); in VisitBlockDecl()
1030 Record.push_back(D->isConversionFromLambda()); in VisitBlockDecl()
1031 Record.push_back(D->capturesCXXThis()); in VisitBlockDecl()
1032 Record.push_back(D->getNumCaptures()); in VisitBlockDecl()
1033 for (const auto &capture : D->captures()) { in VisitBlockDecl()
1059 void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { in VisitLinkageSpecDecl() argument
1060 VisitDecl(D); in VisitLinkageSpecDecl()
1061 Record.push_back(D->getLanguage()); in VisitLinkageSpecDecl()
1062 Record.AddSourceLocation(D->getExternLoc()); in VisitLinkageSpecDecl()
1063 Record.AddSourceLocation(D->getRBraceLoc()); in VisitLinkageSpecDecl()
1067 void ASTDeclWriter::VisitLabelDecl(LabelDecl *D) { in VisitLabelDecl() argument
1068 VisitNamedDecl(D); in VisitLabelDecl()
1069 Record.AddSourceLocation(D->getLocStart()); in VisitLabelDecl()
1074 void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) { in VisitNamespaceDecl() argument
1075 VisitRedeclarable(D); in VisitNamespaceDecl()
1076 VisitNamedDecl(D); in VisitNamespaceDecl()
1077 Record.push_back(D->isInline()); in VisitNamespaceDecl()
1078 Record.AddSourceLocation(D->getLocStart()); in VisitNamespaceDecl()
1079 Record.AddSourceLocation(D->getRBraceLoc()); in VisitNamespaceDecl()
1081 if (D->isOriginalNamespace()) in VisitNamespaceDecl()
1082 Record.AddDeclRef(D->getAnonymousNamespace()); in VisitNamespaceDecl()
1085 if (Writer.hasChain() && D->isAnonymousNamespace() && in VisitNamespaceDecl()
1086 D == D->getMostRecentDecl()) { in VisitNamespaceDecl()
1092 D->getParent()->getRedeclContext()->getPrimaryContext()); in VisitNamespaceDecl()
1095 ASTWriter::DeclUpdate(UPD_CXX_ADDED_ANONYMOUS_NAMESPACE, D)); in VisitNamespaceDecl()
1100 void ASTDeclWriter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { in VisitNamespaceAliasDecl() argument
1101 VisitRedeclarable(D); in VisitNamespaceAliasDecl()
1102 VisitNamedDecl(D); in VisitNamespaceAliasDecl()
1103 Record.AddSourceLocation(D->getNamespaceLoc()); in VisitNamespaceAliasDecl()
1104 Record.AddSourceLocation(D->getTargetNameLoc()); in VisitNamespaceAliasDecl()
1105 Record.AddNestedNameSpecifierLoc(D->getQualifierLoc()); in VisitNamespaceAliasDecl()
1106 Record.AddDeclRef(D->getNamespace()); in VisitNamespaceAliasDecl()
1110 void ASTDeclWriter::VisitUsingDecl(UsingDecl *D) { in VisitUsingDecl() argument
1111 VisitNamedDecl(D); in VisitUsingDecl()
1112 Record.AddSourceLocation(D->getUsingLoc()); in VisitUsingDecl()
1113 Record.AddNestedNameSpecifierLoc(D->getQualifierLoc()); in VisitUsingDecl()
1114 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName()); in VisitUsingDecl()
1115 Record.AddDeclRef(D->FirstUsingShadow.getPointer()); in VisitUsingDecl()
1116 Record.push_back(D->hasTypename()); in VisitUsingDecl()
1117 Record.AddDeclRef(Context.getInstantiatedFromUsingDecl(D)); in VisitUsingDecl()
1121 void ASTDeclWriter::VisitUsingShadowDecl(UsingShadowDecl *D) { in VisitUsingShadowDecl() argument
1122 VisitRedeclarable(D); in VisitUsingShadowDecl()
1123 VisitNamedDecl(D); in VisitUsingShadowDecl()
1124 Record.AddDeclRef(D->getTargetDecl()); in VisitUsingShadowDecl()
1125 Record.AddDeclRef(D->UsingOrNextShadow); in VisitUsingShadowDecl()
1126 Record.AddDeclRef(Context.getInstantiatedFromUsingShadowDecl(D)); in VisitUsingShadowDecl()
1131 ConstructorUsingShadowDecl *D) { in VisitConstructorUsingShadowDecl() argument
1132 VisitUsingShadowDecl(D); in VisitConstructorUsingShadowDecl()
1133 Record.AddDeclRef(D->NominatedBaseClassShadowDecl); in VisitConstructorUsingShadowDecl()
1134 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl); in VisitConstructorUsingShadowDecl()
1135 Record.push_back(D->IsVirtual); in VisitConstructorUsingShadowDecl()
1139 void ASTDeclWriter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
1140 VisitNamedDecl(D); in VisitUsingDirectiveDecl()
1141 Record.AddSourceLocation(D->getUsingLoc()); in VisitUsingDirectiveDecl()
1142 Record.AddSourceLocation(D->getNamespaceKeyLocation()); in VisitUsingDirectiveDecl()
1143 Record.AddNestedNameSpecifierLoc(D->getQualifierLoc()); in VisitUsingDirectiveDecl()
1144 Record.AddDeclRef(D->getNominatedNamespace()); in VisitUsingDirectiveDecl()
1145 Record.AddDeclRef(dyn_cast<Decl>(D->getCommonAncestor())); in VisitUsingDirectiveDecl()
1149 void ASTDeclWriter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { in VisitUnresolvedUsingValueDecl() argument
1150 VisitValueDecl(D); in VisitUnresolvedUsingValueDecl()
1151 Record.AddSourceLocation(D->getUsingLoc()); in VisitUnresolvedUsingValueDecl()
1152 Record.AddNestedNameSpecifierLoc(D->getQualifierLoc()); in VisitUnresolvedUsingValueDecl()
1153 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName()); in VisitUnresolvedUsingValueDecl()
1158 UnresolvedUsingTypenameDecl *D) { in VisitUnresolvedUsingTypenameDecl() argument
1159 VisitTypeDecl(D); in VisitUnresolvedUsingTypenameDecl()
1160 Record.AddSourceLocation(D->getTypenameLoc()); in VisitUnresolvedUsingTypenameDecl()
1161 Record.AddNestedNameSpecifierLoc(D->getQualifierLoc()); in VisitUnresolvedUsingTypenameDecl()
1165 void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { in VisitCXXRecordDecl() argument
1166 VisitRecordDecl(D); in VisitCXXRecordDecl()
1171 if (ClassTemplateDecl *TemplD = D->getDescribedClassTemplate()) { in VisitCXXRecordDecl()
1175 = D->getMemberSpecializationInfo()) { in VisitCXXRecordDecl()
1184 Record.push_back(D->isThisDeclarationADefinition()); in VisitCXXRecordDecl()
1185 if (D->isThisDeclarationADefinition()) in VisitCXXRecordDecl()
1186 Record.AddCXXDefinitionData(D); in VisitCXXRecordDecl()
1190 if (D->IsCompleteDefinition) in VisitCXXRecordDecl()
1191 Record.AddDeclRef(Context.getCurrentKeyFunction(D)); in VisitCXXRecordDecl()
1196 void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) { in VisitCXXMethodDecl() argument
1197 VisitFunctionDecl(D); in VisitCXXMethodDecl()
1198 if (D->isCanonicalDecl()) { in VisitCXXMethodDecl()
1199 Record.push_back(D->size_overridden_methods()); in VisitCXXMethodDecl()
1201 I = D->begin_overridden_methods(), E = D->end_overridden_methods(); in VisitCXXMethodDecl()
1209 if (D->getDeclContext() == D->getLexicalDeclContext() && in VisitCXXMethodDecl()
1210 D->getFirstDecl() == D->getMostRecentDecl() && in VisitCXXMethodDecl()
1211 !D->isInvalidDecl() && in VisitCXXMethodDecl()
1212 !D->hasAttrs() && in VisitCXXMethodDecl()
1213 !D->isTopLevelDeclInObjCContainer() && in VisitCXXMethodDecl()
1214 D->getDeclName().getNameKind() == DeclarationName::Identifier && in VisitCXXMethodDecl()
1215 !D->hasExtInfo() && in VisitCXXMethodDecl()
1216 !D->hasInheritedPrototype() && in VisitCXXMethodDecl()
1217 D->hasWrittenPrototype()) in VisitCXXMethodDecl()
1223 void ASTDeclWriter::VisitCXXConstructorDecl(CXXConstructorDecl *D) { in VisitCXXConstructorDecl() argument
1224 if (auto Inherited = D->getInheritedConstructor()) { in VisitCXXConstructorDecl()
1232 VisitCXXMethodDecl(D); in VisitCXXConstructorDecl()
1234 Record.push_back(D->IsExplicitSpecified); in VisitCXXConstructorDecl()
1236 Code = D->isInheritingConstructor() in VisitCXXConstructorDecl()
1241 void ASTDeclWriter::VisitCXXDestructorDecl(CXXDestructorDecl *D) { in VisitCXXDestructorDecl() argument
1242 VisitCXXMethodDecl(D); in VisitCXXDestructorDecl()
1244 Record.AddDeclRef(D->getOperatorDelete()); in VisitCXXDestructorDecl()
1249 void ASTDeclWriter::VisitCXXConversionDecl(CXXConversionDecl *D) { in VisitCXXConversionDecl() argument
1250 VisitCXXMethodDecl(D); in VisitCXXConversionDecl()
1251 Record.push_back(D->IsExplicitSpecified); in VisitCXXConversionDecl()
1255 void ASTDeclWriter::VisitImportDecl(ImportDecl *D) { in VisitImportDecl() argument
1256 VisitDecl(D); in VisitImportDecl()
1257 Record.push_back(Writer.getSubmoduleID(D->getImportedModule())); in VisitImportDecl()
1258 ArrayRef<SourceLocation> IdentifierLocs = D->getIdentifierLocs(); in VisitImportDecl()
1261 Record.AddSourceLocation(D->getLocEnd()); in VisitImportDecl()
1273 void ASTDeclWriter::VisitAccessSpecDecl(AccessSpecDecl *D) { in VisitAccessSpecDecl() argument
1274 VisitDecl(D); in VisitAccessSpecDecl()
1275 Record.AddSourceLocation(D->getColonLoc()); in VisitAccessSpecDecl()
1279 void ASTDeclWriter::VisitFriendDecl(FriendDecl *D) { in VisitFriendDecl() argument
1282 Record.push_back(D->NumTPLists); in VisitFriendDecl()
1283 VisitDecl(D); in VisitFriendDecl()
1284 bool hasFriendDecl = D->Friend.is<NamedDecl*>(); in VisitFriendDecl()
1287 Record.AddDeclRef(D->getFriendDecl()); in VisitFriendDecl()
1289 Record.AddTypeSourceInfo(D->getFriendType()); in VisitFriendDecl()
1290 for (unsigned i = 0; i < D->NumTPLists; ++i) in VisitFriendDecl()
1291 Record.AddTemplateParameterList(D->getFriendTypeTemplateParameterList(i)); in VisitFriendDecl()
1292 Record.AddDeclRef(D->getNextFriend()); in VisitFriendDecl()
1293 Record.push_back(D->UnsupportedFriend); in VisitFriendDecl()
1294 Record.AddSourceLocation(D->FriendLoc); in VisitFriendDecl()
1298 void ASTDeclWriter::VisitFriendTemplateDecl(FriendTemplateDecl *D) { in VisitFriendTemplateDecl() argument
1299 VisitDecl(D); in VisitFriendTemplateDecl()
1300 Record.push_back(D->getNumTemplateParameters()); in VisitFriendTemplateDecl()
1301 for (unsigned i = 0, e = D->getNumTemplateParameters(); i != e; ++i) in VisitFriendTemplateDecl()
1302 Record.AddTemplateParameterList(D->getTemplateParameterList(i)); in VisitFriendTemplateDecl()
1303 Record.push_back(D->getFriendDecl() != nullptr); in VisitFriendTemplateDecl()
1304 if (D->getFriendDecl()) in VisitFriendTemplateDecl()
1305 Record.AddDeclRef(D->getFriendDecl()); in VisitFriendTemplateDecl()
1307 Record.AddTypeSourceInfo(D->getFriendType()); in VisitFriendTemplateDecl()
1308 Record.AddSourceLocation(D->getFriendLoc()); in VisitFriendTemplateDecl()
1312 void ASTDeclWriter::VisitTemplateDecl(TemplateDecl *D) { in VisitTemplateDecl() argument
1313 VisitNamedDecl(D); in VisitTemplateDecl()
1315 Record.AddDeclRef(D->getTemplatedDecl()); in VisitTemplateDecl()
1316 Record.AddTemplateParameterList(D->getTemplateParameters()); in VisitTemplateDecl()
1319 void ASTDeclWriter::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { in VisitRedeclarableTemplateDecl() argument
1320 VisitRedeclarable(D); in VisitRedeclarableTemplateDecl()
1324 if (D->isFirstDecl()) { in VisitRedeclarableTemplateDecl()
1326 Record.AddDeclRef(D->getInstantiatedFromMemberTemplate()); in VisitRedeclarableTemplateDecl()
1327 if (D->getInstantiatedFromMemberTemplate()) in VisitRedeclarableTemplateDecl()
1328 Record.push_back(D->isMemberSpecialization()); in VisitRedeclarableTemplateDecl()
1331 VisitTemplateDecl(D); in VisitRedeclarableTemplateDecl()
1332 Record.push_back(D->getIdentifierNamespace()); in VisitRedeclarableTemplateDecl()
1335 void ASTDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
1336 VisitRedeclarableTemplateDecl(D); in VisitClassTemplateDecl()
1338 if (D->isFirstDecl()) in VisitClassTemplateDecl()
1339 AddTemplateSpecializations(D); in VisitClassTemplateDecl()
1344 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
1345 RegisterTemplateSpecialization(D->getSpecializedTemplate(), D); in VisitClassTemplateSpecializationDecl()
1347 VisitCXXRecordDecl(D); in VisitClassTemplateSpecializationDecl()
1351 = D->getSpecializedTemplateOrPartial(); in VisitClassTemplateSpecializationDecl()
1356 Record.AddTemplateArgumentList(&D->getTemplateInstantiationArgs()); in VisitClassTemplateSpecializationDecl()
1359 Record.AddTemplateArgumentList(&D->getTemplateArgs()); in VisitClassTemplateSpecializationDecl()
1360 Record.AddSourceLocation(D->getPointOfInstantiation()); in VisitClassTemplateSpecializationDecl()
1361 Record.push_back(D->getSpecializationKind()); in VisitClassTemplateSpecializationDecl()
1362 Record.push_back(D->isCanonicalDecl()); in VisitClassTemplateSpecializationDecl()
1364 if (D->isCanonicalDecl()) { in VisitClassTemplateSpecializationDecl()
1366 Record.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl()); in VisitClassTemplateSpecializationDecl()
1370 Record.AddTypeSourceInfo(D->getTypeAsWritten()); in VisitClassTemplateSpecializationDecl()
1371 if (D->getTypeAsWritten()) { in VisitClassTemplateSpecializationDecl()
1372 Record.AddSourceLocation(D->getExternLoc()); in VisitClassTemplateSpecializationDecl()
1373 Record.AddSourceLocation(D->getTemplateKeywordLoc()); in VisitClassTemplateSpecializationDecl()
1380 ClassTemplatePartialSpecializationDecl *D) { in VisitClassTemplatePartialSpecializationDecl() argument
1381 VisitClassTemplateSpecializationDecl(D); in VisitClassTemplatePartialSpecializationDecl()
1383 Record.AddTemplateParameterList(D->getTemplateParameters()); in VisitClassTemplatePartialSpecializationDecl()
1384 Record.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten()); in VisitClassTemplatePartialSpecializationDecl()
1387 if (D->getPreviousDecl() == nullptr) { in VisitClassTemplatePartialSpecializationDecl()
1388 Record.AddDeclRef(D->getInstantiatedFromMember()); in VisitClassTemplatePartialSpecializationDecl()
1389 Record.push_back(D->isMemberSpecialization()); in VisitClassTemplatePartialSpecializationDecl()
1395 void ASTDeclWriter::VisitVarTemplateDecl(VarTemplateDecl *D) { in VisitVarTemplateDecl() argument
1396 VisitRedeclarableTemplateDecl(D); in VisitVarTemplateDecl()
1398 if (D->isFirstDecl()) in VisitVarTemplateDecl()
1399 AddTemplateSpecializations(D); in VisitVarTemplateDecl()
1404 VarTemplateSpecializationDecl *D) { in VisitVarTemplateSpecializationDecl() argument
1405 RegisterTemplateSpecialization(D->getSpecializedTemplate(), D); in VisitVarTemplateSpecializationDecl()
1407 VisitVarDecl(D); in VisitVarTemplateSpecializationDecl()
1410 InstFrom = D->getSpecializedTemplateOrPartial(); in VisitVarTemplateSpecializationDecl()
1415 Record.AddTemplateArgumentList(&D->getTemplateInstantiationArgs()); in VisitVarTemplateSpecializationDecl()
1419 Record.AddTypeSourceInfo(D->getTypeAsWritten()); in VisitVarTemplateSpecializationDecl()
1420 if (D->getTypeAsWritten()) { in VisitVarTemplateSpecializationDecl()
1421 Record.AddSourceLocation(D->getExternLoc()); in VisitVarTemplateSpecializationDecl()
1422 Record.AddSourceLocation(D->getTemplateKeywordLoc()); in VisitVarTemplateSpecializationDecl()
1425 Record.AddTemplateArgumentList(&D->getTemplateArgs()); in VisitVarTemplateSpecializationDecl()
1426 Record.AddSourceLocation(D->getPointOfInstantiation()); in VisitVarTemplateSpecializationDecl()
1427 Record.push_back(D->getSpecializationKind()); in VisitVarTemplateSpecializationDecl()
1428 Record.push_back(D->isCanonicalDecl()); in VisitVarTemplateSpecializationDecl()
1430 if (D->isCanonicalDecl()) { in VisitVarTemplateSpecializationDecl()
1432 Record.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl()); in VisitVarTemplateSpecializationDecl()
1439 VarTemplatePartialSpecializationDecl *D) { in VisitVarTemplatePartialSpecializationDecl() argument
1440 VisitVarTemplateSpecializationDecl(D); in VisitVarTemplatePartialSpecializationDecl()
1442 Record.AddTemplateParameterList(D->getTemplateParameters()); in VisitVarTemplatePartialSpecializationDecl()
1443 Record.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten()); in VisitVarTemplatePartialSpecializationDecl()
1446 if (D->getPreviousDecl() == nullptr) { in VisitVarTemplatePartialSpecializationDecl()
1447 Record.AddDeclRef(D->getInstantiatedFromMember()); in VisitVarTemplatePartialSpecializationDecl()
1448 Record.push_back(D->isMemberSpecialization()); in VisitVarTemplatePartialSpecializationDecl()
1455 ClassScopeFunctionSpecializationDecl *D) { in VisitClassScopeFunctionSpecializationDecl() argument
1456 VisitDecl(D); in VisitClassScopeFunctionSpecializationDecl()
1457 Record.AddDeclRef(D->getSpecialization()); in VisitClassScopeFunctionSpecializationDecl()
1462 void ASTDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
1463 VisitRedeclarableTemplateDecl(D); in VisitFunctionTemplateDecl()
1465 if (D->isFirstDecl()) in VisitFunctionTemplateDecl()
1466 AddTemplateSpecializations(D); in VisitFunctionTemplateDecl()
1470 void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { in VisitTemplateTypeParmDecl() argument
1471 VisitTypeDecl(D); in VisitTemplateTypeParmDecl()
1473 Record.push_back(D->wasDeclaredWithTypename()); in VisitTemplateTypeParmDecl()
1475 bool OwnsDefaultArg = D->hasDefaultArgument() && in VisitTemplateTypeParmDecl()
1476 !D->defaultArgumentWasInherited(); in VisitTemplateTypeParmDecl()
1479 Record.AddTypeSourceInfo(D->getDefaultArgumentInfo()); in VisitTemplateTypeParmDecl()
1484 void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { in VisitNonTypeTemplateParmDecl() argument
1488 if (D->isExpandedParameterPack()) in VisitNonTypeTemplateParmDecl()
1489 Record.push_back(D->getNumExpansionTypes()); in VisitNonTypeTemplateParmDecl()
1491 VisitDeclaratorDecl(D); in VisitNonTypeTemplateParmDecl()
1493 Record.push_back(D->getDepth()); in VisitNonTypeTemplateParmDecl()
1494 Record.push_back(D->getPosition()); in VisitNonTypeTemplateParmDecl()
1496 if (D->isExpandedParameterPack()) { in VisitNonTypeTemplateParmDecl()
1497 for (unsigned I = 0, N = D->getNumExpansionTypes(); I != N; ++I) { in VisitNonTypeTemplateParmDecl()
1498 Record.AddTypeRef(D->getExpansionType(I)); in VisitNonTypeTemplateParmDecl()
1499 Record.AddTypeSourceInfo(D->getExpansionTypeSourceInfo(I)); in VisitNonTypeTemplateParmDecl()
1505 Record.push_back(D->isParameterPack()); in VisitNonTypeTemplateParmDecl()
1506 bool OwnsDefaultArg = D->hasDefaultArgument() && in VisitNonTypeTemplateParmDecl()
1507 !D->defaultArgumentWasInherited(); in VisitNonTypeTemplateParmDecl()
1510 Record.AddStmt(D->getDefaultArgument()); in VisitNonTypeTemplateParmDecl()
1515 void ASTDeclWriter::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) { in VisitTemplateTemplateParmDecl() argument
1519 if (D->isExpandedParameterPack()) in VisitTemplateTemplateParmDecl()
1520 Record.push_back(D->getNumExpansionTemplateParameters()); in VisitTemplateTemplateParmDecl()
1522 VisitTemplateDecl(D); in VisitTemplateTemplateParmDecl()
1524 Record.push_back(D->getDepth()); in VisitTemplateTemplateParmDecl()
1525 Record.push_back(D->getPosition()); in VisitTemplateTemplateParmDecl()
1527 if (D->isExpandedParameterPack()) { in VisitTemplateTemplateParmDecl()
1528 for (unsigned I = 0, N = D->getNumExpansionTemplateParameters(); in VisitTemplateTemplateParmDecl()
1530 Record.AddTemplateParameterList(D->getExpansionTemplateParameters(I)); in VisitTemplateTemplateParmDecl()
1534 Record.push_back(D->isParameterPack()); in VisitTemplateTemplateParmDecl()
1535 bool OwnsDefaultArg = D->hasDefaultArgument() && in VisitTemplateTemplateParmDecl()
1536 !D->defaultArgumentWasInherited(); in VisitTemplateTemplateParmDecl()
1539 Record.AddTemplateArgumentLoc(D->getDefaultArgument()); in VisitTemplateTemplateParmDecl()
1544 void ASTDeclWriter::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) { in VisitTypeAliasTemplateDecl() argument
1545 VisitRedeclarableTemplateDecl(D); in VisitTypeAliasTemplateDecl()
1549 void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) { in VisitStaticAssertDecl() argument
1550 VisitDecl(D); in VisitStaticAssertDecl()
1551 Record.AddStmt(D->getAssertExpr()); in VisitStaticAssertDecl()
1552 Record.push_back(D->isFailed()); in VisitStaticAssertDecl()
1553 Record.AddStmt(D->getMessage()); in VisitStaticAssertDecl()
1554 Record.AddSourceLocation(D->getRParenLoc()); in VisitStaticAssertDecl()
1564 const Decl *ASTWriter::getFirstLocalDecl(const Decl *D) { in getFirstLocalDecl() argument
1565 assert(IsLocalDecl(D) && "expected a local declaration"); in getFirstLocalDecl()
1567 const Decl *Canon = D->getCanonicalDecl(); in getFirstLocalDecl()
1575 for (const Decl *Redecl = D; Redecl; Redecl = Redecl->getPreviousDecl()) in getFirstLocalDecl()
1577 D = Redecl; in getFirstLocalDecl()
1578 return CacheEntry = D; in getFirstLocalDecl()
1582 void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { in VisitRedeclarable() argument
1583 T *First = D->getFirstDecl(); in VisitRedeclarable()
1585 T *DAsT = static_cast<T *>(D); in VisitRedeclarable()
1632 (void)Writer.GetDeclRef(D->getPreviousDecl()); in VisitRedeclarable()
1640 void ASTDeclWriter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) { in VisitOMPThreadPrivateDecl() argument
1641 Record.push_back(D->varlist_size()); in VisitOMPThreadPrivateDecl()
1642 VisitDecl(D); in VisitOMPThreadPrivateDecl()
1643 for (auto *I : D->varlists()) in VisitOMPThreadPrivateDecl()
1648 void ASTDeclWriter::VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D) { in VisitOMPDeclareReductionDecl() argument
1649 VisitValueDecl(D); in VisitOMPDeclareReductionDecl()
1650 Record.AddSourceLocation(D->getLocStart()); in VisitOMPDeclareReductionDecl()
1651 Record.AddStmt(D->getCombiner()); in VisitOMPDeclareReductionDecl()
1652 Record.AddStmt(D->getInitializer()); in VisitOMPDeclareReductionDecl()
1653 Record.AddDeclRef(D->getPrevDeclInScope()); in VisitOMPDeclareReductionDecl()
1657 void ASTDeclWriter::VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D) { in VisitOMPCapturedExprDecl() argument
1658 VisitVarDecl(D); in VisitOMPCapturedExprDecl()
2113 static bool isRequiredDecl(const Decl *D, ASTContext &Context, in isRequiredDecl() argument
2120 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) || in isRequiredDecl()
2121 D->hasAttr<OMPDeclareTargetDeclAttr>()) in isRequiredDecl()
2127 if (isa<ImportDecl>(D) && !WritingModule) in isRequiredDecl()
2130 return Context.DeclMustBeEmitted(D); in isRequiredDecl()
2133 void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) { in WriteDecl() argument
2136 assert(!D->isFromASTFile() && "should not be emitting imported decl"); in WriteDecl()
2137 serialization::DeclID &IDR = DeclIDs[D]; in WriteDecl()
2149 W.Visit(D); in WriteDecl()
2152 uint64_t Offset = W.Emit(D); in WriteDecl()
2155 SourceLocation Loc = D->getLocation(); in WriteDecl()
2170 associateDeclWithFile(D, ID); in WriteDecl()
2174 if (isRequiredDecl(D, Context, WritingModule)) in WriteDecl()