24#include "llvm/Bitstream/BitstreamWriter.h"
25#include "llvm/Support/ErrorHandling.h"
28using namespace serialization;
42 bool GeneratingReducedBMI =
false;
48 Code((serialization::
DeclCode)0), AbbrevToUse(0),
49 GeneratingReducedBMI(GeneratingReducedBMI) {}
53 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
55 return Record.Emit(Code, AbbrevToUse);
173 for (
auto *typeParam : *typeParams) {
174 Record.AddDeclRef(typeParam);
183 const Decl *
D,
bool IncludeLocal,
184 llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
188 if (R->isFromASTFile())
190 else if (IncludeLocal)
199 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
202 for (
const auto &F : Firsts)
203 Record.AddDeclRef(F.second);
213 assert((isa<ClassTemplateSpecializationDecl>(
D) ||
214 isa<VarTemplateSpecializationDecl>(
D) || isa<FunctionDecl>(
D)) &&
215 "Must not be called with other decls");
216 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
219 for (
const auto &F : Firsts) {
222 PartialSpecsInMap.push_back(F.second);
224 SpecsInMap.push_back(F.second);
229 template <
typename EntryType>
238 return Common->PartialSpecializations;
245 template<
typename DeclTy>
247 auto *Common =
D->getCommonPtr();
252 if (Writer.Chain !=
Record.getASTContext().getExternalSource() &&
254 D->LoadLazySpecializations();
261 for (
auto &Entry : Common->Specializations)
268 for (
auto *
D : AllSpecs) {
273 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
277 if (isa<FunctionTemplateDecl>(
D)) {
278 assert(PartialSpecs.empty());
282 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
283 D, PartialSpecs,
true));
306 Writer.PartialSpecializationsUpdates[cast<NamedDecl>(Template)]
309 Writer.SpecializationsUpdates[cast<NamedDecl>(Template)].push_back(
316 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
317 if (FD->isInlined() || FD->isConstexpr())
320 if (FD->isDependentContext())
327 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
328 if (!VD->getDeclContext()->getRedeclContext()->isFileContext() ||
329 VD->isInline() || VD->isConstexpr() || isa<ParmVarDecl>(VD) ||
333 VD->hasConstantInitialization())
349 if (
auto *DD = dyn_cast<DeclaratorDecl>(
D)) {
350 if (
auto *TInfo = DD->getTypeSourceInfo())
351 Record.AddTypeLoc(TInfo->getTypeLoc());
357 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
359 Record.push_back(FD->doesThisDeclarationHaveABody());
360 if (FD->doesThisDeclarationHaveABody())
361 Record.AddFunctionDefinition(FD);
370 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
372 Record.AddVarDeclInit(VD);
379 if (
auto *FD = dyn_cast<FieldDecl>(
D)) {
380 if (FD->hasInClassInitializer()) {
381 if (
Expr *
Init = FD->getInClassInitializer()) {
394 if (
auto *DC = dyn_cast<DeclContext>(
D))
419 Record.push_back(DeclBits);
440 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
441 if (!NS->isFromASTFile())
443 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
444 if (!NS->isInlineNamespace())
446 DC = NS->getParent();
452 StringRef Arg =
D->getArg();
453 Record.push_back(Arg.size());
456 Record.push_back(
D->getCommentKind());
463 StringRef Name =
D->getName();
464 StringRef
Value =
D->getValue();
474 llvm_unreachable(
"Translation units aren't directly serialized");
479 Record.AddDeclarationName(
D->getDeclName());
494 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
495 Record.push_back(
D->isModed());
497 Record.AddTypeRef(
D->getUnderlyingType());
498 Record.AddDeclRef(
D->getAnonDeclWithTypedefName(
false));
519 Record.AddDeclRef(
D->getDescribedAliasTemplate());
524 static_assert(DeclContext::NumTagDeclBits == 23,
525 "You need to update the serializer after you change the "
533 TagDeclBits.
addBits(llvm::to_underlying(
D->getTagKind()), 3);
534 TagDeclBits.
addBit(!isa<CXXRecordDecl>(
D) ?
D->isCompleteDefinition() : 0);
535 TagDeclBits.
addBit(
D->isEmbeddedInDeclarator());
536 TagDeclBits.
addBit(
D->isFreeStanding());
537 TagDeclBits.
addBit(
D->isCompleteDefinitionRequired());
539 D->hasExtInfo() ? 1 : (
D->getTypedefNameForAnonDecl() ? 2 : 0),
541 Record.push_back(TagDeclBits);
543 Record.AddSourceRange(
D->getBraceRange());
545 if (
D->hasExtInfo()) {
546 Record.AddQualifierInfo(*
D->getExtInfo());
547 }
else if (
auto *TD =
D->getTypedefNameForAnonDecl()) {
549 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
554 static_assert(DeclContext::NumEnumDeclBits == 43,
555 "You need to update the serializer after you change the "
559 Record.AddTypeSourceInfo(
D->getIntegerTypeSourceInfo());
560 if (!
D->getIntegerTypeSourceInfo())
561 Record.AddTypeRef(
D->getIntegerType());
562 Record.AddTypeRef(
D->getPromotionType());
565 EnumDeclBits.
addBits(
D->getNumPositiveBits(), 8);
566 EnumDeclBits.
addBits(
D->getNumNegativeBits(), 8);
567 EnumDeclBits.
addBit(
D->isScoped());
568 EnumDeclBits.
addBit(
D->isScopedUsingClassTag());
569 EnumDeclBits.
addBit(
D->isFixed());
570 Record.push_back(EnumDeclBits);
572 Record.push_back(
D->getODRHash());
575 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
576 Record.push_back(MemberInfo->getTemplateSpecializationKind());
577 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
579 Record.AddDeclRef(
nullptr);
584 !
D->getTypedefNameForAnonDecl() &&
588 !
D->getIntegerTypeSourceInfo() && !
D->getMemberSpecializationInfo() &&
597 static_assert(DeclContext::NumRecordDeclBits == 64,
598 "You need to update the serializer after you change the "
604 RecordDeclBits.
addBit(
D->hasFlexibleArrayMember());
605 RecordDeclBits.
addBit(
D->isAnonymousStructOrUnion());
606 RecordDeclBits.
addBit(
D->hasObjectMember());
607 RecordDeclBits.
addBit(
D->hasVolatileMember());
608 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDefaultInitialize());
609 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveCopy());
610 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDestroy());
611 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDefaultInitializeCUnion());
612 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDestructCUnion());
613 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveCopyCUnion());
614 RecordDeclBits.
addBit(
D->isParamDestroyedInCallee());
615 RecordDeclBits.
addBits(llvm::to_underlying(
D->getArgPassingRestrictions()), 2);
616 Record.push_back(RecordDeclBits);
620 if (!isa<CXXRecordDecl>(
D))
621 Record.push_back(
D->getODRHash());
625 !
D->getTypedefNameForAnonDecl() &&
638 Record.AddTypeRef(
D->getType());
643 Record.push_back(
D->getInitExpr()? 1 : 0);
644 if (
D->getInitExpr())
645 Record.AddStmt(
D->getInitExpr());
646 Record.AddAPSInt(
D->getInitVal());
653 Record.AddSourceLocation(
D->getInnerLocStart());
654 Record.push_back(
D->hasExtInfo());
655 if (
D->hasExtInfo()) {
656 DeclaratorDecl::ExtInfo *Info =
D->getExtInfo();
657 Record.AddQualifierInfo(*Info);
658 Record.AddStmt(Info->TrailingRequiresClause);
661 Record.AddTypeRef(
D->getTypeSourceInfo() ?
D->getTypeSourceInfo()->getType()
666 static_assert(DeclContext::NumFunctionDeclBits == 44,
667 "You need to update the serializer after you change the "
672 Record.push_back(
D->getTemplatedKind());
673 switch (
D->getTemplatedKind()) {
677 Record.AddDeclRef(
D->getInstantiatedFromDecl());
680 Record.AddDeclRef(
D->getDescribedFunctionTemplate());
691 FTSInfo =
D->getTemplateSpecializationInfo();
704 Record.AddASTTemplateArgumentListInfo(
712 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
713 Record.push_back(MemberInfo->getTemplateSpecializationKind());
714 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
728 DFTSInfo =
D->getDependentSpecializationInfo();
738 Record.AddASTTemplateArgumentListInfo(
745 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
753 FunctionDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()), 3);
754 FunctionDeclBits.
addBits((uint32_t)
D->getStorageClass(), 3);
755 FunctionDeclBits.
addBit(
D->isInlineSpecified());
756 FunctionDeclBits.
addBit(
D->isInlined());
757 FunctionDeclBits.
addBit(
D->hasSkippedBody());
758 FunctionDeclBits.
addBit(
D->isVirtualAsWritten());
759 FunctionDeclBits.
addBit(
D->isPureVirtual());
760 FunctionDeclBits.
addBit(
D->hasInheritedPrototype());
761 FunctionDeclBits.
addBit(
D->hasWrittenPrototype());
762 FunctionDeclBits.
addBit(
D->isDeletedBit());
763 FunctionDeclBits.
addBit(
D->isTrivial());
764 FunctionDeclBits.
addBit(
D->isTrivialForCall());
765 FunctionDeclBits.
addBit(
D->isDefaulted());
766 FunctionDeclBits.
addBit(
D->isExplicitlyDefaulted());
767 FunctionDeclBits.
addBit(
D->isIneligibleOrNotSelected());
768 FunctionDeclBits.
addBits((uint64_t)(
D->getConstexprKind()), 2);
769 FunctionDeclBits.
addBit(
D->hasImplicitReturnZero());
770 FunctionDeclBits.
addBit(
D->isMultiVersion());
771 FunctionDeclBits.
addBit(
D->isLateTemplateParsed());
772 FunctionDeclBits.
addBit(
D->FriendConstraintRefersToEnclosingTemplate());
773 FunctionDeclBits.
addBit(
D->usesSEHTry());
774 Record.push_back(FunctionDeclBits);
777 if (
D->isExplicitlyDefaulted())
778 Record.AddSourceLocation(
D->getDefaultLoc());
780 Record.push_back(
D->getODRHash());
782 if (
D->isDefaulted() ||
D->isDeletedAsWritten()) {
783 if (
auto *FDI =
D->getDefalutedOrDeletedInfo()) {
787 Record.push_back(1 | (DeletedMessage ? 2 : 0));
789 Record.AddStmt(DeletedMessage);
791 Record.push_back(FDI->getUnqualifiedLookups().size());
793 Record.AddDeclRef(
P.getDecl());
794 Record.push_back(
P.getAccess());
805 if (
auto *RD = dyn_cast<CXXRecordDecl>(
D->getLexicalParent()))
806 if (RD->isDependentContext() && RD->isThisDeclarationADefinition()) {
807 Writer.RelatedDeclsMap[Writer.
GetDeclRef(RD)].push_back(
812 Record.push_back(
D->param_size());
813 for (
auto *
P :
D->parameters())
820 uint64_t Kind =
static_cast<uint64_t
>(ES.
getKind());
821 Kind = Kind << 1 | static_cast<bool>(ES.
getExpr());
832 Record.push_back(
static_cast<unsigned char>(
D->getDeductionCandidateKind()));
837 static_assert(DeclContext::NumObjCMethodDeclBits == 37,
838 "You need to update the serializer after you change the "
839 "ObjCMethodDeclBits");
844 bool HasBodyStuff =
D->
getBody() !=
nullptr;
845 Record.push_back(HasBodyStuff);
849 Record.AddDeclRef(
D->getSelfDecl());
850 Record.AddDeclRef(
D->getCmdDecl());
851 Record.push_back(
D->isInstanceMethod());
852 Record.push_back(
D->isVariadic());
853 Record.push_back(
D->isPropertyAccessor());
854 Record.push_back(
D->isSynthesizedAccessorStub());
855 Record.push_back(
D->isDefined());
856 Record.push_back(
D->isOverriding());
857 Record.push_back(
D->hasSkippedBody());
859 Record.push_back(
D->isRedeclaration());
860 Record.push_back(
D->hasRedeclaration());
861 if (
D->hasRedeclaration()) {
862 assert(
Record.getASTContext().getObjCMethodRedeclaration(
D));
863 Record.AddDeclRef(
Record.getASTContext().getObjCMethodRedeclaration(
D));
867 Record.push_back(llvm::to_underlying(
D->getImplementationControl()));
869 Record.push_back(
D->getObjCDeclQualifier());
870 Record.push_back(
D->hasRelatedResultType());
871 Record.AddTypeRef(
D->getReturnType());
872 Record.AddTypeSourceInfo(
D->getReturnTypeSourceInfo());
874 Record.push_back(
D->param_size());
875 for (
const auto *
P :
D->parameters())
878 Record.push_back(
D->getSelLocsKind());
879 unsigned NumStoredSelLocs =
D->getNumStoredSelLocs();
881 Record.push_back(NumStoredSelLocs);
882 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
883 Record.AddSourceLocation(SelLocs[i]);
892 Record.AddSourceLocation(
D->VarianceLoc);
893 Record.AddSourceLocation(
D->ColonLoc);
899 static_assert(DeclContext::NumObjCContainerDeclBits == 64,
900 "You need to update the serializer after you change the "
901 "ObjCContainerDeclBits");
904 Record.AddSourceLocation(
D->getAtStartLoc());
905 Record.AddSourceRange(
D->getAtEndRange());
915 Record.push_back(
D->isThisDeclarationADefinition());
916 if (
D->isThisDeclarationADefinition()) {
918 ObjCInterfaceDecl::DefinitionData &
Data =
D->data();
920 Record.AddTypeSourceInfo(
D->getSuperClassTInfo());
921 Record.AddSourceLocation(
D->getEndOfDefinitionLoc());
922 Record.push_back(
Data.HasDesignatedInitializers);
923 Record.push_back(
D->getODRHash());
926 Record.push_back(
Data.ReferencedProtocols.size());
927 for (
const auto *
P :
D->protocols())
929 for (
const auto &PL :
D->protocol_locs())
930 Record.AddSourceLocation(PL);
933 Record.push_back(
Data.AllReferencedProtocols.size());
935 P =
Data.AllReferencedProtocols.begin(),
936 PEnd =
Data.AllReferencedProtocols.end();
943 Writer.ObjCClassesWithCategories.insert(
D);
946 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
957 Record.push_back(
D->getAccessControl());
958 Record.push_back(
D->getSynthesize());
979 Record.push_back(
D->isThisDeclarationADefinition());
980 if (
D->isThisDeclarationADefinition()) {
981 Record.push_back(
D->protocol_size());
982 for (
const auto *I :
D->protocols())
984 for (
const auto &PL :
D->protocol_locs())
985 Record.AddSourceLocation(PL);
986 Record.push_back(
D->getODRHash());
999 Record.AddSourceLocation(
D->getCategoryNameLoc());
1000 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1001 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1002 Record.AddDeclRef(
D->getClassInterface());
1004 Record.push_back(
D->protocol_size());
1005 for (
const auto *I :
D->protocols())
1007 for (
const auto &PL :
D->protocol_locs())
1008 Record.AddSourceLocation(PL);
1014 Record.AddDeclRef(
D->getClassInterface());
1020 Record.AddSourceLocation(
D->getAtLoc());
1021 Record.AddSourceLocation(
D->getLParenLoc());
1022 Record.AddTypeRef(
D->getType());
1023 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
1025 Record.push_back((
unsigned)
D->getPropertyAttributes());
1026 Record.push_back((
unsigned)
D->getPropertyAttributesAsWritten());
1028 Record.push_back((
unsigned)
D->getPropertyImplementation());
1029 Record.AddDeclarationName(
D->getGetterName());
1030 Record.AddSourceLocation(
D->getGetterNameLoc());
1031 Record.AddDeclarationName(
D->getSetterName());
1032 Record.AddSourceLocation(
D->getSetterNameLoc());
1033 Record.AddDeclRef(
D->getGetterMethodDecl());
1034 Record.AddDeclRef(
D->getSetterMethodDecl());
1035 Record.AddDeclRef(
D->getPropertyIvarDecl());
1041 Record.AddDeclRef(
D->getClassInterface());
1047 Record.AddSourceLocation(
D->getCategoryNameLoc());
1053 Record.AddDeclRef(
D->getSuperClass());
1054 Record.AddSourceLocation(
D->getSuperClassLoc());
1055 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1056 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1057 Record.push_back(
D->hasNonZeroConstructors());
1058 Record.push_back(
D->hasDestructors());
1059 Record.push_back(
D->NumIvarInitializers);
1060 if (
D->NumIvarInitializers)
1061 Record.AddCXXCtorInitializers(
1069 Record.AddDeclRef(
D->getPropertyDecl());
1070 Record.AddDeclRef(
D->getPropertyIvarDecl());
1071 Record.AddSourceLocation(
D->getPropertyIvarDeclLoc());
1072 Record.AddDeclRef(
D->getGetterMethodDecl());
1073 Record.AddDeclRef(
D->getSetterMethodDecl());
1074 Record.AddStmt(
D->getGetterCXXConstructor());
1075 Record.AddStmt(
D->getSetterCXXAssignment());
1081 Record.push_back(
D->isMutable());
1083 Record.push_back((
D->StorageKind << 1) |
D->BitField);
1084 if (
D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1086 else if (
D->BitField)
1087 Record.AddStmt(
D->getBitWidth());
1089 if (!
D->getDeclName() ||
D->isPlaceholderVar(Writer.
getLangOpts()))
1091 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(
D));
1101 !
D->getBitWidth() &&
1102 !
D->hasInClassInitializer() &&
1103 !
D->hasCapturedVLAType() &&
1115 Record.AddIdentifierRef(
D->getGetterId());
1116 Record.AddIdentifierRef(
D->getSetterId());
1133 Record.AddAPValue(
D->getValue());
1139 Record.AddAPValue(
D->getValue());
1145 Record.push_back(
D->getChainingSize());
1147 for (
const auto *
P :
D->chain())
1160 VarDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()),
1163 bool ModulesCodegen =
false;
1164 if (Writer.WritingModule &&
D->getStorageDuration() ==
SD_Static &&
1165 !
D->getDescribedVarTemplate()) {
1172 Writer.
getLangOpts().BuildingPCHWithObjectFile)) &&
1173 Record.getASTContext().GetGVALinkageForVariable(
D) >=
1176 VarDeclBits.
addBit(ModulesCodegen);
1178 VarDeclBits.
addBits(
D->getStorageClass(), 3);
1179 VarDeclBits.
addBits(
D->getTSCSpec(), 2);
1180 VarDeclBits.
addBits(
D->getInitStyle(), 2);
1181 VarDeclBits.
addBit(
D->isARCPseudoStrong());
1183 bool HasDeducedType =
false;
1184 if (!isa<ParmVarDecl>(
D)) {
1185 VarDeclBits.
addBit(
D->isThisDeclarationADemotedDefinition());
1186 VarDeclBits.
addBit(
D->isExceptionVariable());
1187 VarDeclBits.
addBit(
D->isNRVOVariable());
1188 VarDeclBits.
addBit(
D->isCXXForRangeDecl());
1190 VarDeclBits.
addBit(
D->isInline());
1191 VarDeclBits.
addBit(
D->isInlineSpecified());
1192 VarDeclBits.
addBit(
D->isConstexpr());
1193 VarDeclBits.
addBit(
D->isInitCapture());
1194 VarDeclBits.
addBit(
D->isPreviousDeclInSameBlockScope());
1196 VarDeclBits.
addBit(
D->isEscapingByref());
1197 HasDeducedType =
D->getType()->getContainedDeducedType();
1198 VarDeclBits.
addBit(HasDeducedType);
1200 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(
D))
1201 VarDeclBits.
addBits(llvm::to_underlying(IPD->getParameterKind()),
1206 VarDeclBits.
addBit(
D->isObjCForDecl());
1209 Record.push_back(VarDeclBits);
1217 if (
Init.getCopyExpr())
1222 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1225 Record.push_back(VarTemplate);
1226 Record.AddDeclRef(TemplD);
1228 =
D->getMemberSpecializationInfo()) {
1229 Record.push_back(StaticDataMemberSpecialization);
1230 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1231 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1232 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1234 Record.push_back(VarNotTemplate);
1242 D->
getKind() == Decl::Var && !
D->isInline() && !
D->isConstexpr() &&
1243 !
D->isInitCapture() && !
D->isPreviousDeclInSameBlockScope() &&
1244 !
D->isEscapingByref() && !HasDeducedType &&
1245 D->getStorageDuration() !=
SD_Static && !
D->getDescribedVarTemplate() &&
1246 !
D->getMemberSpecializationInfo() && !
D->isObjCForDecl() &&
1247 !isa<ImplicitParamDecl>(
D) && !
D->isEscapingByref())
1264 Record.push_back(
D->getFunctionScopeIndex());
1267 ParmVarDeclBits.
addBit(
D->isObjCMethodParameter());
1268 ParmVarDeclBits.
addBits(
D->getFunctionScopeDepth(), 7);
1270 ParmVarDeclBits.
addBits(
D->getObjCDeclQualifier(), 7);
1271 ParmVarDeclBits.
addBit(
D->isKNRPromoted());
1272 ParmVarDeclBits.
addBit(
D->hasInheritedDefaultArg());
1273 ParmVarDeclBits.
addBit(
D->hasUninstantiatedDefaultArg());
1274 ParmVarDeclBits.
addBit(
D->getExplicitObjectParamThisLoc().isValid());
1275 Record.push_back(ParmVarDeclBits);
1277 if (
D->hasUninstantiatedDefaultArg())
1278 Record.AddStmt(
D->getUninstantiatedDefaultArg());
1279 if (
D->getExplicitObjectParamThisLoc().isValid())
1280 Record.AddSourceLocation(
D->getExplicitObjectParamThisLoc());
1290 D->getInit() ==
nullptr)
1295 assert(!
D->getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1296 assert(!
D->isThisDeclarationADemotedDefinition()
1297 &&
"PARM_VAR_DECL can't be demoted definition.");
1299 assert(!
D->isExceptionVariable() &&
"PARM_VAR_DECL can't be exception var");
1300 assert(
D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1301 assert(!
D->isStaticDataMember() &&
1302 "PARM_VAR_DECL can't be static data member");
1307 Record.push_back(
D->bindings().size());
1310 for (
auto *B :
D->bindings())
1317 Record.AddStmt(
D->getBinding());
1323 Record.AddStmt(
D->getAsmString());
1324 Record.AddSourceLocation(
D->getRParenLoc());
1342 Record.AddDeclRef(
D->getExtendingDecl());
1343 Record.AddStmt(
D->getTemporaryExpr());
1344 Record.push_back(
static_cast<bool>(
D->getValue()));
1346 Record.AddAPValue(*
D->getValue());
1347 Record.push_back(
D->getManglingNumber());
1353 Record.AddTypeSourceInfo(
D->getSignatureAsWritten());
1354 Record.push_back(
D->param_size());
1357 Record.push_back(
D->isVariadic());
1358 Record.push_back(
D->blockMissingReturnType());
1359 Record.push_back(
D->isConversionFromLambda());
1360 Record.push_back(
D->doesNotEscape());
1361 Record.push_back(
D->canAvoidCopyToHeap());
1362 Record.push_back(
D->capturesCXXThis());
1363 Record.push_back(
D->getNumCaptures());
1364 for (
const auto &capture :
D->captures()) {
1365 Record.AddDeclRef(capture.getVariable());
1368 if (capture.isByRef()) flags |= 1;
1369 if (capture.isNested()) flags |= 2;
1370 if (capture.hasCopyExpr()) flags |= 4;
1373 if (capture.hasCopyExpr())
Record.AddStmt(capture.getCopyExpr());
1391 static_assert(DeclContext::NumLinkageSpecDeclBits == 17,
1392 "You need to update the serializer after you change the"
1393 "LinkageSpecDeclBits");
1396 Record.push_back(llvm::to_underlying(
D->getLanguage()));
1397 Record.AddSourceLocation(
D->getExternLoc());
1398 Record.AddSourceLocation(
D->getRBraceLoc());
1404 Record.AddSourceLocation(
D->getRBraceLoc());
1420 NamespaceDeclBits.
addBit(
D->isInline());
1421 NamespaceDeclBits.
addBit(
D->isNested());
1422 Record.push_back(NamespaceDeclBits);
1425 Record.AddSourceLocation(
D->getRBraceLoc());
1428 Record.AddDeclRef(
D->getAnonymousNamespace());
1431 if (Writer.
hasChain() &&
D->isAnonymousNamespace() &&
1438 D->getParent()->getRedeclContext()->getPrimaryContext());
1439 if (
Parent->isFromASTFile() || isa<TranslationUnitDecl>(
Parent)) {
1440 Writer.DeclUpdates[
Parent].push_back(
1449 Record.AddSourceLocation(
D->getNamespaceLoc());
1450 Record.AddSourceLocation(
D->getTargetNameLoc());
1451 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1452 Record.AddDeclRef(
D->getNamespace());
1458 Record.AddSourceLocation(
D->getUsingLoc());
1459 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1460 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1461 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1462 Record.push_back(
D->hasTypename());
1463 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingDecl(
D));
1469 Record.AddSourceLocation(
D->getUsingLoc());
1470 Record.AddSourceLocation(
D->getEnumLoc());
1471 Record.AddTypeSourceInfo(
D->getEnumType());
1472 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1473 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingEnumDecl(
D));
1478 Record.push_back(
D->NumExpansions);
1480 Record.AddDeclRef(
D->getInstantiatedFromUsingDecl());
1481 for (
auto *
E :
D->expansions())
1489 Record.AddDeclRef(
D->getTargetDecl());
1491 Record.AddDeclRef(
D->UsingOrNextShadow);
1493 Record.getASTContext().getInstantiatedFromUsingShadowDecl(
D));
1507 Record.AddDeclRef(
D->NominatedBaseClassShadowDecl);
1508 Record.AddDeclRef(
D->ConstructedBaseClassShadowDecl);
1509 Record.push_back(
D->IsVirtual);
1515 Record.AddSourceLocation(
D->getUsingLoc());
1516 Record.AddSourceLocation(
D->getNamespaceKeyLocation());
1517 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1518 Record.AddDeclRef(
D->getNominatedNamespace());
1519 Record.AddDeclRef(dyn_cast<Decl>(
D->getCommonAncestor()));
1525 Record.AddSourceLocation(
D->getUsingLoc());
1526 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1527 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1528 Record.AddSourceLocation(
D->getEllipsisLoc());
1535 Record.AddSourceLocation(
D->getTypenameLoc());
1536 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1537 Record.AddSourceLocation(
D->getEllipsisLoc());
1551 CXXRecNotTemplate = 0,
1553 CXXRecMemberSpecialization,
1557 Record.push_back(CXXRecTemplate);
1558 Record.AddDeclRef(TemplD);
1560 =
D->getMemberSpecializationInfo()) {
1561 Record.push_back(CXXRecMemberSpecialization);
1562 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1563 Record.push_back(MSInfo->getTemplateSpecializationKind());
1564 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1565 }
else if (
D->isLambda()) {
1567 Record.push_back(CXXLambda);
1568 if (
auto *Context =
D->getLambdaContextDecl()) {
1569 Record.AddDeclRef(Context);
1570 Record.push_back(
D->getLambdaIndexInContext());
1575 if (
auto FD = llvm::dyn_cast_or_null<FunctionDecl>(
D->
getDeclContext());
1576 FD && FD->isCanonicalDecl()) {
1577 Writer.RelatedDeclsMap[Writer.
GetDeclRef(FD)].push_back(
1581 Record.push_back(CXXRecNotTemplate);
1584 Record.push_back(
D->isThisDeclarationADefinition());
1585 if (
D->isThisDeclarationADefinition())
1586 Record.AddCXXDefinitionData(
D);
1596 if (
D->isCompleteDefinition())
1597 Record.AddDeclRef(
Record.getASTContext().getCurrentKeyFunction(
D));
1605 Record.push_back(
D->size_overridden_methods());
1617 !
D->hasExtInfo() && !
D->isExplicitlyDefaulted()) {
1623 else if (
D->getTemplatedKind() ==
1626 D->getTemplateSpecializationInfo();
1635 }
else if (
D->getTemplatedKind() ==
1638 D->getDependentSpecializationInfo();
1648 static_assert(DeclContext::NumCXXConstructorDeclBits == 64,
1649 "You need to update the serializer after you change the "
1650 "CXXConstructorDeclBits");
1652 Record.push_back(
D->getTrailingAllocKind());
1654 if (
auto Inherited =
D->getInheritedConstructor()) {
1655 Record.AddDeclRef(Inherited.getShadowDecl());
1656 Record.AddDeclRef(Inherited.getConstructor());
1666 Record.AddDeclRef(
D->getOperatorDelete());
1667 if (
D->getOperatorDelete())
1668 Record.AddStmt(
D->getOperatorDeleteThisArg());
1681 Record.push_back(Writer.getSubmoduleID(
D->getImportedModule()));
1683 Record.push_back(!IdentifierLocs.empty());
1684 if (IdentifierLocs.empty()) {
1688 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1689 Record.AddSourceLocation(IdentifierLocs[I]);
1690 Record.push_back(IdentifierLocs.size());
1699 Record.AddSourceLocation(
D->getColonLoc());
1706 Record.push_back(
D->NumTPLists);
1708 bool hasFriendDecl = isa<NamedDecl *>(
D->Friend);
1709 Record.push_back(hasFriendDecl);
1711 Record.AddDeclRef(
D->getFriendDecl());
1713 Record.AddTypeSourceInfo(
D->getFriendType());
1714 for (
unsigned i = 0; i <
D->NumTPLists; ++i)
1715 Record.AddTemplateParameterList(
D->getFriendTypeTemplateParameterList(i));
1716 Record.AddDeclRef(
D->getNextFriend());
1717 Record.push_back(
D->UnsupportedFriend);
1718 Record.AddSourceLocation(
D->FriendLoc);
1719 Record.AddSourceLocation(
D->EllipsisLoc);
1725 Record.push_back(
D->getNumTemplateParameters());
1726 for (
unsigned i = 0, e =
D->getNumTemplateParameters(); i != e; ++i)
1727 Record.AddTemplateParameterList(
D->getTemplateParameterList(i));
1728 Record.push_back(
D->getFriendDecl() !=
nullptr);
1729 if (
D->getFriendDecl())
1730 Record.AddDeclRef(
D->getFriendDecl());
1732 Record.AddTypeSourceInfo(
D->getFriendType());
1733 Record.AddSourceLocation(
D->getFriendLoc());
1740 Record.AddTemplateParameterList(
D->getTemplateParameters());
1741 Record.AddDeclRef(
D->getTemplatedDecl());
1746 Record.AddStmt(
D->getConstraintExpr());
1752 Record.push_back(
D->getTemplateArguments().size());
1755 Record.AddTemplateArgument(Arg);
1770 Record.AddDeclRef(
D->getInstantiatedFromMemberTemplate());
1771 if (
D->getInstantiatedFromMemberTemplate())
1772 Record.push_back(
D->isMemberSpecialization());
1789 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
D);
1805 =
D->getSpecializedTemplateOrPartial();
1807 Record.AddDeclRef(InstFromD);
1809 Record.AddDeclRef(cast<ClassTemplatePartialSpecializationDecl *>(InstFrom));
1810 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1813 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1814 Record.AddSourceLocation(
D->getPointOfInstantiation());
1815 Record.push_back(
D->getSpecializationKind());
1823 bool ExplicitInstantiation =
1824 D->getTemplateSpecializationKind() ==
1827 Record.push_back(ExplicitInstantiation);
1828 if (ExplicitInstantiation) {
1829 Record.AddSourceLocation(
D->getExternKeywordLoc());
1830 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1834 D->getTemplateArgsAsWritten();
1835 Record.push_back(!!ArgsWritten);
1837 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1846 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
1847 D->getSpecializedTemplate());
1857 Record.AddTemplateParameterList(
D->getTemplateParameters());
1863 Record.AddDeclRef(
D->getInstantiatedFromMember());
1864 Record.push_back(
D->isMemberSpecialization());
1882 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1883 InstFrom =
D->getSpecializedTemplateOrPartial();
1885 Record.AddDeclRef(InstFromD);
1887 Record.AddDeclRef(cast<VarTemplatePartialSpecializationDecl *>(InstFrom));
1888 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1891 bool ExplicitInstantiation =
1892 D->getTemplateSpecializationKind() ==
1895 Record.push_back(ExplicitInstantiation);
1896 if (ExplicitInstantiation) {
1897 Record.AddSourceLocation(
D->getExternKeywordLoc());
1898 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1902 D->getTemplateArgsAsWritten();
1903 Record.push_back(!!ArgsWritten);
1905 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1907 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1908 Record.AddSourceLocation(
D->getPointOfInstantiation());
1909 Record.push_back(
D->getSpecializationKind());
1910 Record.push_back(
D->IsCompleteDefinition);
1926 Record.AddTemplateParameterList(
D->getTemplateParameters());
1932 Record.AddDeclRef(
D->getInstantiatedFromMember());
1933 Record.push_back(
D->isMemberSpecialization());
1948 Record.push_back(
D->hasTypeConstraint());
1951 Record.push_back(
D->wasDeclaredWithTypename());
1954 assert((
bool)TC ==
D->hasTypeConstraint());
1957 Record.push_back(CR !=
nullptr);
1959 Record.AddConceptReference(CR);
1961 Record.push_back(
D->isExpandedParameterPack());
1962 if (
D->isExpandedParameterPack())
1963 Record.push_back(
D->getNumExpansionParameters());
1966 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
1967 !
D->defaultArgumentWasInherited();
1968 Record.push_back(OwnsDefaultArg);
1970 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
1972 if (!TC && !OwnsDefaultArg &&
1988 if (
D->isExpandedParameterPack())
1989 Record.push_back(
D->getNumExpansionTypes());
1993 Record.push_back(
D->getDepth());
1994 Record.push_back(
D->getPosition());
1998 if (
D->isExpandedParameterPack()) {
1999 for (
unsigned I = 0, N =
D->getNumExpansionTypes(); I != N; ++I) {
2000 Record.AddTypeRef(
D->getExpansionType(I));
2001 Record.AddTypeSourceInfo(
D->getExpansionTypeSourceInfo(I));
2008 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2009 !
D->defaultArgumentWasInherited();
2010 Record.push_back(OwnsDefaultArg);
2012 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2021 if (
D->isExpandedParameterPack())
2022 Record.push_back(
D->getNumExpansionTemplateParameters());
2025 Record.push_back(
D->wasDeclaredWithTypename());
2027 Record.push_back(
D->getDepth());
2028 Record.push_back(
D->getPosition());
2030 if (
D->isExpandedParameterPack()) {
2031 for (
unsigned I = 0, N =
D->getNumExpansionTemplateParameters();
2033 Record.AddTemplateParameterList(
D->getExpansionTemplateParameters(I));
2038 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2039 !
D->defaultArgumentWasInherited();
2040 Record.push_back(OwnsDefaultArg);
2042 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2054 Record.AddStmt(
D->getAssertExpr());
2055 Record.push_back(
D->isFailed());
2056 Record.AddStmt(
D->getMessage());
2057 Record.AddSourceLocation(
D->getRParenLoc());
2063 static_assert(DeclContext::NumDeclContextBits == 13,
2064 "You need to update the serializer after you change the "
2067 uint64_t LexicalOffset = 0;
2068 uint64_t VisibleOffset = 0;
2071 cast<NamespaceDecl>(DC)->isFromExplicitGlobalModule()) {
2075 Writer.DelayedNamespace.push_back(cast<NamespaceDecl>(DC));
2078 Writer.WriteDeclContextLexicalBlock(
Record.getASTContext(), DC);
2080 Writer.WriteDeclContextVisibleBlock(
Record.getASTContext(), DC);
2083 Record.AddOffset(LexicalOffset);
2084 Record.AddOffset(VisibleOffset);
2088 assert(
IsLocalDecl(
D) &&
"expected a local declaration");
2094 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2101 return CacheEntry =
D;
2104template <
typename T>
2107 T *MostRecent =
First->getMostRecentDecl();
2108 T *DAsT =
static_cast<T *
>(
D);
2109 if (MostRecent !=
First) {
2111 "Not considered redeclarable?");
2118 if (DAsT == FirstLocal) {
2122 unsigned I =
Record.size();
2135 if (!Prev->isFromASTFile())
2140 if (LocalRedecls.empty())
2146 Record.AddDeclRef(FirstLocal);
2166 Record.push_back(
D->isCBuffer());
2167 Record.AddSourceLocation(
D->getLocStart());
2168 Record.AddSourceLocation(
D->getLBraceLoc());
2169 Record.AddSourceLocation(
D->getRBraceLoc());
2175 Record.writeOMPChildren(
D->Data);
2181 Record.writeOMPChildren(
D->Data);
2187 Record.writeOMPChildren(
D->Data);
2193 static_assert(DeclContext::NumOMPDeclareReductionDeclBits == 15,
2194 "You need to update the serializer after you change the "
2195 "NumOMPDeclareReductionDeclBits");
2199 Record.AddStmt(
D->getCombinerIn());
2200 Record.AddStmt(
D->getCombinerOut());
2201 Record.AddStmt(
D->getCombiner());
2202 Record.AddStmt(
D->getInitOrig());
2203 Record.AddStmt(
D->getInitPriv());
2204 Record.AddStmt(
D->getInitializer());
2205 Record.push_back(llvm::to_underlying(
D->getInitializerKind()));
2206 Record.AddDeclRef(
D->getPrevDeclInScope());
2211 Record.writeOMPChildren(
D->Data);
2213 Record.AddDeclarationName(
D->getVarName());
2214 Record.AddDeclRef(
D->getPrevDeclInScope());
2228template <FunctionDecl::TemplatedKind Kind>
2229std::shared_ptr<llvm::BitCodeAbbrev>
2231 using namespace llvm;
2233 auto Abv = std::make_shared<BitCodeAbbrev>();
2234 Abv->Add(BitCodeAbbrevOp(Code));
2236 Abv->Add(BitCodeAbbrevOp(0));
2237 Abv->Add(BitCodeAbbrevOp(Kind));
2242 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2245 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2247 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2248 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2250 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2251 }
else if constexpr (
Kind ==
2253 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2254 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2256 Abv->Add(BitCodeAbbrevOp(1));
2259 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2260 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2261 Abv->Add(BitCodeAbbrevOp(0));
2262 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2263 Abv->Add(BitCodeAbbrevOp(0));
2265 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2269 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2270 Abv->Add(BitCodeAbbrevOp(0));
2272 llvm_unreachable(
"Unknown templated kind?");
2275 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2284 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2285 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2288 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2289 Abv->Add(BitCodeAbbrevOp(0));
2291 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2293 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2294 Abv->Add(BitCodeAbbrevOp(0));
2295 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2297 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2298 Abv->Add(BitCodeAbbrevOp(
2299 BitCodeAbbrevOp::Fixed,
2307 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2308 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2317 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2318 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2322template <FunctionDecl::TemplatedKind Kind>
2323std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() {
2328void ASTWriter::WriteDeclAbbrevs() {
2329 using namespace llvm;
2331 std::shared_ptr<BitCodeAbbrev> Abv;
2334 Abv = std::make_shared<BitCodeAbbrev>();
2337 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2345 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2346 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2348 Abv->Add(BitCodeAbbrevOp(0));
2349 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2350 Abv->Add(BitCodeAbbrevOp(0));
2352 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2354 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2355 Abv->Add(BitCodeAbbrevOp(0));
2356 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2358 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2359 Abv->Add(BitCodeAbbrevOp(0));
2361 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2362 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2363 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2366 Abv = std::make_shared<BitCodeAbbrev>();
2369 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2374 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2375 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2377 Abv->Add(BitCodeAbbrevOp(0));
2378 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2379 Abv->Add(BitCodeAbbrevOp(0));
2381 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2383 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2384 Abv->Add(BitCodeAbbrevOp(0));
2385 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2387 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2388 Abv->Add(BitCodeAbbrevOp(0));
2390 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2391 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2393 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2394 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2395 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2398 Abv = std::make_shared<BitCodeAbbrev>();
2401 Abv->Add(BitCodeAbbrevOp(0));
2403 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2411 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2412 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2414 Abv->Add(BitCodeAbbrevOp(0));
2415 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2416 Abv->Add(BitCodeAbbrevOp(0));
2418 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2419 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2421 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2422 Abv->Add(BitCodeAbbrevOp(
2423 BitCodeAbbrevOp::Fixed,
2427 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2428 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2430 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2431 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2432 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2433 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2434 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2435 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2437 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2438 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2439 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2442 Abv = std::make_shared<BitCodeAbbrev>();
2445 Abv->Add(BitCodeAbbrevOp(0));
2447 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2455 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2456 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2458 Abv->Add(BitCodeAbbrevOp(0));
2459 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2460 Abv->Add(BitCodeAbbrevOp(0));
2462 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2463 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2465 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2466 Abv->Add(BitCodeAbbrevOp(
2467 BitCodeAbbrevOp::Fixed,
2471 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2472 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2474 Abv->Add(BitCodeAbbrevOp(
2475 BitCodeAbbrevOp::Fixed,
2485 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2488 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2489 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2490 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2493 Abv = std::make_shared<BitCodeAbbrev>();
2496 Abv->Add(BitCodeAbbrevOp(0));
2498 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2504 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2505 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2507 Abv->Add(BitCodeAbbrevOp(0));
2508 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2509 Abv->Add(BitCodeAbbrevOp(0));
2511 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2513 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2514 Abv->Add(BitCodeAbbrevOp(0));
2515 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2518 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2521 Abv->Add(BitCodeAbbrevOp(0));
2523 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2524 Abv->Add(BitCodeAbbrevOp(
2525 BitCodeAbbrevOp::Fixed,
2530 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2531 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2532 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2535 Abv = std::make_shared<BitCodeAbbrev>();
2538 Abv->Add(BitCodeAbbrevOp(0));
2540 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2546 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2547 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2549 Abv->Add(BitCodeAbbrevOp(0));
2550 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2551 Abv->Add(BitCodeAbbrevOp(0));
2553 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2554 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2556 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2557 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2558 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2561 Abv = std::make_shared<BitCodeAbbrev>();
2564 Abv->Add(BitCodeAbbrevOp(0));
2566 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2571 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2572 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2574 Abv->Add(BitCodeAbbrevOp(0));
2575 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2576 Abv->Add(BitCodeAbbrevOp(0));
2578 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2580 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2581 Abv->Add(BitCodeAbbrevOp(0));
2582 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2584 Abv->Add(BitCodeAbbrevOp(
2585 BitCodeAbbrevOp::Fixed,
2593 Abv->Add(BitCodeAbbrevOp(0));
2595 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2596 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2597 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2600 DeclCXXMethodAbbrev =
2601 Stream.EmitAbbrev(getCXXMethodAbbrev<FunctionDecl::TK_NonTemplate>());
2602 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2603 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplate>());
2604 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2605 getCXXMethodAbbrev<FunctionDecl::TK_DependentNonTemplate>());
2606 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2607 getCXXMethodAbbrev<FunctionDecl::TK_MemberSpecialization>());
2608 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2609 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplateSpecialization>());
2610 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2615 Abv = std::make_shared<BitCodeAbbrev>();
2617 Abv->Add(BitCodeAbbrevOp(0));
2619 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2625 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2626 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2628 Abv->Add(BitCodeAbbrevOp(0));
2629 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2630 Abv->Add(BitCodeAbbrevOp(0));
2632 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2633 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2636 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2637 Abv->Add(BitCodeAbbrevOp(0));
2638 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2641 Abv = std::make_shared<BitCodeAbbrev>();
2644 Abv->Add(BitCodeAbbrevOp(0));
2646 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2651 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2652 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2654 Abv->Add(BitCodeAbbrevOp(0));
2655 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2656 Abv->Add(BitCodeAbbrevOp(0));
2658 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2659 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2661 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2663 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2666 Abv = std::make_shared<BitCodeAbbrev>();
2671 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2672 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2677 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2678 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2679 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2680 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2683 Abv = std::make_shared<BitCodeAbbrev>();
2688 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2689 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2691 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2692 Abv->Add(BitCodeAbbrevOp(32));
2693 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2694 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2697 Abv = std::make_shared<BitCodeAbbrev>();
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2703 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2705 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2706 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2707 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2708 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2711 Abv = std::make_shared<BitCodeAbbrev>();
2716 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2717 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2719 Abv->Add(BitCodeAbbrevOp(0));
2721 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2723 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2726 Abv = std::make_shared<BitCodeAbbrev>();
2732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2733 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2736 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2737 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2738 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2741 Abv = std::make_shared<BitCodeAbbrev>();
2747 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2748 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2752 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2753 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2755 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2756 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2757 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2760 Abv = std::make_shared<BitCodeAbbrev>();
2765 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2766 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2768 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2769 Abv->Add(BitCodeAbbrevOp(0));
2770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2771 CallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2774 Abv = std::make_shared<BitCodeAbbrev>();
2779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2780 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2783 Abv->Add(BitCodeAbbrevOp(0));
2784 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2786 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2789 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2792 Abv = std::make_shared<BitCodeAbbrev>();
2797 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2798 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2800 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2801 Abv->Add(BitCodeAbbrevOp(0));
2802 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2804 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2807 Abv = std::make_shared<BitCodeAbbrev>();
2811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2812 Abv->Add(BitCodeAbbrevOp(0));
2813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2814 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2815 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
2817 Abv = std::make_shared<BitCodeAbbrev>();
2819 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2820 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2822 Abv = std::make_shared<BitCodeAbbrev>();
2824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2825 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2827 Abv = std::make_shared<BitCodeAbbrev>();
2829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2830 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2832 Abv = std::make_shared<BitCodeAbbrev>();
2834 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2835 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2860 if (isa<PragmaCommentDecl, PragmaDetectMismatchDecl>(
D))
2870 if (isa<FileScopeAsmDecl, TopLevelStmtDecl, ObjCImplDecl>(
D))
2888 assert(!
D->
isFromASTFile() &&
"should not be emitting imported decl");
2895 assert(ID >= FirstDeclID &&
"invalid decl ID");
2911 unsigned Index =
ID.getRawValue() - FirstDeclID.
getRawValue();
2912 if (DeclOffsets.size() == Index)
2913 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
2914 else if (DeclOffsets.size() < Index) {
2916 DeclOffsets.resize(Index+1);
2917 DeclOffsets[Index].setRawLoc(RawLoc);
2918 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
2920 llvm_unreachable(
"declarations should be emitted in ID order");
2925 associateDeclWithFile(
D, ID);
2938 bool ModulesCodegen =
false;
2940 std::optional<GVALinkage>
Linkage;
2941 if (Writer->WritingModule &&
2947 Linkage = getASTContext().GetGVALinkageForFunction(FD);
2951 (FD->
hasAttr<DLLExportAttr>() &&
2952 Writer->
getLangOpts().BuildingPCHWithObjectFile)) {
2956 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2958 Linkage = getASTContext().GetGVALinkageForFunction(FD);
2964 Record->push_back(ModulesCodegen);
2966 Writer->
AddDeclRef(FD, Writer->ModularCodegenDecls);
2967 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2968 Record->push_back(CD->getNumCtorInitializers());
2969 if (CD->getNumCtorInitializers())
static void addExplicitSpecifier(ExplicitSpecifier ES, ASTRecordWriter &Record)
static bool isRequiredDecl(const Decl *D, ASTContext &Context, Module *WritingModule)
isRequiredDecl - Check if this is a "required" Decl, which must be seen by consumers of the AST.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
llvm::MachO::Record Record
This file defines OpenMP AST classes for clauses.
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
MutableArrayRef< FunctionTemplateSpecializationInfo > getPartialSpecializations(FunctionTemplateDecl::Common *)
void VisitBindingDecl(BindingDecl *D)
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
void VisitEmptyDecl(EmptyDecl *D)
void VisitCXXMethodDecl(CXXMethodDecl *D)
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
void VisitOMPRequiresDecl(OMPRequiresDecl *D)
void VisitNamedDecl(NamedDecl *D)
void CollectFirstDeclFromEachModule(const Decl *D, bool IncludeLocal, llvm::MapVector< ModuleFile *, const Decl * > &Firsts)
Collect the first declaration from each module file that provides a declaration of D.
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D)
void VisitNamespaceDecl(NamespaceDecl *D)
void VisitOMPAllocateDecl(OMPAllocateDecl *D)
void VisitExportDecl(ExportDecl *D)
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
void VisitParmVarDecl(ParmVarDecl *D)
void VisitRedeclarable(Redeclarable< T > *D)
void VisitFriendDecl(FriendDecl *D)
void VisitDeclaratorDecl(DeclaratorDecl *D)
void VisitTemplateParamObjectDecl(TemplateParamObjectDecl *D)
void VisitConceptDecl(ConceptDecl *D)
void AddFirstSpecializationDeclFromEachModule(const Decl *D, llvm::SmallVectorImpl< const Decl * > &SpecsInMap, llvm::SmallVectorImpl< const Decl * > &PartialSpecsInMap)
Add to the record the first template specialization from each module file that provides a declaration...
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
void VisitBlockDecl(BlockDecl *D)
void VisitLabelDecl(LabelDecl *LD)
void VisitTemplateDecl(TemplateDecl *D)
void VisitImplicitConceptSpecializationDecl(ImplicitConceptSpecializationDecl *D)
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
void VisitFieldDecl(FieldDecl *D)
void VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D)
void VisitObjCContainerDecl(ObjCContainerDecl *D)
void RegisterTemplateSpecialization(const Decl *Template, const Decl *Specialization)
Ensure that this template specialization is associated with the specified template on reload.
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
void VisitUnnamedGlobalConstantDecl(UnnamedGlobalConstantDecl *D)
void VisitCXXConversionDecl(CXXConversionDecl *D)
void VisitUsingShadowDecl(UsingShadowDecl *D)
void VisitValueDecl(ValueDecl *D)
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
void VisitImplicitParamDecl(ImplicitParamDecl *D)
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
void VisitTopLevelStmtDecl(TopLevelStmtDecl *D)
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
void VisitAccessSpecDecl(AccessSpecDecl *D)
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record, bool GeneratingReducedBMI)
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
void VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D)
void VisitMSPropertyDecl(MSPropertyDecl *D)
void VisitUsingEnumDecl(UsingEnumDecl *D)
void VisitTypeDecl(TypeDecl *D)
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
void VisitEnumConstantDecl(EnumConstantDecl *D)
void VisitObjCIvarDecl(ObjCIvarDecl *D)
void VisitCapturedDecl(CapturedDecl *D)
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
void VisitRecordDecl(RecordDecl *D)
void VisitUnresolvedUsingIfExistsDecl(UnresolvedUsingIfExistsDecl *D)
void VisitTypedefDecl(TypedefDecl *D)
void VisitMSGuidDecl(MSGuidDecl *D)
void VisitTypedefNameDecl(TypedefNameDecl *D)
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
void VisitUsingDecl(UsingDecl *D)
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
void AddTemplateSpecializations(DeclTy *D)
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
void VisitObjCMethodDecl(ObjCMethodDecl *D)
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
void VisitVarTemplateDecl(VarTemplateDecl *D)
void VisitHLSLBufferDecl(HLSLBufferDecl *D)
void VisitObjCImplDecl(ObjCImplDecl *D)
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
void VisitVarDecl(VarDecl *D)
void VisitImportDecl(ImportDecl *D)
void VisitCXXRecordDecl(CXXRecordDecl *D)
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
void VisitClassTemplateDecl(ClassTemplateDecl *D)
void VisitFunctionDecl(FunctionDecl *D)
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
void VisitEnumDecl(EnumDecl *D)
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
void VisitStaticAssertDecl(StaticAssertDecl *D)
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D.
void VisitUsingPackDecl(UsingPackDecl *D)
void VisitDecompositionDecl(DecompositionDecl *D)
void VisitTagDecl(TagDecl *D)
void VisitTypeAliasDecl(TypeAliasDecl *D)
void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
ModuleFile * getOwningModuleFile(const Decl *D) const
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
bool haveUnloadedSpecializations(const Decl *D) const
If we have any unloaded specialization for D.
An object for streaming information to a record.
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
void AddCXXCtorInitializers(ArrayRef< CXXCtorInitializer * > CtorInits)
Emit a CXXCtorInitializer array.
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
Writes an AST file containing the contents of a translation unit.
unsigned getDeclParmVarAbbrev() const
unsigned getDeclTemplateTypeParmAbbrev() const
bool isWritingStdCXXNamedModules() const
unsigned getDeclObjCIvarAbbrev() const
unsigned getDeclTypedefAbbrev() const
unsigned getDeclUsingShadowAbbrev() const
bool isGeneratingReducedBMI() const
unsigned getDeclVarAbbrev() const
unsigned getDeclEnumAbbrev() const
bool IsLocalDecl(const Decl *D)
Is this a local declaration (that is, one that will be written to our AST file)? This is the case for...
void ClearSwitchCaseIDs()
LocalDeclID GetDeclRef(const Decl *D)
Force a declaration to be emitted and get its local ID to the module file been writing.
unsigned getDeclCXXMethodAbbrev(FunctionDecl::TemplatedKind Kind) const
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc, LocSeq *Seq=nullptr)
Return the raw encodings for source locations.
SmallVector< uint64_t, 64 > RecordData
unsigned getAnonymousDeclarationNumber(const NamedDecl *D)
unsigned getDeclFieldAbbrev() const
const LangOptions & getLangOpts() const
unsigned getDeclRecordAbbrev() const
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
Represents an access specifier followed by colon ':'.
A binding in a decomposition declaration.
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
void addBits(uint32_t Value, uint32_t BitsWidth)
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a C++ constructor within a class.
Represents a C++ conversion function within a class.
Represents a C++ deduction guide declaration.
Represents a C++ destructor within a class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
static bool classofKind(Kind K)
Represents the body of a CapturedStmt, and serves as its DeclContext.
unsigned getNumParams() const
unsigned getContextParamPosition() const
ImplicitParamDecl * getParam(unsigned i) const
Declaration of a class template.
Represents a class template specialization, which refers to a class template with a given set of temp...
Declaration of a C++20 concept.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
A POD class for pairing a NamedDecl* with an access specifier.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
DeclID getRawValue() const
A simple visitor class that helps create declaration visitors.
Decl - This represents one declaration (or definition), e.g.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
SourceLocation getEndLoc() const LLVM_READONLY
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isInNamedModule() const
Whether this declaration comes from a named module.
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
bool isParameterPack() const
Whether this declaration is a parameter pack.
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
bool isReferenced() const
Whether any declaration of this entity was referenced.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isInvalidDecl() const
unsigned getIdentifierNamespace() const
SourceLocation getLocation() const
const char * getDeclKindName() const
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc....
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
SourceLocation getBeginLoc() const LLVM_READONLY
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Represents a ValueDecl that came out of a declarator.
A decomposition declaration.
Provides information about a dependent function-template specialization declaration.
ArrayRef< FunctionTemplateDecl * > getCandidates() const
Returns the candidates for the primary function template.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Represents an empty-declaration.
An instance of this object exists for each enum constant that is defined.
Store information needed for an explicit specifier.
ExplicitSpecKind getKind() const
const Expr * getExpr() const
Represents a standard C++ module export declaration.
This represents one expression.
Represents a member of a struct/union/class.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Declaration of a friend template.
Represents a function declaration or definition.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
Declaration of a template function.
FunctionTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
MemberSpecializationInfo * getMemberSpecializationInfo() const
Get the specialization info if this function template specialization is also a member specialization:
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Represents a field injected from an anonymous union/struct into the parent scope.
Represents the declaration of a label.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Represents a linkage specification.
An instance of this class represents the declaration of a property member.
Provides information a specialization of a member of a class template, which may be a member function...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
Describes a module or submodule.
bool isInterfaceOrPartition() const
bool isNamedModule() const
Does this Module is a named module of a standard named module?
This represents a decl that may have a name.
Represents a C++ namespace alias.
Represent a C++ namespace.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
This represents '#pragma omp allocate ...' directive.
Pseudo declaration for capturing expressions.
This represents '#pragma omp declare mapper ...' directive.
This represents '#pragma omp declare reduction ...' directive.
This represents '#pragma omp requires...' directive.
This represents '#pragma omp threadprivate ...' directive.
Represents a field declaration created by an @defs(...).
static bool classofKind(Kind K)
ObjCCategoryDecl - Represents a category declaration.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCCompatibleAliasDecl - Represents alias of a class.
ObjCContainerDecl - Represents a container for method declarations.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Represents an ObjC class declaration.
ObjCIvarDecl - Represents an ObjC instance variable.
static bool classofKind(Kind K)
ObjCMethodDecl - Represents an instance or class method declaration.
Represents one property declaration in an Objective-C interface.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Represents an Objective-C protocol declaration.
Represents the declaration of an Objective-C type parameter.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
unsigned size() const
Determine the number of type parameters in this list.
SourceLocation getRAngleLoc() const
SourceLocation getLAngleLoc() const
Represents a parameter to a function.
Represents a #pragma detect_mismatch line.
PrettyDeclStackTraceEntry - If a crash occurs in the parser while parsing something related to a decl...
A (possibly-)qualified type.
Represents a struct/union/class.
Declaration of a redeclarable template.
Provides common interface for the Decls that can be redeclared.
Represents the body of a requires-expression.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
Represents a C++11 static_assert declaration.
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
unsigned size() const
Retrieve the number of template arguments in this template argument list.
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
Represents a template argument.
@ Type
The template argument is a type.
ArgKind getKind() const
Return the kind of stored template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
A template parameter object.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
A declaration that models statements at global scope.
The top declaration context.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Declaration of an alias template.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
ConceptReference * getConceptReference() const
Represents a declaration of a type.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
This node is generated when a using-declaration that was annotated with attribute((using_if_exists)) ...
Represents a dependent using declaration which was marked with typename.
Represents a dependent using declaration which was not marked with typename.
Represents a C++ using-declaration.
Represents C++ using-directive.
Represents a C++ using-enum-declaration.
Represents a pack of using declarations that a single using-declarator pack-expanded into.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
@ CInit
C-style initialization with assignment.
Declaration of a variable template.
Represents a variable template specialization, which refers to a variable template with a given set o...
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
DeclCode
Record codes for each kind of declaration.
@ DECL_EMPTY
An EmptyDecl record.
@ DECL_CAPTURED
A CapturedDecl record.
@ DECL_CXX_RECORD
A CXXRecordDecl record.
@ DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION
A VarTemplatePartialSpecializationDecl record.
@ DECL_OMP_ALLOCATE
An OMPAllocateDcl record.
@ DECL_MS_PROPERTY
A MSPropertyDecl record.
@ DECL_OMP_DECLARE_MAPPER
An OMPDeclareMapperDecl record.
@ DECL_TOP_LEVEL_STMT_DECL
A TopLevelStmtDecl record.
@ DECL_REQUIRES_EXPR_BODY
A RequiresExprBodyDecl record.
@ DECL_STATIC_ASSERT
A StaticAssertDecl record.
@ DECL_INDIRECTFIELD
A IndirectFieldDecl record.
@ DECL_TEMPLATE_TEMPLATE_PARM
A TemplateTemplateParmDecl record.
@ DECL_IMPORT
An ImportDecl recording a module import.
@ DECL_UNNAMED_GLOBAL_CONSTANT
A UnnamedGlobalConstantDecl record.
@ DECL_ACCESS_SPEC
An AccessSpecDecl record.
@ DECL_OBJC_TYPE_PARAM
An ObjCTypeParamDecl record.
@ DECL_OBJC_CATEGORY_IMPL
A ObjCCategoryImplDecl record.
@ DECL_ENUM_CONSTANT
An EnumConstantDecl record.
@ DECL_PARM_VAR
A ParmVarDecl record.
@ DECL_TYPEDEF
A TypedefDecl record.
@ DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack.
@ DECL_HLSL_BUFFER
A HLSLBufferDecl record.
@ DECL_NAMESPACE_ALIAS
A NamespaceAliasDecl record.
@ DECL_TYPEALIAS
A TypeAliasDecl record.
@ DECL_FUNCTION_TEMPLATE
A FunctionTemplateDecl record.
@ DECL_MS_GUID
A MSGuidDecl record.
@ DECL_UNRESOLVED_USING_TYPENAME
An UnresolvedUsingTypenameDecl record.
@ DECL_CLASS_TEMPLATE_SPECIALIZATION
A ClassTemplateSpecializationDecl record.
@ DECL_FILE_SCOPE_ASM
A FileScopeAsmDecl record.
@ DECL_PARTIAL_SPECIALIZATIONS
@ DECL_CXX_CONSTRUCTOR
A CXXConstructorDecl record.
@ DECL_CXX_CONVERSION
A CXXConversionDecl record.
@ DECL_FIELD
A FieldDecl record.
@ DECL_LINKAGE_SPEC
A LinkageSpecDecl record.
@ DECL_NAMESPACE
A NamespaceDecl record.
@ DECL_NON_TYPE_TEMPLATE_PARM
A NonTypeTemplateParmDecl record.
@ DECL_USING_PACK
A UsingPackDecl record.
@ DECL_FUNCTION
A FunctionDecl record.
@ DECL_USING_DIRECTIVE
A UsingDirecitveDecl record.
@ DECL_RECORD
A RecordDecl record.
@ DECL_CONTEXT_LEXICAL
A record that stores the set of declarations that are lexically stored within a given DeclContext.
@ DECL_BLOCK
A BlockDecl record.
@ DECL_UNRESOLVED_USING_VALUE
An UnresolvedUsingValueDecl record.
@ DECL_TYPE_ALIAS_TEMPLATE
A TypeAliasTemplateDecl record.
@ DECL_OBJC_CATEGORY
A ObjCCategoryDecl record.
@ DECL_VAR
A VarDecl record.
@ DECL_UNRESOLVED_USING_IF_EXISTS
An UnresolvedUsingIfExistsDecl record.
@ DECL_USING
A UsingDecl record.
@ DECL_OBJC_PROTOCOL
A ObjCProtocolDecl record.
@ DECL_TEMPLATE_TYPE_PARM
A TemplateTypeParmDecl record.
@ DECL_VAR_TEMPLATE_SPECIALIZATION
A VarTemplateSpecializationDecl record.
@ DECL_OBJC_IMPLEMENTATION
A ObjCImplementationDecl record.
@ DECL_LABEL
A LabelDecl record.
@ DECL_OBJC_COMPATIBLE_ALIAS
A ObjCCompatibleAliasDecl record.
@ DECL_CONSTRUCTOR_USING_SHADOW
A ConstructorUsingShadowDecl record.
@ DECL_USING_ENUM
A UsingEnumDecl record.
@ DECL_FRIEND_TEMPLATE
A FriendTemplateDecl record.
@ DECL_PRAGMA_DETECT_MISMATCH
A PragmaDetectMismatchDecl record.
@ DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack.
@ DECL_OBJC_AT_DEFS_FIELD
A ObjCAtDefsFieldDecl record.
@ DECL_IMPLICIT_PARAM
An ImplicitParamDecl record.
@ DECL_FRIEND
A FriendDecl record.
@ DECL_CXX_METHOD
A CXXMethodDecl record.
@ DECL_EXPORT
An ExportDecl record.
@ DECL_BINDING
A BindingDecl record.
@ DECL_PRAGMA_COMMENT
A PragmaCommentDecl record.
@ DECL_ENUM
An EnumDecl record.
@ DECL_DECOMPOSITION
A DecompositionDecl record.
@ DECL_OMP_DECLARE_REDUCTION
An OMPDeclareReductionDecl record.
@ DECL_OMP_THREADPRIVATE
An OMPThreadPrivateDecl record.
@ DECL_OBJC_METHOD
A ObjCMethodDecl record.
@ DECL_CXX_DESTRUCTOR
A CXXDestructorDecl record.
@ DECL_OMP_CAPTUREDEXPR
An OMPCapturedExprDecl record.
@ DECL_CLASS_TEMPLATE
A ClassTemplateDecl record.
@ DECL_USING_SHADOW
A UsingShadowDecl record.
@ DECL_CONCEPT
A ConceptDecl record.
@ DECL_CXX_DEDUCTION_GUIDE
A CXXDeductionGuideDecl record.
@ DECL_OMP_REQUIRES
An OMPRequiresDecl record.
@ DECL_OBJC_IVAR
A ObjCIvarDecl record.
@ DECL_OBJC_PROPERTY
A ObjCPropertyDecl record.
@ DECL_TEMPLATE_PARAM_OBJECT
A TemplateParamObjectDecl record.
@ DECL_OBJC_INTERFACE
A ObjCInterfaceDecl record.
@ DECL_VAR_TEMPLATE
A VarTemplateDecl record.
@ DECL_LIFETIME_EXTENDED_TEMPORARY
An LifetimeExtendedTemporaryDecl record.
@ DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION
A ClassTemplatePartialSpecializationDecl record.
@ DECL_IMPLICIT_CONCEPT_SPECIALIZATION
An ImplicitConceptSpecializationDecl record.
@ DECL_CONTEXT_VISIBLE
A record that stores the set of declarations that are visible from a given DeclContext.
@ DECL_OBJC_PROPERTY_IMPL
A ObjCPropertyImplDecl record.
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
@ STMT_COMPOUND
A CompoundStmt record.
@ EXPR_CALL
A CallExpr record.
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
@ EXPR_DECL_REF
A DeclRefExpr record.
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
bool isPartOfPerModuleInitializer(const Decl *D)
Determine whether the given declaration will be included in the per-module initializer if it needs to...
@ UPD_CXX_ADDED_ANONYMOUS_NAMESPACE
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
@ GVA_AvailableExternally
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ SD_Static
Static storage duration.
bool CanElideDeclDef(const Decl *D)
If we can elide the definition of.
const FunctionProtoType * T
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Diagnostic wrappers for TextAPI types for error reporting.
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
Data that is common to all of the declarations of a given function template.
Parts of a decomposed MSGuidDecl.
uint16_t Part2
...-89ab-...
uint32_t Part1
{01234567-...
uint16_t Part3
...-cdef-...
uint8_t Part4And5[8]
...-0123-456789abcdef}
static DeclType * getDecl(EntryType *D)