Lines Matching refs:D
49 void Visit(Decl *D);
51 void VisitDecl(Decl *D);
52 void VisitTranslationUnitDecl(TranslationUnitDecl *D);
53 void VisitNamedDecl(NamedDecl *D);
55 void VisitNamespaceDecl(NamespaceDecl *D);
56 void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
57 void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
58 void VisitTypeDecl(TypeDecl *D);
59 void VisitTypedefNameDecl(TypedefNameDecl *D);
60 void VisitTypedefDecl(TypedefDecl *D);
61 void VisitTypeAliasDecl(TypeAliasDecl *D);
62 void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
63 void VisitTagDecl(TagDecl *D);
64 void VisitEnumDecl(EnumDecl *D);
65 void VisitRecordDecl(RecordDecl *D);
66 void VisitCXXRecordDecl(CXXRecordDecl *D);
68 ClassTemplateSpecializationDecl *D);
70 ClassTemplatePartialSpecializationDecl *D);
71 void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D);
73 VarTemplatePartialSpecializationDecl *D);
75 ClassScopeFunctionSpecializationDecl *D);
76 void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);
77 void VisitValueDecl(ValueDecl *D);
78 void VisitEnumConstantDecl(EnumConstantDecl *D);
79 void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
80 void VisitDeclaratorDecl(DeclaratorDecl *D);
81 void VisitFunctionDecl(FunctionDecl *D);
82 void VisitCXXMethodDecl(CXXMethodDecl *D);
83 void VisitCXXConstructorDecl(CXXConstructorDecl *D);
84 void VisitCXXDestructorDecl(CXXDestructorDecl *D);
85 void VisitCXXConversionDecl(CXXConversionDecl *D);
86 void VisitFieldDecl(FieldDecl *D);
87 void VisitMSPropertyDecl(MSPropertyDecl *D);
88 void VisitIndirectFieldDecl(IndirectFieldDecl *D);
89 void VisitVarDecl(VarDecl *D);
90 void VisitImplicitParamDecl(ImplicitParamDecl *D);
91 void VisitParmVarDecl(ParmVarDecl *D);
92 void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);
93 void VisitTemplateDecl(TemplateDecl *D);
94 void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D);
95 void VisitClassTemplateDecl(ClassTemplateDecl *D);
96 void VisitVarTemplateDecl(VarTemplateDecl *D);
97 void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
98 void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
99 void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
100 void VisitUsingDecl(UsingDecl *D);
101 void VisitUsingShadowDecl(UsingShadowDecl *D);
102 void VisitLinkageSpecDecl(LinkageSpecDecl *D);
103 void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
104 void VisitImportDecl(ImportDecl *D);
105 void VisitAccessSpecDecl(AccessSpecDecl *D);
106 void VisitFriendDecl(FriendDecl *D);
107 void VisitFriendTemplateDecl(FriendTemplateDecl *D);
108 void VisitStaticAssertDecl(StaticAssertDecl *D);
109 void VisitBlockDecl(BlockDecl *D);
110 void VisitCapturedDecl(CapturedDecl *D);
111 void VisitEmptyDecl(EmptyDecl *D);
115 template <typename T> void VisitRedeclarable(Redeclarable<T> *D);
119 void VisitObjCMethodDecl(ObjCMethodDecl *D);
120 void VisitObjCContainerDecl(ObjCContainerDecl *D);
121 void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
122 void VisitObjCIvarDecl(ObjCIvarDecl *D);
123 void VisitObjCProtocolDecl(ObjCProtocolDecl *D);
124 void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D);
125 void VisitObjCCategoryDecl(ObjCCategoryDecl *D);
126 void VisitObjCImplDecl(ObjCImplDecl *D);
127 void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
128 void VisitObjCImplementationDecl(ObjCImplementationDecl *D);
129 void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);
130 void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
131 void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
132 void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D);
144 void ASTDeclWriter::Visit(Decl *D) { in Visit() argument
145 DeclVisitor<ASTDeclWriter>::Visit(D); in Visit()
150 if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)){ in Visit()
157 if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { in Visit()
164 void ASTDeclWriter::VisitDecl(Decl *D) { in VisitDecl() argument
165 Writer.AddDeclRef(cast_or_null<Decl>(D->getDeclContext()), Record); in VisitDecl()
166 Writer.AddDeclRef(cast_or_null<Decl>(D->getLexicalDeclContext()), Record); in VisitDecl()
167 Record.push_back(D->isInvalidDecl()); in VisitDecl()
168 Record.push_back(D->hasAttrs()); in VisitDecl()
169 if (D->hasAttrs()) in VisitDecl()
170 Writer.WriteAttributes(ArrayRef<const Attr*>(D->getAttrs().begin(), in VisitDecl()
171 D->getAttrs().size()), Record); in VisitDecl()
172 Record.push_back(D->isImplicit()); in VisitDecl()
173 Record.push_back(D->isUsed(false)); in VisitDecl()
174 Record.push_back(D->isReferenced()); in VisitDecl()
175 Record.push_back(D->isTopLevelDeclInObjCContainer()); in VisitDecl()
176 Record.push_back(D->getAccess()); in VisitDecl()
177 Record.push_back(D->isModulePrivate()); in VisitDecl()
178 Record.push_back(Writer.inferSubmoduleIDFromLocation(D->getLocation())); in VisitDecl()
186 if (D->isOutOfLine()) { in VisitDecl()
187 auto *DC = D->getDeclContext(); in VisitDecl()
199 void ASTDeclWriter::VisitTranslationUnitDecl(TranslationUnitDecl *D) { in VisitTranslationUnitDecl() argument
203 void ASTDeclWriter::VisitNamedDecl(NamedDecl *D) { in VisitNamedDecl() argument
204 VisitDecl(D); in VisitNamedDecl()
205 Writer.AddDeclarationName(D->getDeclName(), Record); in VisitNamedDecl()
208 void ASTDeclWriter::VisitTypeDecl(TypeDecl *D) { in VisitTypeDecl() argument
209 VisitNamedDecl(D); in VisitTypeDecl()
210 Writer.AddSourceLocation(D->getLocStart(), Record); in VisitTypeDecl()
211 Writer.AddTypeRef(QualType(D->getTypeForDecl(), 0), Record); in VisitTypeDecl()
214 void ASTDeclWriter::VisitTypedefNameDecl(TypedefNameDecl *D) { in VisitTypedefNameDecl() argument
215 VisitRedeclarable(D); in VisitTypedefNameDecl()
216 VisitTypeDecl(D); in VisitTypedefNameDecl()
217 Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record); in VisitTypedefNameDecl()
218 Record.push_back(D->isModed()); in VisitTypedefNameDecl()
219 if (D->isModed()) in VisitTypedefNameDecl()
220 Writer.AddTypeRef(D->getUnderlyingType(), Record); in VisitTypedefNameDecl()
223 void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { in VisitTypedefDecl() argument
224 VisitTypedefNameDecl(D); in VisitTypedefDecl()
225 if (!D->hasAttrs() && in VisitTypedefDecl()
226 !D->isImplicit() && in VisitTypedefDecl()
227 !D->isUsed(false) && in VisitTypedefDecl()
228 D->getFirstDecl() == D->getMostRecentDecl() && in VisitTypedefDecl()
229 !D->isInvalidDecl() && in VisitTypedefDecl()
230 !D->isReferenced() && in VisitTypedefDecl()
231 !D->isTopLevelDeclInObjCContainer() && in VisitTypedefDecl()
232 D->getAccess() == AS_none && in VisitTypedefDecl()
233 !D->isModulePrivate() && in VisitTypedefDecl()
234 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitTypedefDecl()
240 void ASTDeclWriter::VisitTypeAliasDecl(TypeAliasDecl *D) { in VisitTypeAliasDecl() argument
241 VisitTypedefNameDecl(D); in VisitTypeAliasDecl()
245 void ASTDeclWriter::VisitTagDecl(TagDecl *D) { in VisitTagDecl() argument
246 VisitRedeclarable(D); in VisitTagDecl()
247 VisitTypeDecl(D); in VisitTagDecl()
248 Record.push_back(D->getIdentifierNamespace()); in VisitTagDecl()
249 Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding in VisitTagDecl()
250 Record.push_back(D->isCompleteDefinition()); in VisitTagDecl()
251 Record.push_back(D->isEmbeddedInDeclarator()); in VisitTagDecl()
252 Record.push_back(D->isFreeStanding()); in VisitTagDecl()
253 Record.push_back(D->isCompleteDefinitionRequired()); in VisitTagDecl()
254 Writer.AddSourceLocation(D->getRBraceLoc(), Record); in VisitTagDecl()
255 Record.push_back(D->hasExtInfo()); in VisitTagDecl()
256 if (D->hasExtInfo()) in VisitTagDecl()
257 Writer.AddQualifierInfo(*D->getExtInfo(), Record); in VisitTagDecl()
258 else if (D->hasDeclaratorForAnonDecl()) in VisitTagDecl()
259 Writer.AddDeclRef(D->getDeclaratorForAnonDecl(), Record); in VisitTagDecl()
261 Writer.AddDeclRef(D->getTypedefNameForAnonDecl(), Record); in VisitTagDecl()
264 void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) { in VisitEnumDecl() argument
265 VisitTagDecl(D); in VisitEnumDecl()
266 Writer.AddTypeSourceInfo(D->getIntegerTypeSourceInfo(), Record); in VisitEnumDecl()
267 if (!D->getIntegerTypeSourceInfo()) in VisitEnumDecl()
268 Writer.AddTypeRef(D->getIntegerType(), Record); in VisitEnumDecl()
269 Writer.AddTypeRef(D->getPromotionType(), Record); in VisitEnumDecl()
270 Record.push_back(D->getNumPositiveBits()); in VisitEnumDecl()
271 Record.push_back(D->getNumNegativeBits()); in VisitEnumDecl()
272 Record.push_back(D->isScoped()); in VisitEnumDecl()
273 Record.push_back(D->isScopedUsingClassTag()); in VisitEnumDecl()
274 Record.push_back(D->isFixed()); in VisitEnumDecl()
275 if (MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo()) { in VisitEnumDecl()
283 if (!D->hasAttrs() && in VisitEnumDecl()
284 !D->isImplicit() && in VisitEnumDecl()
285 !D->isUsed(false) && in VisitEnumDecl()
286 !D->hasExtInfo() && in VisitEnumDecl()
287 D->getFirstDecl() == D->getMostRecentDecl() && in VisitEnumDecl()
288 !D->isInvalidDecl() && in VisitEnumDecl()
289 !D->isReferenced() && in VisitEnumDecl()
290 !D->isTopLevelDeclInObjCContainer() && in VisitEnumDecl()
291 D->getAccess() == AS_none && in VisitEnumDecl()
292 !D->isModulePrivate() && in VisitEnumDecl()
293 !CXXRecordDecl::classofKind(D->getKind()) && in VisitEnumDecl()
294 !D->getIntegerTypeSourceInfo() && in VisitEnumDecl()
295 !D->getMemberSpecializationInfo() && in VisitEnumDecl()
296 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitEnumDecl()
302 void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) { in VisitRecordDecl() argument
303 VisitTagDecl(D); in VisitRecordDecl()
304 Record.push_back(D->hasFlexibleArrayMember()); in VisitRecordDecl()
305 Record.push_back(D->isAnonymousStructOrUnion()); in VisitRecordDecl()
306 Record.push_back(D->hasObjectMember()); in VisitRecordDecl()
307 Record.push_back(D->hasVolatileMember()); in VisitRecordDecl()
309 if (!D->hasAttrs() && in VisitRecordDecl()
310 !D->isImplicit() && in VisitRecordDecl()
311 !D->isUsed(false) && in VisitRecordDecl()
312 !D->hasExtInfo() && in VisitRecordDecl()
313 D->getFirstDecl() == D->getMostRecentDecl() && in VisitRecordDecl()
314 !D->isInvalidDecl() && in VisitRecordDecl()
315 !D->isReferenced() && in VisitRecordDecl()
316 !D->isTopLevelDeclInObjCContainer() && in VisitRecordDecl()
317 D->getAccess() == AS_none && in VisitRecordDecl()
318 !D->isModulePrivate() && in VisitRecordDecl()
319 !CXXRecordDecl::classofKind(D->getKind()) && in VisitRecordDecl()
320 D->getDeclName().getNameKind() == DeclarationName::Identifier) in VisitRecordDecl()
326 void ASTDeclWriter::VisitValueDecl(ValueDecl *D) { in VisitValueDecl() argument
327 VisitNamedDecl(D); in VisitValueDecl()
328 Writer.AddTypeRef(D->getType(), Record); in VisitValueDecl()
331 void ASTDeclWriter::VisitEnumConstantDecl(EnumConstantDecl *D) { in VisitEnumConstantDecl() argument
332 VisitValueDecl(D); in VisitEnumConstantDecl()
333 Record.push_back(D->getInitExpr()? 1 : 0); in VisitEnumConstantDecl()
334 if (D->getInitExpr()) in VisitEnumConstantDecl()
335 Writer.AddStmt(D->getInitExpr()); in VisitEnumConstantDecl()
336 Writer.AddAPSInt(D->getInitVal(), Record); in VisitEnumConstantDecl()
341 void ASTDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) { in VisitDeclaratorDecl() argument
342 VisitValueDecl(D); in VisitDeclaratorDecl()
343 Writer.AddSourceLocation(D->getInnerLocStart(), Record); in VisitDeclaratorDecl()
344 Record.push_back(D->hasExtInfo()); in VisitDeclaratorDecl()
345 if (D->hasExtInfo()) in VisitDeclaratorDecl()
346 Writer.AddQualifierInfo(*D->getExtInfo(), Record); in VisitDeclaratorDecl()
349 void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { in VisitFunctionDecl() argument
350 VisitRedeclarable(D); in VisitFunctionDecl()
351 VisitDeclaratorDecl(D); in VisitFunctionDecl()
353 Writer.AddDeclarationNameLoc(D->DNLoc, D->getDeclName(), Record); in VisitFunctionDecl()
354 Record.push_back(D->getIdentifierNamespace()); in VisitFunctionDecl()
359 Record.push_back(D->getStorageClass()); // FIXME: stable encoding in VisitFunctionDecl()
360 Record.push_back(D->IsInline); in VisitFunctionDecl()
361 Record.push_back(D->isInlineSpecified()); in VisitFunctionDecl()
362 Record.push_back(D->isVirtualAsWritten()); in VisitFunctionDecl()
363 Record.push_back(D->isPure()); in VisitFunctionDecl()
364 Record.push_back(D->hasInheritedPrototype()); in VisitFunctionDecl()
365 Record.push_back(D->hasWrittenPrototype()); in VisitFunctionDecl()
366 Record.push_back(D->isDeletedAsWritten()); in VisitFunctionDecl()
367 Record.push_back(D->isTrivial()); in VisitFunctionDecl()
368 Record.push_back(D->isDefaulted()); in VisitFunctionDecl()
369 Record.push_back(D->isExplicitlyDefaulted()); in VisitFunctionDecl()
370 Record.push_back(D->hasImplicitReturnZero()); in VisitFunctionDecl()
371 Record.push_back(D->isConstexpr()); in VisitFunctionDecl()
372 Record.push_back(D->HasSkippedBody); in VisitFunctionDecl()
373 Record.push_back(D->isLateTemplateParsed()); in VisitFunctionDecl()
374 Record.push_back(D->getLinkageInternal()); in VisitFunctionDecl()
375 Writer.AddSourceLocation(D->getLocEnd(), Record); in VisitFunctionDecl()
377 Record.push_back(D->getTemplatedKind()); in VisitFunctionDecl()
378 switch (D->getTemplatedKind()) { in VisitFunctionDecl()
382 Writer.AddDeclRef(D->getDescribedFunctionTemplate(), Record); in VisitFunctionDecl()
385 MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo(); in VisitFunctionDecl()
393 FTSInfo = D->getTemplateSpecializationInfo(); in VisitFunctionDecl()
416 if (D->isCanonicalDecl()) { in VisitFunctionDecl()
425 DFTSInfo = D->getDependentSpecializationInfo(); in VisitFunctionDecl()
442 Record.push_back(D->param_size()); in VisitFunctionDecl()
443 for (auto P : D->params()) in VisitFunctionDecl()
448 void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) { in VisitObjCMethodDecl() argument
449 VisitNamedDecl(D); in VisitObjCMethodDecl()
452 bool HasBodyStuff = D->getBody() != nullptr || in VisitObjCMethodDecl()
453 D->getSelfDecl() != nullptr || D->getCmdDecl() != nullptr; in VisitObjCMethodDecl()
456 Writer.AddStmt(D->getBody()); in VisitObjCMethodDecl()
457 Writer.AddDeclRef(D->getSelfDecl(), Record); in VisitObjCMethodDecl()
458 Writer.AddDeclRef(D->getCmdDecl(), Record); in VisitObjCMethodDecl()
460 Record.push_back(D->isInstanceMethod()); in VisitObjCMethodDecl()
461 Record.push_back(D->isVariadic()); in VisitObjCMethodDecl()
462 Record.push_back(D->isPropertyAccessor()); in VisitObjCMethodDecl()
463 Record.push_back(D->isDefined()); in VisitObjCMethodDecl()
464 Record.push_back(D->IsOverriding); in VisitObjCMethodDecl()
465 Record.push_back(D->HasSkippedBody); in VisitObjCMethodDecl()
467 Record.push_back(D->IsRedeclaration); in VisitObjCMethodDecl()
468 Record.push_back(D->HasRedeclaration); in VisitObjCMethodDecl()
469 if (D->HasRedeclaration) { in VisitObjCMethodDecl()
470 assert(Context.getObjCMethodRedeclaration(D)); in VisitObjCMethodDecl()
471 Writer.AddDeclRef(Context.getObjCMethodRedeclaration(D), Record); in VisitObjCMethodDecl()
475 Record.push_back(D->getImplementationControl()); in VisitObjCMethodDecl()
477 Record.push_back(D->getObjCDeclQualifier()); in VisitObjCMethodDecl()
478 Record.push_back(D->hasRelatedResultType()); in VisitObjCMethodDecl()
479 Writer.AddTypeRef(D->getReturnType(), Record); in VisitObjCMethodDecl()
480 Writer.AddTypeSourceInfo(D->getReturnTypeSourceInfo(), Record); in VisitObjCMethodDecl()
481 Writer.AddSourceLocation(D->getLocEnd(), Record); in VisitObjCMethodDecl()
482 Record.push_back(D->param_size()); in VisitObjCMethodDecl()
483 for (const auto *P : D->params()) in VisitObjCMethodDecl()
486 Record.push_back(D->SelLocsKind); in VisitObjCMethodDecl()
487 unsigned NumStoredSelLocs = D->getNumStoredSelLocs(); in VisitObjCMethodDecl()
488 SourceLocation *SelLocs = D->getStoredSelLocs(); in VisitObjCMethodDecl()
496 void ASTDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) { in VisitObjCContainerDecl() argument
497 VisitNamedDecl(D); in VisitObjCContainerDecl()
498 Writer.AddSourceLocation(D->getAtStartLoc(), Record); in VisitObjCContainerDecl()
499 Writer.AddSourceRange(D->getAtEndRange(), Record); in VisitObjCContainerDecl()
503 void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { in VisitObjCInterfaceDecl() argument
504 VisitRedeclarable(D); in VisitObjCInterfaceDecl()
505 VisitObjCContainerDecl(D); in VisitObjCInterfaceDecl()
506 Writer.AddTypeRef(QualType(D->getTypeForDecl(), 0), Record); in VisitObjCInterfaceDecl()
508 Record.push_back(D->isThisDeclarationADefinition()); in VisitObjCInterfaceDecl()
509 if (D->isThisDeclarationADefinition()) { in VisitObjCInterfaceDecl()
511 ObjCInterfaceDecl::DefinitionData &Data = D->data(); in VisitObjCInterfaceDecl()
513 Writer.AddDeclRef(D->getSuperClass(), Record); in VisitObjCInterfaceDecl()
514 Writer.AddSourceLocation(D->getSuperClassLoc(), Record); in VisitObjCInterfaceDecl()
515 Writer.AddSourceLocation(D->getEndOfDefinitionLoc(), Record); in VisitObjCInterfaceDecl()
520 for (const auto *P : D->protocols()) in VisitObjCInterfaceDecl()
522 for (const auto &PL : D->protocol_locs()) in VisitObjCInterfaceDecl()
534 if (ObjCCategoryDecl *Cat = D->getCategoryListRaw()) { in VisitObjCInterfaceDecl()
536 Writer.ObjCClassesWithCategories.insert(D); in VisitObjCInterfaceDecl()
547 void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { in VisitObjCIvarDecl() argument
548 VisitFieldDecl(D); in VisitObjCIvarDecl()
550 Record.push_back(D->getAccessControl()); in VisitObjCIvarDecl()
551 Record.push_back(D->getSynthesize()); in VisitObjCIvarDecl()
553 if (!D->hasAttrs() && in VisitObjCIvarDecl()
554 !D->isImplicit() && in VisitObjCIvarDecl()
555 !D->isUsed(false) && in VisitObjCIvarDecl()
556 !D->isInvalidDecl() && in VisitObjCIvarDecl()
557 !D->isReferenced() && in VisitObjCIvarDecl()
558 !D->isModulePrivate() && in VisitObjCIvarDecl()
559 !D->getBitWidth() && in VisitObjCIvarDecl()
560 !D->hasExtInfo() && in VisitObjCIvarDecl()
561 D->getDeclName()) in VisitObjCIvarDecl()
567 void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { in VisitObjCProtocolDecl() argument
568 VisitRedeclarable(D); in VisitObjCProtocolDecl()
569 VisitObjCContainerDecl(D); in VisitObjCProtocolDecl()
571 Record.push_back(D->isThisDeclarationADefinition()); in VisitObjCProtocolDecl()
572 if (D->isThisDeclarationADefinition()) { in VisitObjCProtocolDecl()
573 Record.push_back(D->protocol_size()); in VisitObjCProtocolDecl()
574 for (const auto *I : D->protocols()) in VisitObjCProtocolDecl()
576 for (const auto &PL : D->protocol_locs()) in VisitObjCProtocolDecl()
583 void ASTDeclWriter::VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D) { in VisitObjCAtDefsFieldDecl() argument
584 VisitFieldDecl(D); in VisitObjCAtDefsFieldDecl()
588 void ASTDeclWriter::VisitObjCCategoryDecl(ObjCCategoryDecl *D) { in VisitObjCCategoryDecl() argument
589 VisitObjCContainerDecl(D); in VisitObjCCategoryDecl()
590 Writer.AddSourceLocation(D->getCategoryNameLoc(), Record); in VisitObjCCategoryDecl()
591 Writer.AddSourceLocation(D->getIvarLBraceLoc(), Record); in VisitObjCCategoryDecl()
592 Writer.AddSourceLocation(D->getIvarRBraceLoc(), Record); in VisitObjCCategoryDecl()
593 Writer.AddDeclRef(D->getClassInterface(), Record); in VisitObjCCategoryDecl()
594 Record.push_back(D->protocol_size()); in VisitObjCCategoryDecl()
595 for (const auto *I : D->protocols()) in VisitObjCCategoryDecl()
597 for (const auto &PL : D->protocol_locs()) in VisitObjCCategoryDecl()
602 void ASTDeclWriter::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D) { in VisitObjCCompatibleAliasDecl() argument
603 VisitNamedDecl(D); in VisitObjCCompatibleAliasDecl()
604 Writer.AddDeclRef(D->getClassInterface(), Record); in VisitObjCCompatibleAliasDecl()
608 void ASTDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { in VisitObjCPropertyDecl() argument
609 VisitNamedDecl(D); in VisitObjCPropertyDecl()
610 Writer.AddSourceLocation(D->getAtLoc(), Record); in VisitObjCPropertyDecl()
611 Writer.AddSourceLocation(D->getLParenLoc(), Record); in VisitObjCPropertyDecl()
612 Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record); in VisitObjCPropertyDecl()
614 Record.push_back((unsigned)D->getPropertyAttributes()); in VisitObjCPropertyDecl()
615 Record.push_back((unsigned)D->getPropertyAttributesAsWritten()); in VisitObjCPropertyDecl()
617 Record.push_back((unsigned)D->getPropertyImplementation()); in VisitObjCPropertyDecl()
618 Writer.AddDeclarationName(D->getGetterName(), Record); in VisitObjCPropertyDecl()
619 Writer.AddDeclarationName(D->getSetterName(), Record); in VisitObjCPropertyDecl()
620 Writer.AddDeclRef(D->getGetterMethodDecl(), Record); in VisitObjCPropertyDecl()
621 Writer.AddDeclRef(D->getSetterMethodDecl(), Record); in VisitObjCPropertyDecl()
622 Writer.AddDeclRef(D->getPropertyIvarDecl(), Record); in VisitObjCPropertyDecl()
626 void ASTDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) { in VisitObjCImplDecl() argument
627 VisitObjCContainerDecl(D); in VisitObjCImplDecl()
628 Writer.AddDeclRef(D->getClassInterface(), Record); in VisitObjCImplDecl()
632 void ASTDeclWriter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { in VisitObjCCategoryImplDecl() argument
633 VisitObjCImplDecl(D); in VisitObjCCategoryImplDecl()
634 Writer.AddIdentifierRef(D->getIdentifier(), Record); in VisitObjCCategoryImplDecl()
635 Writer.AddSourceLocation(D->getCategoryNameLoc(), Record); in VisitObjCCategoryImplDecl()
639 void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) { in VisitObjCImplementationDecl() argument
640 VisitObjCImplDecl(D); in VisitObjCImplementationDecl()
641 Writer.AddDeclRef(D->getSuperClass(), Record); in VisitObjCImplementationDecl()
642 Writer.AddSourceLocation(D->getSuperClassLoc(), Record); in VisitObjCImplementationDecl()
643 Writer.AddSourceLocation(D->getIvarLBraceLoc(), Record); in VisitObjCImplementationDecl()
644 Writer.AddSourceLocation(D->getIvarRBraceLoc(), Record); in VisitObjCImplementationDecl()
645 Record.push_back(D->hasNonZeroConstructors()); in VisitObjCImplementationDecl()
646 Record.push_back(D->hasDestructors()); in VisitObjCImplementationDecl()
647 Writer.AddCXXCtorInitializers(D->IvarInitializers, D->NumIvarInitializers, in VisitObjCImplementationDecl()
652 void ASTDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) { in VisitObjCPropertyImplDecl() argument
653 VisitDecl(D); in VisitObjCPropertyImplDecl()
654 Writer.AddSourceLocation(D->getLocStart(), Record); in VisitObjCPropertyImplDecl()
655 Writer.AddDeclRef(D->getPropertyDecl(), Record); in VisitObjCPropertyImplDecl()
656 Writer.AddDeclRef(D->getPropertyIvarDecl(), Record); in VisitObjCPropertyImplDecl()
657 Writer.AddSourceLocation(D->getPropertyIvarDeclLoc(), Record); in VisitObjCPropertyImplDecl()
658 Writer.AddStmt(D->getGetterCXXConstructor()); in VisitObjCPropertyImplDecl()
659 Writer.AddStmt(D->getSetterCXXAssignment()); in VisitObjCPropertyImplDecl()
663 void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) { in VisitFieldDecl() argument
664 VisitDeclaratorDecl(D); in VisitFieldDecl()
665 Record.push_back(D->isMutable()); in VisitFieldDecl()
666 if (D->InitializerOrBitWidth.getInt() != ICIS_NoInit || in VisitFieldDecl()
667 D->InitializerOrBitWidth.getPointer()) { in VisitFieldDecl()
668 Record.push_back(D->InitializerOrBitWidth.getInt() + 1); in VisitFieldDecl()
669 Writer.AddStmt(D->InitializerOrBitWidth.getPointer()); in VisitFieldDecl()
673 if (!D->getDeclName()) in VisitFieldDecl()
674 Writer.AddDeclRef(Context.getInstantiatedFromUnnamedFieldDecl(D), Record); in VisitFieldDecl()
676 if (!D->hasAttrs() && in VisitFieldDecl()
677 !D->isImplicit() && in VisitFieldDecl()
678 !D->isUsed(false) && in VisitFieldDecl()
679 !D->isInvalidDecl() && in VisitFieldDecl()
680 !D->isReferenced() && in VisitFieldDecl()
681 !D->isTopLevelDeclInObjCContainer() && in VisitFieldDecl()
682 !D->isModulePrivate() && in VisitFieldDecl()
683 !D->getBitWidth() && in VisitFieldDecl()
684 !D->hasInClassInitializer() && in VisitFieldDecl()
685 !D->hasExtInfo() && in VisitFieldDecl()
686 !ObjCIvarDecl::classofKind(D->getKind()) && in VisitFieldDecl()
687 !ObjCAtDefsFieldDecl::classofKind(D->getKind()) && in VisitFieldDecl()
688 D->getDeclName()) in VisitFieldDecl()
694 void ASTDeclWriter::VisitMSPropertyDecl(MSPropertyDecl *D) { in VisitMSPropertyDecl() argument
695 VisitDeclaratorDecl(D); in VisitMSPropertyDecl()
696 Writer.AddIdentifierRef(D->getGetterId(), Record); in VisitMSPropertyDecl()
697 Writer.AddIdentifierRef(D->getSetterId(), Record); in VisitMSPropertyDecl()
701 void ASTDeclWriter::VisitIndirectFieldDecl(IndirectFieldDecl *D) { in VisitIndirectFieldDecl() argument
702 VisitValueDecl(D); in VisitIndirectFieldDecl()
703 Record.push_back(D->getChainingSize()); in VisitIndirectFieldDecl()
705 for (const auto *P : D->chain()) in VisitIndirectFieldDecl()
710 void ASTDeclWriter::VisitVarDecl(VarDecl *D) { in VisitVarDecl() argument
711 VisitRedeclarable(D); in VisitVarDecl()
712 VisitDeclaratorDecl(D); in VisitVarDecl()
713 Record.push_back(D->getStorageClass()); in VisitVarDecl()
714 Record.push_back(D->getTSCSpec()); in VisitVarDecl()
715 Record.push_back(D->getInitStyle()); in VisitVarDecl()
716 Record.push_back(D->isExceptionVariable()); in VisitVarDecl()
717 Record.push_back(D->isNRVOVariable()); in VisitVarDecl()
718 Record.push_back(D->isCXXForRangeDecl()); in VisitVarDecl()
719 Record.push_back(D->isARCPseudoStrong()); in VisitVarDecl()
720 Record.push_back(D->isConstexpr()); in VisitVarDecl()
721 Record.push_back(D->isInitCapture()); in VisitVarDecl()
722 Record.push_back(D->isPreviousDeclInSameBlockScope()); in VisitVarDecl()
723 Record.push_back(D->getLinkageInternal()); in VisitVarDecl()
725 if (D->getInit()) { in VisitVarDecl()
726 Record.push_back(!D->isInitKnownICE() ? 1 : (D->isInitICE() ? 3 : 2)); in VisitVarDecl()
727 Writer.AddStmt(D->getInit()); in VisitVarDecl()
735 if (VarTemplateDecl *TemplD = D->getDescribedVarTemplate()) { in VisitVarDecl()
739 = D->getMemberSpecializationInfo()) { in VisitVarDecl()
748 if (!D->hasAttrs() && in VisitVarDecl()
749 !D->isImplicit() && in VisitVarDecl()
750 !D->isUsed(false) && in VisitVarDecl()
751 !D->isInvalidDecl() && in VisitVarDecl()
752 !D->isReferenced() && in VisitVarDecl()
753 !D->isTopLevelDeclInObjCContainer() && in VisitVarDecl()
754 D->getAccess() == AS_none && in VisitVarDecl()
755 !D->isModulePrivate() && in VisitVarDecl()
756 D->getDeclName().getNameKind() == DeclarationName::Identifier && in VisitVarDecl()
757 !D->hasExtInfo() && in VisitVarDecl()
758 D->getFirstDecl() == D->getMostRecentDecl() && in VisitVarDecl()
759 D->getInitStyle() == VarDecl::CInit && in VisitVarDecl()
760 D->getInit() == nullptr && in VisitVarDecl()
761 !isa<ParmVarDecl>(D) && in VisitVarDecl()
762 !isa<VarTemplateSpecializationDecl>(D) && in VisitVarDecl()
763 !D->isConstexpr() && in VisitVarDecl()
764 !D->isInitCapture() && in VisitVarDecl()
765 !D->isPreviousDeclInSameBlockScope() && in VisitVarDecl()
766 !D->getMemberSpecializationInfo()) in VisitVarDecl()
772 void ASTDeclWriter::VisitImplicitParamDecl(ImplicitParamDecl *D) { in VisitImplicitParamDecl() argument
773 VisitVarDecl(D); in VisitImplicitParamDecl()
777 void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) { in VisitParmVarDecl() argument
778 VisitVarDecl(D); in VisitParmVarDecl()
779 Record.push_back(D->isObjCMethodParameter()); in VisitParmVarDecl()
780 Record.push_back(D->getFunctionScopeDepth()); in VisitParmVarDecl()
781 Record.push_back(D->getFunctionScopeIndex()); in VisitParmVarDecl()
782 Record.push_back(D->getObjCDeclQualifier()); // FIXME: stable encoding in VisitParmVarDecl()
783 Record.push_back(D->isKNRPromoted()); in VisitParmVarDecl()
784 Record.push_back(D->hasInheritedDefaultArg()); in VisitParmVarDecl()
785 Record.push_back(D->hasUninstantiatedDefaultArg()); in VisitParmVarDecl()
786 if (D->hasUninstantiatedDefaultArg()) in VisitParmVarDecl()
787 Writer.AddStmt(D->getUninstantiatedDefaultArg()); in VisitParmVarDecl()
790 assert(!D->isARCPseudoStrong()); // can be true of ImplicitParamDecl in VisitParmVarDecl()
795 if (!D->hasAttrs() && in VisitParmVarDecl()
796 !D->hasExtInfo() && in VisitParmVarDecl()
797 !D->isImplicit() && in VisitParmVarDecl()
798 !D->isUsed(false) && in VisitParmVarDecl()
799 !D->isInvalidDecl() && in VisitParmVarDecl()
800 !D->isReferenced() && in VisitParmVarDecl()
801 D->getAccess() == AS_none && in VisitParmVarDecl()
802 !D->isModulePrivate() && in VisitParmVarDecl()
803 D->getStorageClass() == 0 && in VisitParmVarDecl()
804 D->getInitStyle() == VarDecl::CInit && // Can params have anything else? in VisitParmVarDecl()
805 D->getFunctionScopeDepth() == 0 && in VisitParmVarDecl()
806 D->getObjCDeclQualifier() == 0 && in VisitParmVarDecl()
807 !D->isKNRPromoted() && in VisitParmVarDecl()
808 !D->hasInheritedDefaultArg() && in VisitParmVarDecl()
809 D->getInit() == nullptr && in VisitParmVarDecl()
810 !D->hasUninstantiatedDefaultArg()) // No default expr. in VisitParmVarDecl()
815 assert(!D->getTSCSpec() && "PARM_VAR_DECL can't use TLS"); in VisitParmVarDecl()
816 assert(D->getAccess() == AS_none && "PARM_VAR_DECL can't be public/private"); in VisitParmVarDecl()
817 assert(!D->isExceptionVariable() && "PARM_VAR_DECL can't be exception var"); in VisitParmVarDecl()
818 assert(D->getPreviousDecl() == nullptr && "PARM_VAR_DECL can't be redecl"); in VisitParmVarDecl()
819 assert(!D->isStaticDataMember() && in VisitParmVarDecl()
823 void ASTDeclWriter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { in VisitFileScopeAsmDecl() argument
824 VisitDecl(D); in VisitFileScopeAsmDecl()
825 Writer.AddStmt(D->getAsmString()); in VisitFileScopeAsmDecl()
826 Writer.AddSourceLocation(D->getRParenLoc(), Record); in VisitFileScopeAsmDecl()
830 void ASTDeclWriter::VisitEmptyDecl(EmptyDecl *D) { in VisitEmptyDecl() argument
831 VisitDecl(D); in VisitEmptyDecl()
835 void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) { in VisitBlockDecl() argument
836 VisitDecl(D); in VisitBlockDecl()
837 Writer.AddStmt(D->getBody()); in VisitBlockDecl()
838 Writer.AddTypeSourceInfo(D->getSignatureAsWritten(), Record); in VisitBlockDecl()
839 Record.push_back(D->param_size()); in VisitBlockDecl()
840 for (FunctionDecl::param_iterator P = D->param_begin(), PEnd = D->param_end(); in VisitBlockDecl()
843 Record.push_back(D->isVariadic()); in VisitBlockDecl()
844 Record.push_back(D->blockMissingReturnType()); in VisitBlockDecl()
845 Record.push_back(D->isConversionFromLambda()); in VisitBlockDecl()
846 Record.push_back(D->capturesCXXThis()); in VisitBlockDecl()
847 Record.push_back(D->getNumCaptures()); in VisitBlockDecl()
848 for (const auto &capture : D->captures()) { in VisitBlockDecl()
874 void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) { in VisitLinkageSpecDecl() argument
875 VisitDecl(D); in VisitLinkageSpecDecl()
876 Record.push_back(D->getLanguage()); in VisitLinkageSpecDecl()
877 Writer.AddSourceLocation(D->getExternLoc(), Record); in VisitLinkageSpecDecl()
878 Writer.AddSourceLocation(D->getRBraceLoc(), Record); in VisitLinkageSpecDecl()
882 void ASTDeclWriter::VisitLabelDecl(LabelDecl *D) { in VisitLabelDecl() argument
883 VisitNamedDecl(D); in VisitLabelDecl()
884 Writer.AddSourceLocation(D->getLocStart(), Record); in VisitLabelDecl()
889 void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) { in VisitNamespaceDecl() argument
890 VisitRedeclarable(D); in VisitNamespaceDecl()
891 VisitNamedDecl(D); in VisitNamespaceDecl()
892 Record.push_back(D->isInline()); in VisitNamespaceDecl()
893 Writer.AddSourceLocation(D->getLocStart(), Record); in VisitNamespaceDecl()
894 Writer.AddSourceLocation(D->getRBraceLoc(), Record); in VisitNamespaceDecl()
896 if (D->isOriginalNamespace()) in VisitNamespaceDecl()
897 Writer.AddDeclRef(D->getAnonymousNamespace(), Record); in VisitNamespaceDecl()
900 if (Writer.hasChain() && !D->isOriginalNamespace() && in VisitNamespaceDecl()
901 D->getOriginalNamespace()->isFromASTFile()) { in VisitNamespaceDecl()
902 NamespaceDecl *NS = D->getOriginalNamespace(); in VisitNamespaceDecl()
907 for (StoredDeclsMap::iterator D = Map->begin(), DEnd = Map->end(); in VisitNamespaceDecl() local
908 D != DEnd; ++D) { in VisitNamespaceDecl()
909 DeclContext::lookup_result R = D->second.getLookupResult(); in VisitNamespaceDecl()
917 if (Writer.hasChain() && D->isAnonymousNamespace() && in VisitNamespaceDecl()
918 D == D->getMostRecentDecl()) { in VisitNamespaceDecl()
924 D->getParent()->getRedeclContext()->getPrimaryContext()); in VisitNamespaceDecl()
927 ASTWriter::DeclUpdate(UPD_CXX_ADDED_ANONYMOUS_NAMESPACE, D)); in VisitNamespaceDecl()
932 void ASTDeclWriter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { in VisitNamespaceAliasDecl() argument
933 VisitNamedDecl(D); in VisitNamespaceAliasDecl()
934 Writer.AddSourceLocation(D->getNamespaceLoc(), Record); in VisitNamespaceAliasDecl()
935 Writer.AddSourceLocation(D->getTargetNameLoc(), Record); in VisitNamespaceAliasDecl()
936 Writer.AddNestedNameSpecifierLoc(D->getQualifierLoc(), Record); in VisitNamespaceAliasDecl()
937 Writer.AddDeclRef(D->getNamespace(), Record); in VisitNamespaceAliasDecl()
941 void ASTDeclWriter::VisitUsingDecl(UsingDecl *D) { in VisitUsingDecl() argument
942 VisitNamedDecl(D); in VisitUsingDecl()
943 Writer.AddSourceLocation(D->getUsingLoc(), Record); in VisitUsingDecl()
944 Writer.AddNestedNameSpecifierLoc(D->getQualifierLoc(), Record); in VisitUsingDecl()
945 Writer.AddDeclarationNameLoc(D->DNLoc, D->getDeclName(), Record); in VisitUsingDecl()
946 Writer.AddDeclRef(D->FirstUsingShadow.getPointer(), Record); in VisitUsingDecl()
947 Record.push_back(D->hasTypename()); in VisitUsingDecl()
948 Writer.AddDeclRef(Context.getInstantiatedFromUsingDecl(D), Record); in VisitUsingDecl()
952 void ASTDeclWriter::VisitUsingShadowDecl(UsingShadowDecl *D) { in VisitUsingShadowDecl() argument
953 VisitRedeclarable(D); in VisitUsingShadowDecl()
954 VisitNamedDecl(D); in VisitUsingShadowDecl()
955 Writer.AddDeclRef(D->getTargetDecl(), Record); in VisitUsingShadowDecl()
956 Writer.AddDeclRef(D->UsingOrNextShadow, Record); in VisitUsingShadowDecl()
957 Writer.AddDeclRef(Context.getInstantiatedFromUsingShadowDecl(D), Record); in VisitUsingShadowDecl()
961 void ASTDeclWriter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { in VisitUsingDirectiveDecl() argument
962 VisitNamedDecl(D); in VisitUsingDirectiveDecl()
963 Writer.AddSourceLocation(D->getUsingLoc(), Record); in VisitUsingDirectiveDecl()
964 Writer.AddSourceLocation(D->getNamespaceKeyLocation(), Record); in VisitUsingDirectiveDecl()
965 Writer.AddNestedNameSpecifierLoc(D->getQualifierLoc(), Record); in VisitUsingDirectiveDecl()
966 Writer.AddDeclRef(D->getNominatedNamespace(), Record); in VisitUsingDirectiveDecl()
967 Writer.AddDeclRef(dyn_cast<Decl>(D->getCommonAncestor()), Record); in VisitUsingDirectiveDecl()
971 void ASTDeclWriter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { in VisitUnresolvedUsingValueDecl() argument
972 VisitValueDecl(D); in VisitUnresolvedUsingValueDecl()
973 Writer.AddSourceLocation(D->getUsingLoc(), Record); in VisitUnresolvedUsingValueDecl()
974 Writer.AddNestedNameSpecifierLoc(D->getQualifierLoc(), Record); in VisitUnresolvedUsingValueDecl()
975 Writer.AddDeclarationNameLoc(D->DNLoc, D->getDeclName(), Record); in VisitUnresolvedUsingValueDecl()
980 UnresolvedUsingTypenameDecl *D) { in VisitUnresolvedUsingTypenameDecl() argument
981 VisitTypeDecl(D); in VisitUnresolvedUsingTypenameDecl()
982 Writer.AddSourceLocation(D->getTypenameLoc(), Record); in VisitUnresolvedUsingTypenameDecl()
983 Writer.AddNestedNameSpecifierLoc(D->getQualifierLoc(), Record); in VisitUnresolvedUsingTypenameDecl()
987 void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { in VisitCXXRecordDecl() argument
988 VisitRecordDecl(D); in VisitCXXRecordDecl()
993 if (ClassTemplateDecl *TemplD = D->getDescribedClassTemplate()) { in VisitCXXRecordDecl()
997 = D->getMemberSpecializationInfo()) { in VisitCXXRecordDecl()
1006 Record.push_back(D->isThisDeclarationADefinition()); in VisitCXXRecordDecl()
1007 if (D->isThisDeclarationADefinition()) in VisitCXXRecordDecl()
1008 Writer.AddCXXDefinitionData(D, Record); in VisitCXXRecordDecl()
1012 if (D->IsCompleteDefinition) in VisitCXXRecordDecl()
1013 Writer.AddDeclRef(Context.getCurrentKeyFunction(D), Record); in VisitCXXRecordDecl()
1018 void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) { in VisitCXXMethodDecl() argument
1019 VisitFunctionDecl(D); in VisitCXXMethodDecl()
1020 if (D->isCanonicalDecl()) { in VisitCXXMethodDecl()
1021 Record.push_back(D->size_overridden_methods()); in VisitCXXMethodDecl()
1023 I = D->begin_overridden_methods(), E = D->end_overridden_methods(); in VisitCXXMethodDecl()
1033 void ASTDeclWriter::VisitCXXConstructorDecl(CXXConstructorDecl *D) { in VisitCXXConstructorDecl() argument
1034 VisitCXXMethodDecl(D); in VisitCXXConstructorDecl()
1036 Writer.AddDeclRef(D->getInheritedConstructor(), Record); in VisitCXXConstructorDecl()
1037 Record.push_back(D->IsExplicitSpecified); in VisitCXXConstructorDecl()
1038 Writer.AddCXXCtorInitializers(D->CtorInitializers, D->NumCtorInitializers, in VisitCXXConstructorDecl()
1044 void ASTDeclWriter::VisitCXXDestructorDecl(CXXDestructorDecl *D) { in VisitCXXDestructorDecl() argument
1045 VisitCXXMethodDecl(D); in VisitCXXDestructorDecl()
1047 Writer.AddDeclRef(D->OperatorDelete, Record); in VisitCXXDestructorDecl()
1052 void ASTDeclWriter::VisitCXXConversionDecl(CXXConversionDecl *D) { in VisitCXXConversionDecl() argument
1053 VisitCXXMethodDecl(D); in VisitCXXConversionDecl()
1054 Record.push_back(D->IsExplicitSpecified); in VisitCXXConversionDecl()
1058 void ASTDeclWriter::VisitImportDecl(ImportDecl *D) { in VisitImportDecl() argument
1059 VisitDecl(D); in VisitImportDecl()
1060 Record.push_back(Writer.getSubmoduleID(D->getImportedModule())); in VisitImportDecl()
1061 ArrayRef<SourceLocation> IdentifierLocs = D->getIdentifierLocs(); in VisitImportDecl()
1064 Writer.AddSourceLocation(D->getLocEnd(), Record); in VisitImportDecl()
1076 void ASTDeclWriter::VisitAccessSpecDecl(AccessSpecDecl *D) { in VisitAccessSpecDecl() argument
1077 VisitDecl(D); in VisitAccessSpecDecl()
1078 Writer.AddSourceLocation(D->getColonLoc(), Record); in VisitAccessSpecDecl()
1082 void ASTDeclWriter::VisitFriendDecl(FriendDecl *D) { in VisitFriendDecl() argument
1085 Record.push_back(D->NumTPLists); in VisitFriendDecl()
1086 VisitDecl(D); in VisitFriendDecl()
1087 bool hasFriendDecl = D->Friend.is<NamedDecl*>(); in VisitFriendDecl()
1090 Writer.AddDeclRef(D->getFriendDecl(), Record); in VisitFriendDecl()
1092 Writer.AddTypeSourceInfo(D->getFriendType(), Record); in VisitFriendDecl()
1093 for (unsigned i = 0; i < D->NumTPLists; ++i) in VisitFriendDecl()
1094 Writer.AddTemplateParameterList(D->getFriendTypeTemplateParameterList(i), in VisitFriendDecl()
1096 Writer.AddDeclRef(D->getNextFriend(), Record); in VisitFriendDecl()
1097 Record.push_back(D->UnsupportedFriend); in VisitFriendDecl()
1098 Writer.AddSourceLocation(D->FriendLoc, Record); in VisitFriendDecl()
1102 void ASTDeclWriter::VisitFriendTemplateDecl(FriendTemplateDecl *D) { in VisitFriendTemplateDecl() argument
1103 VisitDecl(D); in VisitFriendTemplateDecl()
1104 Record.push_back(D->getNumTemplateParameters()); in VisitFriendTemplateDecl()
1105 for (unsigned i = 0, e = D->getNumTemplateParameters(); i != e; ++i) in VisitFriendTemplateDecl()
1106 Writer.AddTemplateParameterList(D->getTemplateParameterList(i), Record); in VisitFriendTemplateDecl()
1107 Record.push_back(D->getFriendDecl() != nullptr); in VisitFriendTemplateDecl()
1108 if (D->getFriendDecl()) in VisitFriendTemplateDecl()
1109 Writer.AddDeclRef(D->getFriendDecl(), Record); in VisitFriendTemplateDecl()
1111 Writer.AddTypeSourceInfo(D->getFriendType(), Record); in VisitFriendTemplateDecl()
1112 Writer.AddSourceLocation(D->getFriendLoc(), Record); in VisitFriendTemplateDecl()
1116 void ASTDeclWriter::VisitTemplateDecl(TemplateDecl *D) { in VisitTemplateDecl() argument
1117 VisitNamedDecl(D); in VisitTemplateDecl()
1119 Writer.AddDeclRef(D->getTemplatedDecl(), Record); in VisitTemplateDecl()
1120 Writer.AddTemplateParameterList(D->getTemplateParameters(), Record); in VisitTemplateDecl()
1123 void ASTDeclWriter::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { in VisitRedeclarableTemplateDecl() argument
1124 VisitRedeclarable(D); in VisitRedeclarableTemplateDecl()
1128 if (D->isFirstDecl()) { in VisitRedeclarableTemplateDecl()
1130 Writer.AddDeclRef(D->getInstantiatedFromMemberTemplate(), Record); in VisitRedeclarableTemplateDecl()
1131 if (D->getInstantiatedFromMemberTemplate()) in VisitRedeclarableTemplateDecl()
1132 Record.push_back(D->isMemberSpecialization()); in VisitRedeclarableTemplateDecl()
1135 VisitTemplateDecl(D); in VisitRedeclarableTemplateDecl()
1136 Record.push_back(D->getIdentifierNamespace()); in VisitRedeclarableTemplateDecl()
1139 void ASTDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) { in VisitClassTemplateDecl() argument
1140 VisitRedeclarableTemplateDecl(D); in VisitClassTemplateDecl()
1142 if (D->isFirstDecl()) { in VisitClassTemplateDecl()
1144 CTSDSetTy &CTSDSet = D->getSpecializations(); in VisitClassTemplateDecl()
1153 CTPSDSetTy &CTPSDSet = D->getPartialSpecializations(); in VisitClassTemplateDecl()
1164 ClassTemplateSpecializationDecl *D) { in VisitClassTemplateSpecializationDecl() argument
1165 VisitCXXRecordDecl(D); in VisitClassTemplateSpecializationDecl()
1169 = D->getSpecializedTemplateOrPartial(); in VisitClassTemplateSpecializationDecl()
1175 Writer.AddTemplateArgumentList(&D->getTemplateInstantiationArgs(), Record); in VisitClassTemplateSpecializationDecl()
1178 Writer.AddTemplateArgumentList(&D->getTemplateArgs(), Record); in VisitClassTemplateSpecializationDecl()
1179 Writer.AddSourceLocation(D->getPointOfInstantiation(), Record); in VisitClassTemplateSpecializationDecl()
1180 Record.push_back(D->getSpecializationKind()); in VisitClassTemplateSpecializationDecl()
1181 Record.push_back(D->isCanonicalDecl()); in VisitClassTemplateSpecializationDecl()
1183 if (D->isCanonicalDecl()) { in VisitClassTemplateSpecializationDecl()
1185 Writer.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl(), Record); in VisitClassTemplateSpecializationDecl()
1189 Writer.AddTypeSourceInfo(D->getTypeAsWritten(), Record); in VisitClassTemplateSpecializationDecl()
1190 if (D->getTypeAsWritten()) { in VisitClassTemplateSpecializationDecl()
1191 Writer.AddSourceLocation(D->getExternLoc(), Record); in VisitClassTemplateSpecializationDecl()
1192 Writer.AddSourceLocation(D->getTemplateKeywordLoc(), Record); in VisitClassTemplateSpecializationDecl()
1199 ClassTemplatePartialSpecializationDecl *D) { in VisitClassTemplatePartialSpecializationDecl() argument
1200 VisitClassTemplateSpecializationDecl(D); in VisitClassTemplatePartialSpecializationDecl()
1202 Writer.AddTemplateParameterList(D->getTemplateParameters(), Record); in VisitClassTemplatePartialSpecializationDecl()
1203 Writer.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten(), Record); in VisitClassTemplatePartialSpecializationDecl()
1206 if (D->getPreviousDecl() == nullptr) { in VisitClassTemplatePartialSpecializationDecl()
1207 Writer.AddDeclRef(D->getInstantiatedFromMember(), Record); in VisitClassTemplatePartialSpecializationDecl()
1208 Record.push_back(D->isMemberSpecialization()); in VisitClassTemplatePartialSpecializationDecl()
1214 void ASTDeclWriter::VisitVarTemplateDecl(VarTemplateDecl *D) { in VisitVarTemplateDecl() argument
1215 VisitRedeclarableTemplateDecl(D); in VisitVarTemplateDecl()
1217 if (D->isFirstDecl()) { in VisitVarTemplateDecl()
1219 VTSDSetTy &VTSDSet = D->getSpecializations(); in VisitVarTemplateDecl()
1229 VTPSDSetTy &VTPSDSet = D->getPartialSpecializations(); in VisitVarTemplateDecl()
1241 VarTemplateSpecializationDecl *D) { in VisitVarTemplateSpecializationDecl() argument
1242 VisitVarDecl(D); in VisitVarTemplateSpecializationDecl()
1245 InstFrom = D->getSpecializedTemplateOrPartial(); in VisitVarTemplateSpecializationDecl()
1251 Writer.AddTemplateArgumentList(&D->getTemplateInstantiationArgs(), Record); in VisitVarTemplateSpecializationDecl()
1255 Writer.AddTypeSourceInfo(D->getTypeAsWritten(), Record); in VisitVarTemplateSpecializationDecl()
1256 if (D->getTypeAsWritten()) { in VisitVarTemplateSpecializationDecl()
1257 Writer.AddSourceLocation(D->getExternLoc(), Record); in VisitVarTemplateSpecializationDecl()
1258 Writer.AddSourceLocation(D->getTemplateKeywordLoc(), Record); in VisitVarTemplateSpecializationDecl()
1261 Writer.AddTemplateArgumentList(&D->getTemplateArgs(), Record); in VisitVarTemplateSpecializationDecl()
1262 Writer.AddSourceLocation(D->getPointOfInstantiation(), Record); in VisitVarTemplateSpecializationDecl()
1263 Record.push_back(D->getSpecializationKind()); in VisitVarTemplateSpecializationDecl()
1264 Record.push_back(D->isCanonicalDecl()); in VisitVarTemplateSpecializationDecl()
1266 if (D->isCanonicalDecl()) { in VisitVarTemplateSpecializationDecl()
1268 Writer.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl(), Record); in VisitVarTemplateSpecializationDecl()
1275 VarTemplatePartialSpecializationDecl *D) { in VisitVarTemplatePartialSpecializationDecl() argument
1276 VisitVarTemplateSpecializationDecl(D); in VisitVarTemplatePartialSpecializationDecl()
1278 Writer.AddTemplateParameterList(D->getTemplateParameters(), Record); in VisitVarTemplatePartialSpecializationDecl()
1279 Writer.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten(), Record); in VisitVarTemplatePartialSpecializationDecl()
1282 if (D->getPreviousDecl() == nullptr) { in VisitVarTemplatePartialSpecializationDecl()
1283 Writer.AddDeclRef(D->getInstantiatedFromMember(), Record); in VisitVarTemplatePartialSpecializationDecl()
1284 Record.push_back(D->isMemberSpecialization()); in VisitVarTemplatePartialSpecializationDecl()
1291 ClassScopeFunctionSpecializationDecl *D) { in VisitClassScopeFunctionSpecializationDecl() argument
1292 VisitDecl(D); in VisitClassScopeFunctionSpecializationDecl()
1293 Writer.AddDeclRef(D->getSpecialization(), Record); in VisitClassScopeFunctionSpecializationDecl()
1298 void ASTDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { in VisitFunctionTemplateDecl() argument
1299 VisitRedeclarableTemplateDecl(D); in VisitFunctionTemplateDecl()
1301 if (D->isFirstDecl()) { in VisitFunctionTemplateDecl()
1305 Record.push_back(D->getSpecializations().size()); in VisitFunctionTemplateDecl()
1307 I = D->getSpecializations().begin(), in VisitFunctionTemplateDecl()
1308 E = D->getSpecializations().end() ; I != E; ++I) { in VisitFunctionTemplateDecl()
1317 void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { in VisitTemplateTypeParmDecl() argument
1318 VisitTypeDecl(D); in VisitTemplateTypeParmDecl()
1320 Record.push_back(D->wasDeclaredWithTypename()); in VisitTemplateTypeParmDecl()
1321 Record.push_back(D->defaultArgumentWasInherited()); in VisitTemplateTypeParmDecl()
1322 Writer.AddTypeSourceInfo(D->getDefaultArgumentInfo(), Record); in VisitTemplateTypeParmDecl()
1327 void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { in VisitNonTypeTemplateParmDecl() argument
1331 if (D->isExpandedParameterPack()) in VisitNonTypeTemplateParmDecl()
1332 Record.push_back(D->getNumExpansionTypes()); in VisitNonTypeTemplateParmDecl()
1334 VisitDeclaratorDecl(D); in VisitNonTypeTemplateParmDecl()
1336 Record.push_back(D->getDepth()); in VisitNonTypeTemplateParmDecl()
1337 Record.push_back(D->getPosition()); in VisitNonTypeTemplateParmDecl()
1339 if (D->isExpandedParameterPack()) { in VisitNonTypeTemplateParmDecl()
1340 for (unsigned I = 0, N = D->getNumExpansionTypes(); I != N; ++I) { in VisitNonTypeTemplateParmDecl()
1341 Writer.AddTypeRef(D->getExpansionType(I), Record); in VisitNonTypeTemplateParmDecl()
1342 Writer.AddTypeSourceInfo(D->getExpansionTypeSourceInfo(I), Record); in VisitNonTypeTemplateParmDecl()
1348 Record.push_back(D->isParameterPack()); in VisitNonTypeTemplateParmDecl()
1349 Record.push_back(D->getDefaultArgument() != nullptr); in VisitNonTypeTemplateParmDecl()
1350 if (D->getDefaultArgument()) { in VisitNonTypeTemplateParmDecl()
1351 Writer.AddStmt(D->getDefaultArgument()); in VisitNonTypeTemplateParmDecl()
1352 Record.push_back(D->defaultArgumentWasInherited()); in VisitNonTypeTemplateParmDecl()
1358 void ASTDeclWriter::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) { in VisitTemplateTemplateParmDecl() argument
1362 if (D->isExpandedParameterPack()) in VisitTemplateTemplateParmDecl()
1363 Record.push_back(D->getNumExpansionTemplateParameters()); in VisitTemplateTemplateParmDecl()
1365 VisitTemplateDecl(D); in VisitTemplateTemplateParmDecl()
1367 Record.push_back(D->getDepth()); in VisitTemplateTemplateParmDecl()
1368 Record.push_back(D->getPosition()); in VisitTemplateTemplateParmDecl()
1370 if (D->isExpandedParameterPack()) { in VisitTemplateTemplateParmDecl()
1371 for (unsigned I = 0, N = D->getNumExpansionTemplateParameters(); in VisitTemplateTemplateParmDecl()
1373 Writer.AddTemplateParameterList(D->getExpansionTemplateParameters(I), in VisitTemplateTemplateParmDecl()
1378 Writer.AddTemplateArgumentLoc(D->getDefaultArgument(), Record); in VisitTemplateTemplateParmDecl()
1379 Record.push_back(D->defaultArgumentWasInherited()); in VisitTemplateTemplateParmDecl()
1380 Record.push_back(D->isParameterPack()); in VisitTemplateTemplateParmDecl()
1385 void ASTDeclWriter::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) { in VisitTypeAliasTemplateDecl() argument
1386 VisitRedeclarableTemplateDecl(D); in VisitTypeAliasTemplateDecl()
1390 void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) { in VisitStaticAssertDecl() argument
1391 VisitDecl(D); in VisitStaticAssertDecl()
1392 Writer.AddStmt(D->getAssertExpr()); in VisitStaticAssertDecl()
1393 Record.push_back(D->isFailed()); in VisitStaticAssertDecl()
1394 Writer.AddStmt(D->getMessage()); in VisitStaticAssertDecl()
1395 Writer.AddSourceLocation(D->getRParenLoc(), Record); in VisitStaticAssertDecl()
1417 void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { in VisitRedeclarable() argument
1418 T *First = D->getFirstDecl(); in VisitRedeclarable()
1420 assert(isRedeclarableDeclKind(static_cast<T *>(D)->getKind()) && in VisitRedeclarable()
1431 (void)Writer.GetDeclRef(D->getPreviousDecl()); in VisitRedeclarable()
1440 void ASTDeclWriter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) { in VisitOMPThreadPrivateDecl() argument
1441 Record.push_back(D->varlist_size()); in VisitOMPThreadPrivateDecl()
1442 VisitDecl(D); in VisitOMPThreadPrivateDecl()
1443 for (auto *I : D->varlists()) in VisitOMPThreadPrivateDecl()
1823 static bool isRequiredDecl(const Decl *D, ASTContext &Context) { in isRequiredDecl() argument
1830 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) || isa<ImportDecl>(D)) in isRequiredDecl()
1833 return Context.DeclMustBeEmitted(D); in isRequiredDecl()
1836 void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) { in WriteDecl() argument
1845 if (D->isFromASTFile()) in WriteDecl()
1846 ID = getDeclID(D); in WriteDecl()
1848 serialization::DeclID &IDR = DeclIDs[D]; in WriteDecl()
1864 DeclContext *DC = dyn_cast<DeclContext>(D); in WriteDecl()
1881 D->getLocation())); in WriteDecl()
1886 SourceLocation Loc = D->getLocation(); in WriteDecl()
1897 associateDeclWithFile(D, ID); in WriteDecl()
1904 W.Visit(D); in WriteDecl()
1909 D->getDeclKindName() + "'"); in WriteDecl()
1920 if (isRequiredDecl(D, Context)) in WriteDecl()