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);
174 for (
auto *typeParam : *typeParams) {
175 Record.AddDeclRef(typeParam);
184 const Decl *
D,
bool IncludeLocal,
185 llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
189 if (R->isFromASTFile())
191 else if (IncludeLocal)
200 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
203 for (
const auto &F : Firsts)
204 Record.AddDeclRef(F.second);
214 assert((isa<ClassTemplateSpecializationDecl>(
D) ||
215 isa<VarTemplateSpecializationDecl>(
D) || isa<FunctionDecl>(
D)) &&
216 "Must not be called with other decls");
217 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
220 for (
const auto &F : Firsts) {
223 PartialSpecsInMap.push_back(F.second);
225 SpecsInMap.push_back(F.second);
230 template <
typename EntryType>
239 return Common->PartialSpecializations;
246 template<
typename DeclTy>
248 auto *Common =
D->getCommonPtr();
253 if (Writer.Chain !=
Record.getASTContext().getExternalSource() &&
255 D->LoadLazySpecializations();
262 for (
auto &Entry : Common->Specializations)
269 for (
auto *
D : AllSpecs) {
274 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
278 if (isa<FunctionTemplateDecl>(
D)) {
279 assert(PartialSpecs.empty());
283 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
284 D, PartialSpecs,
true));
307 Writer.PartialSpecializationsUpdates[cast<NamedDecl>(Template)]
310 Writer.SpecializationsUpdates[cast<NamedDecl>(Template)].push_back(
317 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
318 if (FD->isInlined() || FD->isConstexpr())
321 if (FD->isDependentContext())
328 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
329 if (!VD->getDeclContext()->getRedeclContext()->isFileContext() ||
330 VD->isInline() || VD->isConstexpr() || isa<ParmVarDecl>(VD) ||
334 VD->hasConstantInitialization())
350 if (
auto *DD = dyn_cast<DeclaratorDecl>(
D)) {
351 if (
auto *TInfo = DD->getTypeSourceInfo())
352 Record.AddTypeLoc(TInfo->getTypeLoc());
358 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
360 Record.push_back(FD->doesThisDeclarationHaveABody());
361 if (FD->doesThisDeclarationHaveABody())
362 Record.AddFunctionDefinition(FD);
371 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
373 Record.AddVarDeclInit(VD);
380 if (
auto *FD = dyn_cast<FieldDecl>(
D)) {
381 if (FD->hasInClassInitializer()) {
382 if (
Expr *
Init = FD->getInClassInitializer()) {
395 if (
auto *DC = dyn_cast<DeclContext>(
D))
420 Record.push_back(DeclBits);
441 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
442 if (!NS->isFromASTFile())
444 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
445 if (!NS->isInlineNamespace())
447 DC = NS->getParent();
453 StringRef Arg =
D->getArg();
454 Record.push_back(Arg.size());
457 Record.push_back(
D->getCommentKind());
464 StringRef Name =
D->getName();
465 StringRef
Value =
D->getValue();
475 llvm_unreachable(
"Translation units aren't directly serialized");
480 Record.AddDeclarationName(
D->getDeclName());
495 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
496 Record.push_back(
D->isModed());
498 Record.AddTypeRef(
D->getUnderlyingType());
499 Record.AddDeclRef(
D->getAnonDeclWithTypedefName(
false));
520 Record.AddDeclRef(
D->getDescribedAliasTemplate());
526 "You need to update the serializer after you change the "
534 TagDeclBits.
addBits(llvm::to_underlying(
D->getTagKind()), 3);
535 TagDeclBits.
addBit(!isa<CXXRecordDecl>(
D) ?
D->isCompleteDefinition() : 0);
536 TagDeclBits.
addBit(
D->isEmbeddedInDeclarator());
537 TagDeclBits.
addBit(
D->isFreeStanding());
538 TagDeclBits.
addBit(
D->isCompleteDefinitionRequired());
540 D->hasExtInfo() ? 1 : (
D->getTypedefNameForAnonDecl() ? 2 : 0),
542 Record.push_back(TagDeclBits);
544 Record.AddSourceRange(
D->getBraceRange());
546 if (
D->hasExtInfo()) {
547 Record.AddQualifierInfo(*
D->getExtInfo());
548 }
else if (
auto *TD =
D->getTypedefNameForAnonDecl()) {
550 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
556 "You need to update the serializer after you change the "
560 Record.AddTypeSourceInfo(
D->getIntegerTypeSourceInfo());
561 if (!
D->getIntegerTypeSourceInfo())
562 Record.AddTypeRef(
D->getIntegerType());
563 Record.AddTypeRef(
D->getPromotionType());
566 EnumDeclBits.
addBits(
D->getNumPositiveBits(), 8);
567 EnumDeclBits.
addBits(
D->getNumNegativeBits(), 8);
568 EnumDeclBits.
addBit(
D->isScoped());
569 EnumDeclBits.
addBit(
D->isScopedUsingClassTag());
570 EnumDeclBits.
addBit(
D->isFixed());
571 Record.push_back(EnumDeclBits);
573 Record.push_back(
D->getODRHash());
576 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
577 Record.push_back(MemberInfo->getTemplateSpecializationKind());
578 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
580 Record.AddDeclRef(
nullptr);
585 !
D->getTypedefNameForAnonDecl() &&
589 !
D->getIntegerTypeSourceInfo() && !
D->getMemberSpecializationInfo() &&
599 "You need to update the serializer after you change the "
605 RecordDeclBits.
addBit(
D->hasFlexibleArrayMember());
606 RecordDeclBits.
addBit(
D->isAnonymousStructOrUnion());
607 RecordDeclBits.
addBit(
D->hasObjectMember());
608 RecordDeclBits.
addBit(
D->hasVolatileMember());
609 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDefaultInitialize());
610 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveCopy());
611 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDestroy());
612 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDefaultInitializeCUnion());
613 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDestructCUnion());
614 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveCopyCUnion());
615 RecordDeclBits.
addBit(
D->hasUninitializedExplicitInitFields());
616 RecordDeclBits.
addBit(
D->isParamDestroyedInCallee());
617 RecordDeclBits.
addBits(llvm::to_underlying(
D->getArgPassingRestrictions()), 2);
618 Record.push_back(RecordDeclBits);
622 if (!isa<CXXRecordDecl>(
D))
623 Record.push_back(
D->getODRHash());
627 !
D->getTypedefNameForAnonDecl() &&
640 Record.AddTypeRef(
D->getType());
645 Record.push_back(
D->getInitExpr()? 1 : 0);
646 if (
D->getInitExpr())
647 Record.AddStmt(
D->getInitExpr());
648 Record.AddAPSInt(
D->getInitVal());
655 Record.AddSourceLocation(
D->getInnerLocStart());
656 Record.push_back(
D->hasExtInfo());
657 if (
D->hasExtInfo()) {
658 DeclaratorDecl::ExtInfo *Info =
D->getExtInfo();
659 Record.AddQualifierInfo(*Info);
660 Record.AddStmt(Info->TrailingRequiresClause);
663 Record.AddTypeRef(
D->getTypeSourceInfo() ?
D->getTypeSourceInfo()->getType()
669 "You need to update the serializer after you change the "
674 Record.push_back(
D->getTemplatedKind());
675 switch (
D->getTemplatedKind()) {
679 Record.AddDeclRef(
D->getInstantiatedFromDecl());
682 Record.AddDeclRef(
D->getDescribedFunctionTemplate());
693 FTSInfo =
D->getTemplateSpecializationInfo();
706 Record.AddASTTemplateArgumentListInfo(
714 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
715 Record.push_back(MemberInfo->getTemplateSpecializationKind());
716 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
730 DFTSInfo =
D->getDependentSpecializationInfo();
740 Record.AddASTTemplateArgumentListInfo(
747 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
755 FunctionDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()), 3);
756 FunctionDeclBits.
addBits((uint32_t)
D->getStorageClass(), 3);
757 FunctionDeclBits.
addBit(
D->isInlineSpecified());
758 FunctionDeclBits.
addBit(
D->isInlined());
759 FunctionDeclBits.
addBit(
D->hasSkippedBody());
760 FunctionDeclBits.
addBit(
D->isVirtualAsWritten());
761 FunctionDeclBits.
addBit(
D->isPureVirtual());
762 FunctionDeclBits.
addBit(
D->hasInheritedPrototype());
763 FunctionDeclBits.
addBit(
D->hasWrittenPrototype());
764 FunctionDeclBits.
addBit(
D->isDeletedBit());
765 FunctionDeclBits.
addBit(
D->isTrivial());
766 FunctionDeclBits.
addBit(
D->isTrivialForCall());
767 FunctionDeclBits.
addBit(
D->isDefaulted());
768 FunctionDeclBits.
addBit(
D->isExplicitlyDefaulted());
769 FunctionDeclBits.
addBit(
D->isIneligibleOrNotSelected());
770 FunctionDeclBits.
addBits((uint64_t)(
D->getConstexprKind()), 2);
771 FunctionDeclBits.
addBit(
D->hasImplicitReturnZero());
772 FunctionDeclBits.
addBit(
D->isMultiVersion());
773 FunctionDeclBits.
addBit(
D->isLateTemplateParsed());
774 FunctionDeclBits.
addBit(
D->FriendConstraintRefersToEnclosingTemplate());
775 FunctionDeclBits.
addBit(
D->usesSEHTry());
776 Record.push_back(FunctionDeclBits);
779 if (
D->isExplicitlyDefaulted())
780 Record.AddSourceLocation(
D->getDefaultLoc());
782 Record.push_back(
D->getODRHash());
784 if (
D->isDefaulted() ||
D->isDeletedAsWritten()) {
785 if (
auto *FDI =
D->getDefalutedOrDeletedInfo()) {
789 Record.push_back(1 | (DeletedMessage ? 2 : 0));
791 Record.AddStmt(DeletedMessage);
793 Record.push_back(FDI->getUnqualifiedLookups().size());
795 Record.AddDeclRef(
P.getDecl());
796 Record.push_back(
P.getAccess());
807 if (
auto *RD = dyn_cast<CXXRecordDecl>(
D->getLexicalParent()))
808 if (RD->isDependentContext() && RD->isThisDeclarationADefinition()) {
809 Writer.RelatedDeclsMap[Writer.
GetDeclRef(RD)].push_back(
814 Record.push_back(
D->param_size());
815 for (
auto *
P :
D->parameters())
822 uint64_t Kind =
static_cast<uint64_t
>(ES.
getKind());
823 Kind = Kind << 1 | static_cast<bool>(ES.
getExpr());
834 Record.push_back(
static_cast<unsigned char>(
D->getDeductionCandidateKind()));
840 "You need to update the serializer after you change the "
841 "ObjCMethodDeclBits");
846 bool HasBodyStuff =
D->
getBody() !=
nullptr;
847 Record.push_back(HasBodyStuff);
851 Record.AddDeclRef(
D->getSelfDecl());
852 Record.AddDeclRef(
D->getCmdDecl());
853 Record.push_back(
D->isInstanceMethod());
854 Record.push_back(
D->isVariadic());
855 Record.push_back(
D->isPropertyAccessor());
856 Record.push_back(
D->isSynthesizedAccessorStub());
857 Record.push_back(
D->isDefined());
858 Record.push_back(
D->isOverriding());
859 Record.push_back(
D->hasSkippedBody());
861 Record.push_back(
D->isRedeclaration());
862 Record.push_back(
D->hasRedeclaration());
863 if (
D->hasRedeclaration()) {
864 assert(
Record.getASTContext().getObjCMethodRedeclaration(
D));
865 Record.AddDeclRef(
Record.getASTContext().getObjCMethodRedeclaration(
D));
869 Record.push_back(llvm::to_underlying(
D->getImplementationControl()));
871 Record.push_back(
D->getObjCDeclQualifier());
872 Record.push_back(
D->hasRelatedResultType());
873 Record.AddTypeRef(
D->getReturnType());
874 Record.AddTypeSourceInfo(
D->getReturnTypeSourceInfo());
876 Record.push_back(
D->param_size());
877 for (
const auto *
P :
D->parameters())
880 Record.push_back(
D->getSelLocsKind());
881 unsigned NumStoredSelLocs =
D->getNumStoredSelLocs();
883 Record.push_back(NumStoredSelLocs);
884 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
885 Record.AddSourceLocation(SelLocs[i]);
894 Record.AddSourceLocation(
D->VarianceLoc);
895 Record.AddSourceLocation(
D->ColonLoc);
902 "You need to update the serializer after you change the "
903 "ObjCContainerDeclBits");
906 Record.AddSourceLocation(
D->getAtStartLoc());
907 Record.AddSourceRange(
D->getAtEndRange());
917 Record.push_back(
D->isThisDeclarationADefinition());
918 if (
D->isThisDeclarationADefinition()) {
920 ObjCInterfaceDecl::DefinitionData &
Data =
D->data();
922 Record.AddTypeSourceInfo(
D->getSuperClassTInfo());
923 Record.AddSourceLocation(
D->getEndOfDefinitionLoc());
924 Record.push_back(
Data.HasDesignatedInitializers);
925 Record.push_back(
D->getODRHash());
928 Record.push_back(
Data.ReferencedProtocols.size());
929 for (
const auto *
P :
D->protocols())
931 for (
const auto &PL :
D->protocol_locs())
932 Record.AddSourceLocation(PL);
935 Record.push_back(
Data.AllReferencedProtocols.size());
937 P =
Data.AllReferencedProtocols.begin(),
938 PEnd =
Data.AllReferencedProtocols.end();
945 Writer.ObjCClassesWithCategories.insert(
D);
948 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
959 Record.push_back(
D->getAccessControl());
960 Record.push_back(
D->getSynthesize());
981 Record.push_back(
D->isThisDeclarationADefinition());
982 if (
D->isThisDeclarationADefinition()) {
983 Record.push_back(
D->protocol_size());
984 for (
const auto *I :
D->protocols())
986 for (
const auto &PL :
D->protocol_locs())
987 Record.AddSourceLocation(PL);
988 Record.push_back(
D->getODRHash());
1001 Record.AddSourceLocation(
D->getCategoryNameLoc());
1002 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1003 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1004 Record.AddDeclRef(
D->getClassInterface());
1006 Record.push_back(
D->protocol_size());
1007 for (
const auto *I :
D->protocols())
1009 for (
const auto &PL :
D->protocol_locs())
1010 Record.AddSourceLocation(PL);
1016 Record.AddDeclRef(
D->getClassInterface());
1022 Record.AddSourceLocation(
D->getAtLoc());
1023 Record.AddSourceLocation(
D->getLParenLoc());
1024 Record.AddTypeRef(
D->getType());
1025 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
1027 Record.push_back((
unsigned)
D->getPropertyAttributes());
1028 Record.push_back((
unsigned)
D->getPropertyAttributesAsWritten());
1030 Record.push_back((
unsigned)
D->getPropertyImplementation());
1031 Record.AddDeclarationName(
D->getGetterName());
1032 Record.AddSourceLocation(
D->getGetterNameLoc());
1033 Record.AddDeclarationName(
D->getSetterName());
1034 Record.AddSourceLocation(
D->getSetterNameLoc());
1035 Record.AddDeclRef(
D->getGetterMethodDecl());
1036 Record.AddDeclRef(
D->getSetterMethodDecl());
1037 Record.AddDeclRef(
D->getPropertyIvarDecl());
1043 Record.AddDeclRef(
D->getClassInterface());
1049 Record.AddSourceLocation(
D->getCategoryNameLoc());
1055 Record.AddDeclRef(
D->getSuperClass());
1056 Record.AddSourceLocation(
D->getSuperClassLoc());
1057 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1058 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1059 Record.push_back(
D->hasNonZeroConstructors());
1060 Record.push_back(
D->hasDestructors());
1061 Record.push_back(
D->NumIvarInitializers);
1062 if (
D->NumIvarInitializers)
1063 Record.AddCXXCtorInitializers(
1071 Record.AddDeclRef(
D->getPropertyDecl());
1072 Record.AddDeclRef(
D->getPropertyIvarDecl());
1073 Record.AddSourceLocation(
D->getPropertyIvarDeclLoc());
1074 Record.AddDeclRef(
D->getGetterMethodDecl());
1075 Record.AddDeclRef(
D->getSetterMethodDecl());
1076 Record.AddStmt(
D->getGetterCXXConstructor());
1077 Record.AddStmt(
D->getSetterCXXAssignment());
1083 Record.push_back(
D->isMutable());
1085 Record.push_back((
D->StorageKind << 1) |
D->BitField);
1086 if (
D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1088 else if (
D->BitField)
1089 Record.AddStmt(
D->getBitWidth());
1091 if (!
D->getDeclName() ||
D->isPlaceholderVar(Writer.
getLangOpts()))
1093 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(
D));
1103 !
D->getBitWidth() &&
1104 !
D->hasInClassInitializer() &&
1105 !
D->hasCapturedVLAType() &&
1117 Record.AddIdentifierRef(
D->getGetterId());
1118 Record.AddIdentifierRef(
D->getSetterId());
1135 Record.AddAPValue(
D->getValue());
1141 Record.AddAPValue(
D->getValue());
1147 Record.push_back(
D->getChainingSize());
1149 for (
const auto *
P :
D->chain())
1162 VarDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()),
1165 bool ModulesCodegen =
false;
1166 if (Writer.WritingModule &&
D->getStorageDuration() ==
SD_Static &&
1167 !
D->getDescribedVarTemplate()) {
1174 Writer.
getLangOpts().BuildingPCHWithObjectFile)) &&
1175 Record.getASTContext().GetGVALinkageForVariable(
D) >=
1178 VarDeclBits.
addBit(ModulesCodegen);
1180 VarDeclBits.
addBits(
D->getStorageClass(), 3);
1181 VarDeclBits.
addBits(
D->getTSCSpec(), 2);
1182 VarDeclBits.
addBits(
D->getInitStyle(), 2);
1183 VarDeclBits.
addBit(
D->isARCPseudoStrong());
1185 bool HasDeducedType =
false;
1186 if (!isa<ParmVarDecl>(
D)) {
1187 VarDeclBits.
addBit(
D->isThisDeclarationADemotedDefinition());
1188 VarDeclBits.
addBit(
D->isExceptionVariable());
1189 VarDeclBits.
addBit(
D->isNRVOVariable());
1190 VarDeclBits.
addBit(
D->isCXXForRangeDecl());
1192 VarDeclBits.
addBit(
D->isInline());
1193 VarDeclBits.
addBit(
D->isInlineSpecified());
1194 VarDeclBits.
addBit(
D->isConstexpr());
1195 VarDeclBits.
addBit(
D->isInitCapture());
1196 VarDeclBits.
addBit(
D->isPreviousDeclInSameBlockScope());
1198 VarDeclBits.
addBit(
D->isEscapingByref());
1199 HasDeducedType =
D->getType()->getContainedDeducedType();
1200 VarDeclBits.
addBit(HasDeducedType);
1202 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(
D))
1203 VarDeclBits.
addBits(llvm::to_underlying(IPD->getParameterKind()),
1208 VarDeclBits.
addBit(
D->isObjCForDecl());
1211 Record.push_back(VarDeclBits);
1219 if (
Init.getCopyExpr())
1224 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1227 Record.push_back(VarTemplate);
1228 Record.AddDeclRef(TemplD);
1230 =
D->getMemberSpecializationInfo()) {
1231 Record.push_back(StaticDataMemberSpecialization);
1232 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1233 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1234 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1236 Record.push_back(VarNotTemplate);
1244 D->
getKind() == Decl::Var && !
D->isInline() && !
D->isConstexpr() &&
1245 !
D->isInitCapture() && !
D->isPreviousDeclInSameBlockScope() &&
1246 !
D->isEscapingByref() && !HasDeducedType &&
1247 D->getStorageDuration() !=
SD_Static && !
D->getDescribedVarTemplate() &&
1248 !
D->getMemberSpecializationInfo() && !
D->isObjCForDecl() &&
1249 !isa<ImplicitParamDecl>(
D) && !
D->isEscapingByref())
1266 Record.push_back(
D->getFunctionScopeIndex());
1269 ParmVarDeclBits.
addBit(
D->isObjCMethodParameter());
1270 ParmVarDeclBits.
addBits(
D->getFunctionScopeDepth(), 7);
1272 ParmVarDeclBits.
addBits(
D->getObjCDeclQualifier(), 7);
1273 ParmVarDeclBits.
addBit(
D->isKNRPromoted());
1274 ParmVarDeclBits.
addBit(
D->hasInheritedDefaultArg());
1275 ParmVarDeclBits.
addBit(
D->hasUninstantiatedDefaultArg());
1276 ParmVarDeclBits.
addBit(
D->getExplicitObjectParamThisLoc().isValid());
1277 Record.push_back(ParmVarDeclBits);
1279 if (
D->hasUninstantiatedDefaultArg())
1280 Record.AddStmt(
D->getUninstantiatedDefaultArg());
1281 if (
D->getExplicitObjectParamThisLoc().isValid())
1282 Record.AddSourceLocation(
D->getExplicitObjectParamThisLoc());
1292 D->getInit() ==
nullptr)
1297 assert(!
D->getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1298 assert(!
D->isThisDeclarationADemotedDefinition()
1299 &&
"PARM_VAR_DECL can't be demoted definition.");
1301 assert(!
D->isExceptionVariable() &&
"PARM_VAR_DECL can't be exception var");
1302 assert(
D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1303 assert(!
D->isStaticDataMember() &&
1304 "PARM_VAR_DECL can't be static data member");
1309 Record.push_back(
D->bindings().size());
1312 for (
auto *B :
D->bindings())
1319 Record.AddStmt(
D->getBinding());
1325 Record.AddStmt(
D->getAsmString());
1326 Record.AddSourceLocation(
D->getRParenLoc());
1344 Record.AddDeclRef(
D->getExtendingDecl());
1345 Record.AddStmt(
D->getTemporaryExpr());
1346 Record.push_back(
static_cast<bool>(
D->getValue()));
1348 Record.AddAPValue(*
D->getValue());
1349 Record.push_back(
D->getManglingNumber());
1355 Record.AddTypeSourceInfo(
D->getSignatureAsWritten());
1356 Record.push_back(
D->param_size());
1359 Record.push_back(
D->isVariadic());
1360 Record.push_back(
D->blockMissingReturnType());
1361 Record.push_back(
D->isConversionFromLambda());
1362 Record.push_back(
D->doesNotEscape());
1363 Record.push_back(
D->canAvoidCopyToHeap());
1364 Record.push_back(
D->capturesCXXThis());
1365 Record.push_back(
D->getNumCaptures());
1366 for (
const auto &capture :
D->captures()) {
1367 Record.AddDeclRef(capture.getVariable());
1370 if (capture.isByRef()) flags |= 1;
1371 if (capture.isNested()) flags |= 2;
1372 if (capture.hasCopyExpr()) flags |= 4;
1375 if (capture.hasCopyExpr())
Record.AddStmt(capture.getCopyExpr());
1382 Record.push_back(
D->getNumParams());
1384 for (
unsigned I = 0; I <
D->getNumParams(); ++I)
1385 Record.AddDeclRef(
D->getParam(I));
1386 Record.push_back(
D->isNothrow() ? 1 : 0);
1404 "You need to update the serializer after you change the"
1405 "LinkageSpecDeclBits");
1408 Record.push_back(llvm::to_underlying(
D->getLanguage()));
1409 Record.AddSourceLocation(
D->getExternLoc());
1410 Record.AddSourceLocation(
D->getRBraceLoc());
1416 Record.AddSourceLocation(
D->getRBraceLoc());
1432 NamespaceDeclBits.
addBit(
D->isInline());
1433 NamespaceDeclBits.
addBit(
D->isNested());
1434 Record.push_back(NamespaceDeclBits);
1437 Record.AddSourceLocation(
D->getRBraceLoc());
1440 Record.AddDeclRef(
D->getAnonymousNamespace());
1443 if (Writer.
hasChain() &&
D->isAnonymousNamespace() &&
1450 D->getParent()->getRedeclContext()->getPrimaryContext());
1451 if (
Parent->isFromASTFile() || isa<TranslationUnitDecl>(
Parent)) {
1452 Writer.DeclUpdates[
Parent].push_back(
1461 Record.AddSourceLocation(
D->getNamespaceLoc());
1462 Record.AddSourceLocation(
D->getTargetNameLoc());
1463 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1464 Record.AddDeclRef(
D->getNamespace());
1470 Record.AddSourceLocation(
D->getUsingLoc());
1471 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1472 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1473 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1474 Record.push_back(
D->hasTypename());
1475 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingDecl(
D));
1481 Record.AddSourceLocation(
D->getUsingLoc());
1482 Record.AddSourceLocation(
D->getEnumLoc());
1483 Record.AddTypeSourceInfo(
D->getEnumType());
1484 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1485 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingEnumDecl(
D));
1490 Record.push_back(
D->NumExpansions);
1492 Record.AddDeclRef(
D->getInstantiatedFromUsingDecl());
1493 for (
auto *
E :
D->expansions())
1501 Record.AddDeclRef(
D->getTargetDecl());
1503 Record.AddDeclRef(
D->UsingOrNextShadow);
1505 Record.getASTContext().getInstantiatedFromUsingShadowDecl(
D));
1519 Record.AddDeclRef(
D->NominatedBaseClassShadowDecl);
1520 Record.AddDeclRef(
D->ConstructedBaseClassShadowDecl);
1521 Record.push_back(
D->IsVirtual);
1527 Record.AddSourceLocation(
D->getUsingLoc());
1528 Record.AddSourceLocation(
D->getNamespaceKeyLocation());
1529 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1530 Record.AddDeclRef(
D->getNominatedNamespace());
1531 Record.AddDeclRef(dyn_cast<Decl>(
D->getCommonAncestor()));
1537 Record.AddSourceLocation(
D->getUsingLoc());
1538 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1539 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1540 Record.AddSourceLocation(
D->getEllipsisLoc());
1547 Record.AddSourceLocation(
D->getTypenameLoc());
1548 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1549 Record.AddSourceLocation(
D->getEllipsisLoc());
1563 CXXRecNotTemplate = 0,
1565 CXXRecMemberSpecialization,
1569 Record.push_back(CXXRecTemplate);
1570 Record.AddDeclRef(TemplD);
1572 =
D->getMemberSpecializationInfo()) {
1573 Record.push_back(CXXRecMemberSpecialization);
1574 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1575 Record.push_back(MSInfo->getTemplateSpecializationKind());
1576 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1577 }
else if (
D->isLambda()) {
1579 Record.push_back(CXXLambda);
1580 if (
auto *Context =
D->getLambdaContextDecl()) {
1581 Record.AddDeclRef(Context);
1582 Record.push_back(
D->getLambdaIndexInContext());
1587 if (
auto FD = llvm::dyn_cast_or_null<FunctionDecl>(
D->
getDeclContext());
1588 FD && FD->isCanonicalDecl()) {
1589 Writer.RelatedDeclsMap[Writer.
GetDeclRef(FD)].push_back(
1593 Record.push_back(CXXRecNotTemplate);
1596 Record.push_back(
D->isThisDeclarationADefinition());
1597 if (
D->isThisDeclarationADefinition())
1598 Record.AddCXXDefinitionData(
D);
1608 if (
D->isCompleteDefinition())
1609 Record.AddDeclRef(
Record.getASTContext().getCurrentKeyFunction(
D));
1617 Record.push_back(
D->size_overridden_methods());
1629 !
D->hasExtInfo() && !
D->isExplicitlyDefaulted()) {
1635 else if (
D->getTemplatedKind() ==
1638 D->getTemplateSpecializationInfo();
1647 }
else if (
D->getTemplatedKind() ==
1650 D->getDependentSpecializationInfo();
1661 "You need to update the serializer after you change the "
1662 "CXXConstructorDeclBits");
1664 Record.push_back(
D->getTrailingAllocKind());
1666 if (
auto Inherited =
D->getInheritedConstructor()) {
1667 Record.AddDeclRef(Inherited.getShadowDecl());
1668 Record.AddDeclRef(Inherited.getConstructor());
1678 Record.AddDeclRef(
D->getOperatorDelete());
1679 if (
D->getOperatorDelete())
1680 Record.AddStmt(
D->getOperatorDeleteThisArg());
1693 Record.push_back(Writer.getSubmoduleID(
D->getImportedModule()));
1695 Record.push_back(!IdentifierLocs.empty());
1696 if (IdentifierLocs.empty()) {
1700 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1701 Record.AddSourceLocation(IdentifierLocs[I]);
1702 Record.push_back(IdentifierLocs.size());
1711 Record.AddSourceLocation(
D->getColonLoc());
1718 Record.push_back(
D->NumTPLists);
1720 bool hasFriendDecl = isa<NamedDecl *>(
D->Friend);
1721 Record.push_back(hasFriendDecl);
1723 Record.AddDeclRef(
D->getFriendDecl());
1725 Record.AddTypeSourceInfo(
D->getFriendType());
1726 for (
unsigned i = 0; i <
D->NumTPLists; ++i)
1727 Record.AddTemplateParameterList(
D->getFriendTypeTemplateParameterList(i));
1728 Record.AddDeclRef(
D->getNextFriend());
1729 Record.push_back(
D->UnsupportedFriend);
1730 Record.AddSourceLocation(
D->FriendLoc);
1731 Record.AddSourceLocation(
D->EllipsisLoc);
1737 Record.push_back(
D->getNumTemplateParameters());
1738 for (
unsigned i = 0, e =
D->getNumTemplateParameters(); i != e; ++i)
1739 Record.AddTemplateParameterList(
D->getTemplateParameterList(i));
1740 Record.push_back(
D->getFriendDecl() !=
nullptr);
1741 if (
D->getFriendDecl())
1742 Record.AddDeclRef(
D->getFriendDecl());
1744 Record.AddTypeSourceInfo(
D->getFriendType());
1745 Record.AddSourceLocation(
D->getFriendLoc());
1752 Record.AddTemplateParameterList(
D->getTemplateParameters());
1753 Record.AddDeclRef(
D->getTemplatedDecl());
1758 Record.AddStmt(
D->getConstraintExpr());
1764 Record.push_back(
D->getTemplateArguments().size());
1767 Record.AddTemplateArgument(Arg);
1782 Record.AddDeclRef(
D->getInstantiatedFromMemberTemplate());
1783 if (
D->getInstantiatedFromMemberTemplate())
1784 Record.push_back(
D->isMemberSpecialization());
1801 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
D);
1817 =
D->getSpecializedTemplateOrPartial();
1819 Record.AddDeclRef(InstFromD);
1821 Record.AddDeclRef(cast<ClassTemplatePartialSpecializationDecl *>(InstFrom));
1822 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1825 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1826 Record.AddSourceLocation(
D->getPointOfInstantiation());
1827 Record.push_back(
D->getSpecializationKind());
1835 bool ExplicitInstantiation =
1836 D->getTemplateSpecializationKind() ==
1839 Record.push_back(ExplicitInstantiation);
1840 if (ExplicitInstantiation) {
1841 Record.AddSourceLocation(
D->getExternKeywordLoc());
1842 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1846 D->getTemplateArgsAsWritten();
1847 Record.push_back(!!ArgsWritten);
1849 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1858 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
1859 D->getSpecializedTemplate());
1869 Record.AddTemplateParameterList(
D->getTemplateParameters());
1875 Record.AddDeclRef(
D->getInstantiatedFromMember());
1876 Record.push_back(
D->isMemberSpecialization());
1894 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1895 InstFrom =
D->getSpecializedTemplateOrPartial();
1897 Record.AddDeclRef(InstFromD);
1899 Record.AddDeclRef(cast<VarTemplatePartialSpecializationDecl *>(InstFrom));
1900 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1903 bool ExplicitInstantiation =
1904 D->getTemplateSpecializationKind() ==
1907 Record.push_back(ExplicitInstantiation);
1908 if (ExplicitInstantiation) {
1909 Record.AddSourceLocation(
D->getExternKeywordLoc());
1910 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1914 D->getTemplateArgsAsWritten();
1915 Record.push_back(!!ArgsWritten);
1917 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1919 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1920 Record.AddSourceLocation(
D->getPointOfInstantiation());
1921 Record.push_back(
D->getSpecializationKind());
1922 Record.push_back(
D->IsCompleteDefinition);
1938 Record.AddTemplateParameterList(
D->getTemplateParameters());
1944 Record.AddDeclRef(
D->getInstantiatedFromMember());
1945 Record.push_back(
D->isMemberSpecialization());
1960 Record.push_back(
D->hasTypeConstraint());
1963 Record.push_back(
D->wasDeclaredWithTypename());
1966 if (
D->hasTypeConstraint())
1967 Record.push_back(TC !=
nullptr);
1970 Record.push_back(CR !=
nullptr);
1972 Record.AddConceptReference(CR);
1974 Record.push_back(
D->isExpandedParameterPack());
1975 if (
D->isExpandedParameterPack())
1976 Record.push_back(
D->getNumExpansionParameters());
1979 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
1980 !
D->defaultArgumentWasInherited();
1981 Record.push_back(OwnsDefaultArg);
1983 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
1985 if (!
D->hasTypeConstraint() && !OwnsDefaultArg &&
2001 if (
D->isExpandedParameterPack())
2002 Record.push_back(
D->getNumExpansionTypes());
2006 Record.push_back(
D->getDepth());
2007 Record.push_back(
D->getPosition());
2011 if (
D->isExpandedParameterPack()) {
2012 for (
unsigned I = 0, N =
D->getNumExpansionTypes(); I != N; ++I) {
2013 Record.AddTypeRef(
D->getExpansionType(I));
2014 Record.AddTypeSourceInfo(
D->getExpansionTypeSourceInfo(I));
2021 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2022 !
D->defaultArgumentWasInherited();
2023 Record.push_back(OwnsDefaultArg);
2025 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2034 if (
D->isExpandedParameterPack())
2035 Record.push_back(
D->getNumExpansionTemplateParameters());
2038 Record.push_back(
D->wasDeclaredWithTypename());
2040 Record.push_back(
D->getDepth());
2041 Record.push_back(
D->getPosition());
2043 if (
D->isExpandedParameterPack()) {
2044 for (
unsigned I = 0, N =
D->getNumExpansionTemplateParameters();
2046 Record.AddTemplateParameterList(
D->getExpansionTemplateParameters(I));
2051 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2052 !
D->defaultArgumentWasInherited();
2053 Record.push_back(OwnsDefaultArg);
2055 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2067 Record.AddStmt(
D->getAssertExpr());
2068 Record.push_back(
D->isFailed());
2069 Record.AddStmt(
D->getMessage());
2070 Record.AddSourceLocation(
D->getRParenLoc());
2077 "You need to update the serializer after you change the "
2080 uint64_t LexicalOffset = 0;
2081 uint64_t VisibleOffset = 0;
2082 uint64_t ModuleLocalOffset = 0;
2083 uint64_t TULocalOffset = 0;
2086 cast<NamespaceDecl>(DC)->isFromExplicitGlobalModule()) {
2090 Writer.DelayedNamespace.push_back(cast<NamespaceDecl>(DC));
2093 Writer.WriteDeclContextLexicalBlock(
Record.getASTContext(), DC);
2094 Writer.WriteDeclContextVisibleBlock(
Record.getASTContext(), DC,
2095 VisibleOffset, ModuleLocalOffset,
2099 Record.AddOffset(LexicalOffset);
2100 Record.AddOffset(VisibleOffset);
2101 Record.AddOffset(ModuleLocalOffset);
2102 Record.AddOffset(TULocalOffset);
2106 assert(
IsLocalDecl(
D) &&
"expected a local declaration");
2112 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2119 return CacheEntry =
D;
2122template <
typename T>
2125 T *MostRecent =
First->getMostRecentDecl();
2126 T *DAsT =
static_cast<T *
>(
D);
2127 if (MostRecent !=
First) {
2129 "Not considered redeclarable?");
2136 if (DAsT == FirstLocal) {
2140 unsigned I =
Record.size();
2153 if (!Prev->isFromASTFile())
2158 if (LocalRedecls.empty())
2164 Record.AddDeclRef(FirstLocal);
2184 Record.push_back(
D->isCBuffer());
2185 Record.AddSourceLocation(
D->getLocStart());
2186 Record.AddSourceLocation(
D->getLBraceLoc());
2187 Record.AddSourceLocation(
D->getRBraceLoc());
2193 Record.writeOMPChildren(
D->Data);
2199 Record.writeOMPChildren(
D->Data);
2205 Record.writeOMPChildren(
D->Data);
2212 "You need to update the serializer after you change the "
2213 "NumOMPDeclareReductionDeclBits");
2217 Record.AddStmt(
D->getCombinerIn());
2218 Record.AddStmt(
D->getCombinerOut());
2219 Record.AddStmt(
D->getCombiner());
2220 Record.AddStmt(
D->getInitOrig());
2221 Record.AddStmt(
D->getInitPriv());
2222 Record.AddStmt(
D->getInitializer());
2223 Record.push_back(llvm::to_underlying(
D->getInitializerKind()));
2224 Record.AddDeclRef(
D->getPrevDeclInScope());
2229 Record.writeOMPChildren(
D->Data);
2231 Record.AddDeclarationName(
D->getVarName());
2232 Record.AddDeclRef(
D->getPrevDeclInScope());
2246template <FunctionDecl::TemplatedKind Kind>
2247std::shared_ptr<llvm::BitCodeAbbrev>
2249 using namespace llvm;
2251 auto Abv = std::make_shared<BitCodeAbbrev>();
2252 Abv->Add(BitCodeAbbrevOp(Code));
2254 Abv->Add(BitCodeAbbrevOp(0));
2255 Abv->Add(BitCodeAbbrevOp(Kind));
2260 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2263 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2265 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2266 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2268 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2269 }
else if constexpr (
Kind ==
2271 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2272 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2274 Abv->Add(BitCodeAbbrevOp(1));
2277 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2278 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2279 Abv->Add(BitCodeAbbrevOp(0));
2280 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2281 Abv->Add(BitCodeAbbrevOp(0));
2283 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2287 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2288 Abv->Add(BitCodeAbbrevOp(0));
2290 llvm_unreachable(
"Unknown templated kind?");
2293 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2302 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2303 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2306 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2307 Abv->Add(BitCodeAbbrevOp(0));
2309 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2311 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2312 Abv->Add(BitCodeAbbrevOp(0));
2313 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2315 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2316 Abv->Add(BitCodeAbbrevOp(
2317 BitCodeAbbrevOp::Fixed,
2325 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2326 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2335 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2336 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2340template <FunctionDecl::TemplatedKind Kind>
2341std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() {
2346void ASTWriter::WriteDeclAbbrevs() {
2347 using namespace llvm;
2349 std::shared_ptr<BitCodeAbbrev> Abv;
2352 Abv = std::make_shared<BitCodeAbbrev>();
2355 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2363 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2364 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2366 Abv->Add(BitCodeAbbrevOp(0));
2367 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2368 Abv->Add(BitCodeAbbrevOp(0));
2370 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2372 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2373 Abv->Add(BitCodeAbbrevOp(0));
2374 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2376 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2377 Abv->Add(BitCodeAbbrevOp(0));
2379 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2380 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2381 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2384 Abv = std::make_shared<BitCodeAbbrev>();
2387 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2392 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2393 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2395 Abv->Add(BitCodeAbbrevOp(0));
2396 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2397 Abv->Add(BitCodeAbbrevOp(0));
2399 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2401 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2402 Abv->Add(BitCodeAbbrevOp(0));
2403 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2405 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2406 Abv->Add(BitCodeAbbrevOp(0));
2408 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2409 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2411 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2412 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2413 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2416 Abv = std::make_shared<BitCodeAbbrev>();
2419 Abv->Add(BitCodeAbbrevOp(0));
2421 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2429 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2430 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2432 Abv->Add(BitCodeAbbrevOp(0));
2433 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2434 Abv->Add(BitCodeAbbrevOp(0));
2436 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2437 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2439 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2440 Abv->Add(BitCodeAbbrevOp(
2441 BitCodeAbbrevOp::Fixed,
2445 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2446 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2448 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2449 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2450 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2451 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2452 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2453 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2455 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2456 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2457 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2458 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2459 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2462 Abv = std::make_shared<BitCodeAbbrev>();
2465 Abv->Add(BitCodeAbbrevOp(0));
2467 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2475 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2476 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2478 Abv->Add(BitCodeAbbrevOp(0));
2479 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2480 Abv->Add(BitCodeAbbrevOp(0));
2482 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2483 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2485 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2486 Abv->Add(BitCodeAbbrevOp(
2487 BitCodeAbbrevOp::Fixed,
2491 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2492 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2494 Abv->Add(BitCodeAbbrevOp(
2495 BitCodeAbbrevOp::Fixed,
2506 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2509 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2510 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2511 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2512 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2513 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2516 Abv = std::make_shared<BitCodeAbbrev>();
2519 Abv->Add(BitCodeAbbrevOp(0));
2521 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2527 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2528 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2530 Abv->Add(BitCodeAbbrevOp(0));
2531 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2532 Abv->Add(BitCodeAbbrevOp(0));
2534 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2536 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2537 Abv->Add(BitCodeAbbrevOp(0));
2538 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2541 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2544 Abv->Add(BitCodeAbbrevOp(0));
2546 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2547 Abv->Add(BitCodeAbbrevOp(
2548 BitCodeAbbrevOp::Fixed,
2553 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2554 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2555 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2558 Abv = std::make_shared<BitCodeAbbrev>();
2561 Abv->Add(BitCodeAbbrevOp(0));
2563 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2569 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2570 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2572 Abv->Add(BitCodeAbbrevOp(0));
2573 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2574 Abv->Add(BitCodeAbbrevOp(0));
2576 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2577 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2579 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2580 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2581 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2584 Abv = std::make_shared<BitCodeAbbrev>();
2587 Abv->Add(BitCodeAbbrevOp(0));
2589 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2594 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2595 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2597 Abv->Add(BitCodeAbbrevOp(0));
2598 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2599 Abv->Add(BitCodeAbbrevOp(0));
2601 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2603 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2604 Abv->Add(BitCodeAbbrevOp(0));
2605 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2607 Abv->Add(BitCodeAbbrevOp(
2608 BitCodeAbbrevOp::Fixed,
2616 Abv->Add(BitCodeAbbrevOp(0));
2618 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2619 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2620 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2623 DeclCXXMethodAbbrev =
2624 Stream.EmitAbbrev(getCXXMethodAbbrev<FunctionDecl::TK_NonTemplate>());
2625 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2626 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplate>());
2627 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2628 getCXXMethodAbbrev<FunctionDecl::TK_DependentNonTemplate>());
2629 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2630 getCXXMethodAbbrev<FunctionDecl::TK_MemberSpecialization>());
2631 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2632 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplateSpecialization>());
2633 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2638 Abv = std::make_shared<BitCodeAbbrev>();
2640 Abv->Add(BitCodeAbbrevOp(0));
2642 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2648 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2649 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2651 Abv->Add(BitCodeAbbrevOp(0));
2652 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2653 Abv->Add(BitCodeAbbrevOp(0));
2655 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2656 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2659 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2660 Abv->Add(BitCodeAbbrevOp(0));
2661 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2664 Abv = std::make_shared<BitCodeAbbrev>();
2667 Abv->Add(BitCodeAbbrevOp(0));
2669 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2674 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2675 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2677 Abv->Add(BitCodeAbbrevOp(0));
2678 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2679 Abv->Add(BitCodeAbbrevOp(0));
2681 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2682 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2683 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2684 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2686 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2689 Abv = std::make_shared<BitCodeAbbrev>();
2694 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2695 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2700 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2701 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2703 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2706 Abv = std::make_shared<BitCodeAbbrev>();
2711 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2712 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2714 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2715 Abv->Add(BitCodeAbbrevOp(32));
2716 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2717 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2720 Abv = std::make_shared<BitCodeAbbrev>();
2725 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2726 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2728 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2729 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2730 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2731 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2734 Abv = std::make_shared<BitCodeAbbrev>();
2739 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2740 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2742 Abv->Add(BitCodeAbbrevOp(0));
2744 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2746 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2749 Abv = std::make_shared<BitCodeAbbrev>();
2755 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2756 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2759 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2760 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2761 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2764 Abv = std::make_shared<BitCodeAbbrev>();
2770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2771 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2775 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2776 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2778 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2780 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2783 Abv = std::make_shared<BitCodeAbbrev>();
2788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2789 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2791 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2792 Abv->Add(BitCodeAbbrevOp(0));
2793 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2794 CallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2797 Abv = std::make_shared<BitCodeAbbrev>();
2802 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2803 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2805 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2806 Abv->Add(BitCodeAbbrevOp(0));
2807 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2809 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2810 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2812 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2815 Abv = std::make_shared<BitCodeAbbrev>();
2820 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2821 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2823 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2824 Abv->Add(BitCodeAbbrevOp(0));
2825 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2827 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2830 Abv = std::make_shared<BitCodeAbbrev>();
2834 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2835 Abv->Add(BitCodeAbbrevOp(0));
2836 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2837 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2838 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
2840 Abv = std::make_shared<BitCodeAbbrev>();
2842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2843 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2845 Abv = std::make_shared<BitCodeAbbrev>();
2847 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2848 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2850 Abv = std::make_shared<BitCodeAbbrev>();
2852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2853 DeclModuleLocalVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2855 Abv = std::make_shared<BitCodeAbbrev>();
2857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2858 DeclTULocalLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2860 Abv = std::make_shared<BitCodeAbbrev>();
2862 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2863 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2865 Abv = std::make_shared<BitCodeAbbrev>();
2867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2868 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2893 if (isa<PragmaCommentDecl, PragmaDetectMismatchDecl>(
D))
2903 if (isa<FileScopeAsmDecl, TopLevelStmtDecl, ObjCImplDecl>(
D))
2921 assert(!
D->
isFromASTFile() &&
"should not be emitting imported decl");
2928 assert(ID >= FirstDeclID &&
"invalid decl ID");
2944 unsigned Index =
ID.getRawValue() - FirstDeclID.
getRawValue();
2945 if (DeclOffsets.size() == Index)
2946 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
2947 else if (DeclOffsets.size() < Index) {
2949 DeclOffsets.resize(Index+1);
2950 DeclOffsets[Index].setRawLoc(RawLoc);
2951 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
2953 llvm_unreachable(
"declarations should be emitted in ID order");
2958 associateDeclWithFile(
D, ID);
2971 bool ModulesCodegen =
false;
2973 std::optional<GVALinkage>
Linkage;
2974 if (Writer->WritingModule &&
2980 Linkage = getASTContext().GetGVALinkageForFunction(FD);
2984 (FD->
hasAttr<DLLExportAttr>() &&
2985 Writer->
getLangOpts().BuildingPCHWithObjectFile)) {
2989 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2991 Linkage = getASTContext().GetGVALinkageForFunction(FD);
2997 Record->push_back(ModulesCodegen);
2999 Writer->
AddDeclRef(FD, Writer->ModularCodegenDecls);
3000 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
3001 Record->push_back(CD->getNumCtorInitializers());
3002 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 VisitOutlinedFunctionDecl(OutlinedFunctionDecl *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.
@ NumOMPDeclareReductionDeclBits
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
@ NumObjCContainerDeclBits
@ NumCXXConstructorDeclBits
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 partial function definition.
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_CONTEXT_TU_LOCAL_VISIBLE
A record that stores the set of declarations that are only visible to the TU.
@ 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_OUTLINEDFUNCTION
A OutlinedFunctionDecl record.
@ 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_CONTEXT_MODULE_LOCAL_VISIBLE
A record containing the set of declarations that are only visible from DeclContext in the same module...
@ 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)