24#include "llvm/Bitstream/BitstreamWriter.h"
25#include "llvm/Support/ErrorHandling.h"
28using namespace serialization;
38template <
typename DT>
bool isDefinitionInDependentContext(DT *
D) {
39 return D->isDependentContext() &&
D->isThisDeclarationADefinition();
56 bool GeneratingReducedBMI =
false;
62 Code((serialization::
DeclCode)0), AbbrevToUse(0),
63 GeneratingReducedBMI(GeneratingReducedBMI) {}
67 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
69 return Record.Emit(Code, AbbrevToUse);
188 for (
auto *typeParam : *typeParams) {
189 Record.AddDeclRef(typeParam);
198 const Decl *
D,
bool IncludeLocal,
199 llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
203 if (R->isFromASTFile())
205 else if (IncludeLocal)
214 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
217 for (
const auto &F : Firsts)
218 Record.AddDeclRef(F.second);
228 assert((isa<ClassTemplateSpecializationDecl>(
D) ||
229 isa<VarTemplateSpecializationDecl>(
D) || isa<FunctionDecl>(
D)) &&
230 "Must not be called with other decls");
231 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
234 for (
const auto &F : Firsts) {
237 PartialSpecsInMap.push_back(F.second);
239 SpecsInMap.push_back(F.second);
244 template <
typename EntryType>
253 return Common->PartialSpecializations;
260 template<
typename DeclTy>
262 auto *Common =
D->getCommonPtr();
267 if (Writer.Chain !=
Record.getASTContext().getExternalSource() &&
269 D->LoadLazySpecializations();
276 for (
auto &Entry : Common->Specializations)
283 for (
auto *
D : AllSpecs) {
288 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
292 if (isa<FunctionTemplateDecl>(
D)) {
293 assert(PartialSpecs.empty());
297 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
298 D, PartialSpecs,
true));
321 Writer.PartialSpecializationsUpdates[cast<NamedDecl>(Template)]
324 Writer.SpecializationsUpdates[cast<NamedDecl>(Template)].push_back(
331 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
332 if (FD->isInlined() || FD->isConstexpr())
335 if (FD->isDependentContext())
342 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
343 if (!VD->getDeclContext()->getRedeclContext()->isFileContext() ||
344 VD->isInline() || VD->isConstexpr() || isa<ParmVarDecl>(VD) ||
348 VD->hasConstantInitialization())
364 if (
auto *DD = dyn_cast<DeclaratorDecl>(
D)) {
365 if (
auto *TInfo = DD->getTypeSourceInfo())
366 Record.AddTypeLoc(TInfo->getTypeLoc());
372 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
374 Record.push_back(FD->doesThisDeclarationHaveABody());
375 if (FD->doesThisDeclarationHaveABody())
376 Record.AddFunctionDefinition(FD);
385 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
387 Record.AddVarDeclInit(VD);
394 if (
auto *FD = dyn_cast<FieldDecl>(
D)) {
395 if (FD->hasInClassInitializer()) {
396 if (
Expr *
Init = FD->getInClassInitializer()) {
409 if (
auto *DC = dyn_cast<DeclContext>(
D))
434 Record.push_back(DeclBits);
455 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
456 if (!NS->isFromASTFile())
458 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
459 if (!NS->isInlineNamespace())
461 DC = NS->getParent();
467 StringRef Arg =
D->getArg();
468 Record.push_back(Arg.size());
471 Record.push_back(
D->getCommentKind());
478 StringRef Name =
D->getName();
479 StringRef
Value =
D->getValue();
489 llvm_unreachable(
"Translation units aren't directly serialized");
494 Record.AddDeclarationName(
D->getDeclName());
509 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
510 Record.push_back(
D->isModed());
512 Record.AddTypeRef(
D->getUnderlyingType());
513 Record.AddDeclRef(
D->getAnonDeclWithTypedefName(
false));
534 Record.AddDeclRef(
D->getDescribedAliasTemplate());
540 "You need to update the serializer after you change the "
548 TagDeclBits.
addBits(llvm::to_underlying(
D->getTagKind()), 3);
549 TagDeclBits.
addBit(!isa<CXXRecordDecl>(
D) ?
D->isCompleteDefinition() : 0);
550 TagDeclBits.
addBit(
D->isEmbeddedInDeclarator());
551 TagDeclBits.
addBit(
D->isFreeStanding());
552 TagDeclBits.
addBit(
D->isCompleteDefinitionRequired());
554 D->hasExtInfo() ? 1 : (
D->getTypedefNameForAnonDecl() ? 2 : 0),
556 Record.push_back(TagDeclBits);
558 Record.AddSourceRange(
D->getBraceRange());
560 if (
D->hasExtInfo()) {
561 Record.AddQualifierInfo(*
D->getExtInfo());
562 }
else if (
auto *TD =
D->getTypedefNameForAnonDecl()) {
564 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
570 "You need to update the serializer after you change the "
574 Record.AddTypeSourceInfo(
D->getIntegerTypeSourceInfo());
575 if (!
D->getIntegerTypeSourceInfo())
576 Record.AddTypeRef(
D->getIntegerType());
577 Record.AddTypeRef(
D->getPromotionType());
580 EnumDeclBits.
addBits(
D->getNumPositiveBits(), 8);
581 EnumDeclBits.
addBits(
D->getNumNegativeBits(), 8);
582 EnumDeclBits.
addBit(
D->isScoped());
583 EnumDeclBits.
addBit(
D->isScopedUsingClassTag());
584 EnumDeclBits.
addBit(
D->isFixed());
585 Record.push_back(EnumDeclBits);
587 Record.push_back(
D->getODRHash());
590 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
591 Record.push_back(MemberInfo->getTemplateSpecializationKind());
592 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
594 Record.AddDeclRef(
nullptr);
599 !
D->getTypedefNameForAnonDecl() &&
603 !
D->getIntegerTypeSourceInfo() && !
D->getMemberSpecializationInfo() &&
613 "You need to update the serializer after you change the "
619 RecordDeclBits.
addBit(
D->hasFlexibleArrayMember());
620 RecordDeclBits.
addBit(
D->isAnonymousStructOrUnion());
621 RecordDeclBits.
addBit(
D->hasObjectMember());
622 RecordDeclBits.
addBit(
D->hasVolatileMember());
623 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDefaultInitialize());
624 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveCopy());
625 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDestroy());
626 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDefaultInitializeCUnion());
627 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDestructCUnion());
628 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveCopyCUnion());
629 RecordDeclBits.
addBit(
D->hasUninitializedExplicitInitFields());
630 RecordDeclBits.
addBit(
D->isParamDestroyedInCallee());
631 RecordDeclBits.
addBits(llvm::to_underlying(
D->getArgPassingRestrictions()), 2);
632 Record.push_back(RecordDeclBits);
636 if (!isa<CXXRecordDecl>(
D))
637 Record.push_back(
D->getODRHash());
641 !
D->getTypedefNameForAnonDecl() &&
654 Record.AddTypeRef(
D->getType());
659 Record.push_back(
D->getInitExpr()? 1 : 0);
660 if (
D->getInitExpr())
661 Record.AddStmt(
D->getInitExpr());
662 Record.AddAPSInt(
D->getInitVal());
669 Record.AddSourceLocation(
D->getInnerLocStart());
670 Record.push_back(
D->hasExtInfo());
671 if (
D->hasExtInfo()) {
672 DeclaratorDecl::ExtInfo *Info =
D->getExtInfo();
673 Record.AddQualifierInfo(*Info);
674 Record.AddStmt(Info->TrailingRequiresClause);
677 Record.AddTypeRef(
D->getTypeSourceInfo() ?
D->getTypeSourceInfo()->getType()
683 "You need to update the serializer after you change the "
688 Record.push_back(
D->getTemplatedKind());
689 switch (
D->getTemplatedKind()) {
693 Record.AddDeclRef(
D->getInstantiatedFromDecl());
696 Record.AddDeclRef(
D->getDescribedFunctionTemplate());
707 FTSInfo =
D->getTemplateSpecializationInfo();
720 Record.AddASTTemplateArgumentListInfo(
728 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
729 Record.push_back(MemberInfo->getTemplateSpecializationKind());
730 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
744 DFTSInfo =
D->getDependentSpecializationInfo();
754 Record.AddASTTemplateArgumentListInfo(
761 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
769 FunctionDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()), 3);
770 FunctionDeclBits.
addBits((uint32_t)
D->getStorageClass(), 3);
771 FunctionDeclBits.
addBit(
D->isInlineSpecified());
772 FunctionDeclBits.
addBit(
D->isInlined());
773 FunctionDeclBits.
addBit(
D->hasSkippedBody());
774 FunctionDeclBits.
addBit(
D->isVirtualAsWritten());
775 FunctionDeclBits.
addBit(
D->isPureVirtual());
776 FunctionDeclBits.
addBit(
D->hasInheritedPrototype());
777 FunctionDeclBits.
addBit(
D->hasWrittenPrototype());
778 FunctionDeclBits.
addBit(
D->isDeletedBit());
779 FunctionDeclBits.
addBit(
D->isTrivial());
780 FunctionDeclBits.
addBit(
D->isTrivialForCall());
781 FunctionDeclBits.
addBit(
D->isDefaulted());
782 FunctionDeclBits.
addBit(
D->isExplicitlyDefaulted());
783 FunctionDeclBits.
addBit(
D->isIneligibleOrNotSelected());
784 FunctionDeclBits.
addBits((uint64_t)(
D->getConstexprKind()), 2);
785 FunctionDeclBits.
addBit(
D->hasImplicitReturnZero());
786 FunctionDeclBits.
addBit(
D->isMultiVersion());
787 FunctionDeclBits.
addBit(
D->isLateTemplateParsed());
788 FunctionDeclBits.
addBit(
D->FriendConstraintRefersToEnclosingTemplate());
789 FunctionDeclBits.
addBit(
D->usesSEHTry());
790 Record.push_back(FunctionDeclBits);
793 if (
D->isExplicitlyDefaulted())
794 Record.AddSourceLocation(
D->getDefaultLoc());
796 Record.push_back(
D->getODRHash());
798 if (
D->isDefaulted() ||
D->isDeletedAsWritten()) {
799 if (
auto *FDI =
D->getDefalutedOrDeletedInfo()) {
803 Record.push_back(1 | (DeletedMessage ? 2 : 0));
805 Record.AddStmt(DeletedMessage);
807 Record.push_back(FDI->getUnqualifiedLookups().size());
809 Record.AddDeclRef(
P.getDecl());
810 Record.push_back(
P.getAccess());
821 if (
auto *RD = dyn_cast<CXXRecordDecl>(
D->getLexicalParent());
822 RD && isDefinitionInDependentContext(RD)) {
823 Writer.RelatedDeclsMap[Writer.
GetDeclRef(RD)].push_back(
828 Record.push_back(
D->param_size());
829 for (
auto *
P :
D->parameters())
836 uint64_t Kind =
static_cast<uint64_t
>(ES.
getKind());
837 Kind = Kind << 1 | static_cast<bool>(ES.
getExpr());
848 Record.push_back(
static_cast<unsigned char>(
D->getDeductionCandidateKind()));
849 Record.AddDeclRef(
D->getSourceDeductionGuide());
851 static_cast<unsigned char>(
D->getSourceDeductionGuideKind()));
857 "You need to update the serializer after you change the "
858 "ObjCMethodDeclBits");
863 bool HasBodyStuff =
D->
getBody() !=
nullptr;
864 Record.push_back(HasBodyStuff);
868 Record.AddDeclRef(
D->getSelfDecl());
869 Record.AddDeclRef(
D->getCmdDecl());
870 Record.push_back(
D->isInstanceMethod());
871 Record.push_back(
D->isVariadic());
872 Record.push_back(
D->isPropertyAccessor());
873 Record.push_back(
D->isSynthesizedAccessorStub());
874 Record.push_back(
D->isDefined());
875 Record.push_back(
D->isOverriding());
876 Record.push_back(
D->hasSkippedBody());
878 Record.push_back(
D->isRedeclaration());
879 Record.push_back(
D->hasRedeclaration());
880 if (
D->hasRedeclaration()) {
881 assert(
Record.getASTContext().getObjCMethodRedeclaration(
D));
882 Record.AddDeclRef(
Record.getASTContext().getObjCMethodRedeclaration(
D));
886 Record.push_back(llvm::to_underlying(
D->getImplementationControl()));
888 Record.push_back(
D->getObjCDeclQualifier());
889 Record.push_back(
D->hasRelatedResultType());
890 Record.AddTypeRef(
D->getReturnType());
891 Record.AddTypeSourceInfo(
D->getReturnTypeSourceInfo());
893 Record.push_back(
D->param_size());
894 for (
const auto *
P :
D->parameters())
897 Record.push_back(
D->getSelLocsKind());
898 unsigned NumStoredSelLocs =
D->getNumStoredSelLocs();
900 Record.push_back(NumStoredSelLocs);
901 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
902 Record.AddSourceLocation(SelLocs[i]);
911 Record.AddSourceLocation(
D->VarianceLoc);
912 Record.AddSourceLocation(
D->ColonLoc);
919 "You need to update the serializer after you change the "
920 "ObjCContainerDeclBits");
923 Record.AddSourceLocation(
D->getAtStartLoc());
924 Record.AddSourceRange(
D->getAtEndRange());
934 Record.push_back(
D->isThisDeclarationADefinition());
935 if (
D->isThisDeclarationADefinition()) {
937 ObjCInterfaceDecl::DefinitionData &
Data =
D->data();
939 Record.AddTypeSourceInfo(
D->getSuperClassTInfo());
940 Record.AddSourceLocation(
D->getEndOfDefinitionLoc());
941 Record.push_back(
Data.HasDesignatedInitializers);
942 Record.push_back(
D->getODRHash());
945 Record.push_back(
Data.ReferencedProtocols.size());
946 for (
const auto *
P :
D->protocols())
948 for (
const auto &PL :
D->protocol_locs())
949 Record.AddSourceLocation(PL);
952 Record.push_back(
Data.AllReferencedProtocols.size());
954 P =
Data.AllReferencedProtocols.begin(),
955 PEnd =
Data.AllReferencedProtocols.end();
962 Writer.ObjCClassesWithCategories.insert(
D);
965 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
976 Record.push_back(
D->getAccessControl());
977 Record.push_back(
D->getSynthesize());
998 Record.push_back(
D->isThisDeclarationADefinition());
999 if (
D->isThisDeclarationADefinition()) {
1000 Record.push_back(
D->protocol_size());
1001 for (
const auto *I :
D->protocols())
1003 for (
const auto &PL :
D->protocol_locs())
1004 Record.AddSourceLocation(PL);
1005 Record.push_back(
D->getODRHash());
1018 Record.AddSourceLocation(
D->getCategoryNameLoc());
1019 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1020 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1021 Record.AddDeclRef(
D->getClassInterface());
1023 Record.push_back(
D->protocol_size());
1024 for (
const auto *I :
D->protocols())
1026 for (
const auto &PL :
D->protocol_locs())
1027 Record.AddSourceLocation(PL);
1033 Record.AddDeclRef(
D->getClassInterface());
1039 Record.AddSourceLocation(
D->getAtLoc());
1040 Record.AddSourceLocation(
D->getLParenLoc());
1041 Record.AddTypeRef(
D->getType());
1042 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
1044 Record.push_back((
unsigned)
D->getPropertyAttributes());
1045 Record.push_back((
unsigned)
D->getPropertyAttributesAsWritten());
1047 Record.push_back((
unsigned)
D->getPropertyImplementation());
1048 Record.AddDeclarationName(
D->getGetterName());
1049 Record.AddSourceLocation(
D->getGetterNameLoc());
1050 Record.AddDeclarationName(
D->getSetterName());
1051 Record.AddSourceLocation(
D->getSetterNameLoc());
1052 Record.AddDeclRef(
D->getGetterMethodDecl());
1053 Record.AddDeclRef(
D->getSetterMethodDecl());
1054 Record.AddDeclRef(
D->getPropertyIvarDecl());
1060 Record.AddDeclRef(
D->getClassInterface());
1066 Record.AddSourceLocation(
D->getCategoryNameLoc());
1072 Record.AddDeclRef(
D->getSuperClass());
1073 Record.AddSourceLocation(
D->getSuperClassLoc());
1074 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1075 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1076 Record.push_back(
D->hasNonZeroConstructors());
1077 Record.push_back(
D->hasDestructors());
1078 Record.push_back(
D->NumIvarInitializers);
1079 if (
D->NumIvarInitializers)
1080 Record.AddCXXCtorInitializers(
1088 Record.AddDeclRef(
D->getPropertyDecl());
1089 Record.AddDeclRef(
D->getPropertyIvarDecl());
1090 Record.AddSourceLocation(
D->getPropertyIvarDeclLoc());
1091 Record.AddDeclRef(
D->getGetterMethodDecl());
1092 Record.AddDeclRef(
D->getSetterMethodDecl());
1093 Record.AddStmt(
D->getGetterCXXConstructor());
1094 Record.AddStmt(
D->getSetterCXXAssignment());
1100 Record.push_back(
D->isMutable());
1102 Record.push_back((
D->StorageKind << 1) |
D->BitField);
1103 if (
D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1105 else if (
D->BitField)
1106 Record.AddStmt(
D->getBitWidth());
1108 if (!
D->getDeclName() ||
D->isPlaceholderVar(Writer.
getLangOpts()))
1110 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(
D));
1120 !
D->getBitWidth() &&
1121 !
D->hasInClassInitializer() &&
1122 !
D->hasCapturedVLAType() &&
1134 Record.AddIdentifierRef(
D->getGetterId());
1135 Record.AddIdentifierRef(
D->getSetterId());
1152 Record.AddAPValue(
D->getValue());
1158 Record.AddAPValue(
D->getValue());
1164 Record.push_back(
D->getChainingSize());
1166 for (
const auto *
P :
D->chain())
1179 VarDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()),
1182 bool ModulesCodegen =
false;
1183 if (Writer.WritingModule &&
D->getStorageDuration() ==
SD_Static &&
1184 !
D->getDescribedVarTemplate()) {
1191 Writer.
getLangOpts().BuildingPCHWithObjectFile)) &&
1192 Record.getASTContext().GetGVALinkageForVariable(
D) >=
1195 VarDeclBits.
addBit(ModulesCodegen);
1197 VarDeclBits.
addBits(
D->getStorageClass(), 3);
1198 VarDeclBits.
addBits(
D->getTSCSpec(), 2);
1199 VarDeclBits.
addBits(
D->getInitStyle(), 2);
1200 VarDeclBits.
addBit(
D->isARCPseudoStrong());
1202 bool HasDeducedType =
false;
1203 if (!isa<ParmVarDecl>(
D)) {
1204 VarDeclBits.
addBit(
D->isThisDeclarationADemotedDefinition());
1205 VarDeclBits.
addBit(
D->isExceptionVariable());
1206 VarDeclBits.
addBit(
D->isNRVOVariable());
1207 VarDeclBits.
addBit(
D->isCXXForRangeDecl());
1209 VarDeclBits.
addBit(
D->isInline());
1210 VarDeclBits.
addBit(
D->isInlineSpecified());
1211 VarDeclBits.
addBit(
D->isConstexpr());
1212 VarDeclBits.
addBit(
D->isInitCapture());
1213 VarDeclBits.
addBit(
D->isPreviousDeclInSameBlockScope());
1215 VarDeclBits.
addBit(
D->isEscapingByref());
1216 HasDeducedType =
D->getType()->getContainedDeducedType();
1217 VarDeclBits.
addBit(HasDeducedType);
1219 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(
D))
1220 VarDeclBits.
addBits(llvm::to_underlying(IPD->getParameterKind()),
1225 VarDeclBits.
addBit(
D->isObjCForDecl());
1228 Record.push_back(VarDeclBits);
1236 if (
Init.getCopyExpr())
1241 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1244 Record.push_back(VarTemplate);
1245 Record.AddDeclRef(TemplD);
1247 =
D->getMemberSpecializationInfo()) {
1248 Record.push_back(StaticDataMemberSpecialization);
1249 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1250 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1251 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1253 Record.push_back(VarNotTemplate);
1261 D->
getKind() == Decl::Var && !
D->isInline() && !
D->isConstexpr() &&
1262 !
D->isInitCapture() && !
D->isPreviousDeclInSameBlockScope() &&
1263 !
D->isEscapingByref() && !HasDeducedType &&
1264 D->getStorageDuration() !=
SD_Static && !
D->getDescribedVarTemplate() &&
1265 !
D->getMemberSpecializationInfo() && !
D->isObjCForDecl() &&
1266 !isa<ImplicitParamDecl>(
D) && !
D->isEscapingByref())
1283 Record.push_back(
D->getFunctionScopeIndex());
1286 ParmVarDeclBits.
addBit(
D->isObjCMethodParameter());
1287 ParmVarDeclBits.
addBits(
D->getFunctionScopeDepth(), 7);
1289 ParmVarDeclBits.
addBits(
D->getObjCDeclQualifier(), 7);
1290 ParmVarDeclBits.
addBit(
D->isKNRPromoted());
1291 ParmVarDeclBits.
addBit(
D->hasInheritedDefaultArg());
1292 ParmVarDeclBits.
addBit(
D->hasUninstantiatedDefaultArg());
1293 ParmVarDeclBits.
addBit(
D->getExplicitObjectParamThisLoc().isValid());
1294 Record.push_back(ParmVarDeclBits);
1296 if (
D->hasUninstantiatedDefaultArg())
1297 Record.AddStmt(
D->getUninstantiatedDefaultArg());
1298 if (
D->getExplicitObjectParamThisLoc().isValid())
1299 Record.AddSourceLocation(
D->getExplicitObjectParamThisLoc());
1309 D->getInit() ==
nullptr)
1314 assert(!
D->getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1315 assert(!
D->isThisDeclarationADemotedDefinition()
1316 &&
"PARM_VAR_DECL can't be demoted definition.");
1318 assert(!
D->isExceptionVariable() &&
"PARM_VAR_DECL can't be exception var");
1319 assert(
D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1320 assert(!
D->isStaticDataMember() &&
1321 "PARM_VAR_DECL can't be static data member");
1326 Record.push_back(
D->bindings().size());
1329 for (
auto *B :
D->bindings())
1336 Record.AddStmt(
D->getBinding());
1342 Record.AddStmt(
D->getAsmString());
1343 Record.AddSourceLocation(
D->getRParenLoc());
1361 Record.AddDeclRef(
D->getExtendingDecl());
1362 Record.AddStmt(
D->getTemporaryExpr());
1363 Record.push_back(
static_cast<bool>(
D->getValue()));
1365 Record.AddAPValue(*
D->getValue());
1366 Record.push_back(
D->getManglingNumber());
1372 Record.AddTypeSourceInfo(
D->getSignatureAsWritten());
1373 Record.push_back(
D->param_size());
1376 Record.push_back(
D->isVariadic());
1377 Record.push_back(
D->blockMissingReturnType());
1378 Record.push_back(
D->isConversionFromLambda());
1379 Record.push_back(
D->doesNotEscape());
1380 Record.push_back(
D->canAvoidCopyToHeap());
1381 Record.push_back(
D->capturesCXXThis());
1382 Record.push_back(
D->getNumCaptures());
1383 for (
const auto &capture :
D->captures()) {
1384 Record.AddDeclRef(capture.getVariable());
1387 if (capture.isByRef()) flags |= 1;
1388 if (capture.isNested()) flags |= 2;
1389 if (capture.hasCopyExpr()) flags |= 4;
1392 if (capture.hasCopyExpr())
Record.AddStmt(capture.getCopyExpr());
1399 Record.push_back(
D->getNumParams());
1401 for (
unsigned I = 0; I <
D->getNumParams(); ++I)
1402 Record.AddDeclRef(
D->getParam(I));
1403 Record.push_back(
D->isNothrow() ? 1 : 0);
1421 "You need to update the serializer after you change the"
1422 "LinkageSpecDeclBits");
1425 Record.push_back(llvm::to_underlying(
D->getLanguage()));
1426 Record.AddSourceLocation(
D->getExternLoc());
1427 Record.AddSourceLocation(
D->getRBraceLoc());
1433 Record.AddSourceLocation(
D->getRBraceLoc());
1449 NamespaceDeclBits.
addBit(
D->isInline());
1450 NamespaceDeclBits.
addBit(
D->isNested());
1451 Record.push_back(NamespaceDeclBits);
1454 Record.AddSourceLocation(
D->getRBraceLoc());
1457 Record.AddDeclRef(
D->getAnonymousNamespace());
1460 if (Writer.
hasChain() &&
D->isAnonymousNamespace() &&
1467 D->getParent()->getRedeclContext()->getPrimaryContext());
1468 if (
Parent->isFromASTFile() || isa<TranslationUnitDecl>(
Parent)) {
1469 Writer.DeclUpdates[
Parent].push_back(
1478 Record.AddSourceLocation(
D->getNamespaceLoc());
1479 Record.AddSourceLocation(
D->getTargetNameLoc());
1480 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1481 Record.AddDeclRef(
D->getNamespace());
1487 Record.AddSourceLocation(
D->getUsingLoc());
1488 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1489 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1490 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1491 Record.push_back(
D->hasTypename());
1492 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingDecl(
D));
1498 Record.AddSourceLocation(
D->getUsingLoc());
1499 Record.AddSourceLocation(
D->getEnumLoc());
1500 Record.AddTypeSourceInfo(
D->getEnumType());
1501 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1502 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingEnumDecl(
D));
1507 Record.push_back(
D->NumExpansions);
1509 Record.AddDeclRef(
D->getInstantiatedFromUsingDecl());
1510 for (
auto *
E :
D->expansions())
1518 Record.AddDeclRef(
D->getTargetDecl());
1520 Record.AddDeclRef(
D->UsingOrNextShadow);
1522 Record.getASTContext().getInstantiatedFromUsingShadowDecl(
D));
1536 Record.AddDeclRef(
D->NominatedBaseClassShadowDecl);
1537 Record.AddDeclRef(
D->ConstructedBaseClassShadowDecl);
1538 Record.push_back(
D->IsVirtual);
1544 Record.AddSourceLocation(
D->getUsingLoc());
1545 Record.AddSourceLocation(
D->getNamespaceKeyLocation());
1546 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1547 Record.AddDeclRef(
D->getNominatedNamespace());
1548 Record.AddDeclRef(dyn_cast<Decl>(
D->getCommonAncestor()));
1554 Record.AddSourceLocation(
D->getUsingLoc());
1555 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1556 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1557 Record.AddSourceLocation(
D->getEllipsisLoc());
1564 Record.AddSourceLocation(
D->getTypenameLoc());
1565 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1566 Record.AddSourceLocation(
D->getEllipsisLoc());
1580 CXXRecNotTemplate = 0,
1582 CXXRecMemberSpecialization,
1586 Record.push_back(CXXRecTemplate);
1587 Record.AddDeclRef(TemplD);
1589 =
D->getMemberSpecializationInfo()) {
1590 Record.push_back(CXXRecMemberSpecialization);
1591 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1592 Record.push_back(MSInfo->getTemplateSpecializationKind());
1593 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1594 }
else if (
D->isLambda()) {
1596 Record.push_back(CXXLambda);
1597 if (
auto *Context =
D->getLambdaContextDecl()) {
1598 Record.AddDeclRef(Context);
1599 Record.push_back(
D->getLambdaIndexInContext());
1605 if (
auto *FD = llvm::dyn_cast_or_null<FunctionDecl>(
D->
getDeclContext());
1606 FD && isDefinitionInDependentContext(FD)) {
1607 Writer.RelatedDeclsMap[Writer.
GetDeclRef(FD)].push_back(
1611 Record.push_back(CXXRecNotTemplate);
1614 Record.push_back(
D->isThisDeclarationADefinition());
1615 if (
D->isThisDeclarationADefinition())
1616 Record.AddCXXDefinitionData(
D);
1626 if (
D->isCompleteDefinition())
1627 Record.AddDeclRef(
Record.getASTContext().getCurrentKeyFunction(
D));
1635 Record.push_back(
D->size_overridden_methods());
1647 !
D->hasExtInfo() && !
D->isExplicitlyDefaulted()) {
1653 else if (
D->getTemplatedKind() ==
1656 D->getTemplateSpecializationInfo();
1665 }
else if (
D->getTemplatedKind() ==
1668 D->getDependentSpecializationInfo();
1679 "You need to update the serializer after you change the "
1680 "CXXConstructorDeclBits");
1682 Record.push_back(
D->getTrailingAllocKind());
1684 if (
auto Inherited =
D->getInheritedConstructor()) {
1685 Record.AddDeclRef(Inherited.getShadowDecl());
1686 Record.AddDeclRef(Inherited.getConstructor());
1696 Record.AddDeclRef(
D->getOperatorDelete());
1697 if (
D->getOperatorDelete())
1698 Record.AddStmt(
D->getOperatorDeleteThisArg());
1711 Record.push_back(Writer.getSubmoduleID(
D->getImportedModule()));
1713 Record.push_back(!IdentifierLocs.empty());
1714 if (IdentifierLocs.empty()) {
1718 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1719 Record.AddSourceLocation(IdentifierLocs[I]);
1720 Record.push_back(IdentifierLocs.size());
1729 Record.AddSourceLocation(
D->getColonLoc());
1736 Record.push_back(
D->NumTPLists);
1738 bool hasFriendDecl = isa<NamedDecl *>(
D->Friend);
1739 Record.push_back(hasFriendDecl);
1741 Record.AddDeclRef(
D->getFriendDecl());
1743 Record.AddTypeSourceInfo(
D->getFriendType());
1744 for (
unsigned i = 0; i <
D->NumTPLists; ++i)
1745 Record.AddTemplateParameterList(
D->getFriendTypeTemplateParameterList(i));
1746 Record.AddDeclRef(
D->getNextFriend());
1747 Record.push_back(
D->UnsupportedFriend);
1748 Record.AddSourceLocation(
D->FriendLoc);
1749 Record.AddSourceLocation(
D->EllipsisLoc);
1755 Record.push_back(
D->getNumTemplateParameters());
1756 for (
unsigned i = 0, e =
D->getNumTemplateParameters(); i != e; ++i)
1757 Record.AddTemplateParameterList(
D->getTemplateParameterList(i));
1758 Record.push_back(
D->getFriendDecl() !=
nullptr);
1759 if (
D->getFriendDecl())
1760 Record.AddDeclRef(
D->getFriendDecl());
1762 Record.AddTypeSourceInfo(
D->getFriendType());
1763 Record.AddSourceLocation(
D->getFriendLoc());
1770 Record.AddTemplateParameterList(
D->getTemplateParameters());
1771 Record.AddDeclRef(
D->getTemplatedDecl());
1776 Record.AddStmt(
D->getConstraintExpr());
1782 Record.push_back(
D->getTemplateArguments().size());
1785 Record.AddTemplateArgument(Arg);
1800 Record.AddDeclRef(
D->getInstantiatedFromMemberTemplate());
1801 if (
D->getInstantiatedFromMemberTemplate())
1802 Record.push_back(
D->isMemberSpecialization());
1819 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
D);
1835 =
D->getSpecializedTemplateOrPartial();
1837 Record.AddDeclRef(InstFromD);
1839 Record.AddDeclRef(cast<ClassTemplatePartialSpecializationDecl *>(InstFrom));
1840 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1843 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1844 Record.AddSourceLocation(
D->getPointOfInstantiation());
1845 Record.push_back(
D->getSpecializationKind());
1853 bool ExplicitInstantiation =
1854 D->getTemplateSpecializationKind() ==
1857 Record.push_back(ExplicitInstantiation);
1858 if (ExplicitInstantiation) {
1859 Record.AddSourceLocation(
D->getExternKeywordLoc());
1860 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1864 D->getTemplateArgsAsWritten();
1865 Record.push_back(!!ArgsWritten);
1867 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1876 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
1877 D->getSpecializedTemplate());
1887 Record.AddTemplateParameterList(
D->getTemplateParameters());
1893 Record.AddDeclRef(
D->getInstantiatedFromMember());
1894 Record.push_back(
D->isMemberSpecialization());
1912 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1913 InstFrom =
D->getSpecializedTemplateOrPartial();
1915 Record.AddDeclRef(InstFromD);
1917 Record.AddDeclRef(cast<VarTemplatePartialSpecializationDecl *>(InstFrom));
1918 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1921 bool ExplicitInstantiation =
1922 D->getTemplateSpecializationKind() ==
1925 Record.push_back(ExplicitInstantiation);
1926 if (ExplicitInstantiation) {
1927 Record.AddSourceLocation(
D->getExternKeywordLoc());
1928 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1932 D->getTemplateArgsAsWritten();
1933 Record.push_back(!!ArgsWritten);
1935 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1937 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1938 Record.AddSourceLocation(
D->getPointOfInstantiation());
1939 Record.push_back(
D->getSpecializationKind());
1940 Record.push_back(
D->IsCompleteDefinition);
1956 Record.AddTemplateParameterList(
D->getTemplateParameters());
1962 Record.AddDeclRef(
D->getInstantiatedFromMember());
1963 Record.push_back(
D->isMemberSpecialization());
1978 Record.push_back(
D->hasTypeConstraint());
1981 Record.push_back(
D->wasDeclaredWithTypename());
1984 if (
D->hasTypeConstraint())
1985 Record.push_back(TC !=
nullptr);
1988 Record.push_back(CR !=
nullptr);
1990 Record.AddConceptReference(CR);
1992 Record.push_back(
D->isExpandedParameterPack());
1993 if (
D->isExpandedParameterPack())
1994 Record.push_back(
D->getNumExpansionParameters());
1997 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
1998 !
D->defaultArgumentWasInherited();
1999 Record.push_back(OwnsDefaultArg);
2001 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2003 if (!
D->hasTypeConstraint() && !OwnsDefaultArg &&
2019 if (
D->isExpandedParameterPack())
2020 Record.push_back(
D->getNumExpansionTypes());
2024 Record.push_back(
D->getDepth());
2025 Record.push_back(
D->getPosition());
2029 if (
D->isExpandedParameterPack()) {
2030 for (
unsigned I = 0, N =
D->getNumExpansionTypes(); I != N; ++I) {
2031 Record.AddTypeRef(
D->getExpansionType(I));
2032 Record.AddTypeSourceInfo(
D->getExpansionTypeSourceInfo(I));
2039 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2040 !
D->defaultArgumentWasInherited();
2041 Record.push_back(OwnsDefaultArg);
2043 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2052 if (
D->isExpandedParameterPack())
2053 Record.push_back(
D->getNumExpansionTemplateParameters());
2056 Record.push_back(
D->wasDeclaredWithTypename());
2058 Record.push_back(
D->getDepth());
2059 Record.push_back(
D->getPosition());
2061 if (
D->isExpandedParameterPack()) {
2062 for (
unsigned I = 0, N =
D->getNumExpansionTemplateParameters();
2064 Record.AddTemplateParameterList(
D->getExpansionTemplateParameters(I));
2069 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2070 !
D->defaultArgumentWasInherited();
2071 Record.push_back(OwnsDefaultArg);
2073 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2085 Record.AddStmt(
D->getAssertExpr());
2086 Record.push_back(
D->isFailed());
2087 Record.AddStmt(
D->getMessage());
2088 Record.AddSourceLocation(
D->getRParenLoc());
2095 "You need to update the serializer after you change the "
2098 uint64_t LexicalOffset = 0;
2099 uint64_t VisibleOffset = 0;
2100 uint64_t ModuleLocalOffset = 0;
2101 uint64_t TULocalOffset = 0;
2104 cast<NamespaceDecl>(DC)->isFromExplicitGlobalModule()) {
2108 Writer.DelayedNamespace.push_back(cast<NamespaceDecl>(DC));
2111 Writer.WriteDeclContextLexicalBlock(
Record.getASTContext(), DC);
2112 Writer.WriteDeclContextVisibleBlock(
Record.getASTContext(), DC,
2113 VisibleOffset, ModuleLocalOffset,
2117 Record.AddOffset(LexicalOffset);
2118 Record.AddOffset(VisibleOffset);
2119 Record.AddOffset(ModuleLocalOffset);
2120 Record.AddOffset(TULocalOffset);
2124 assert(
IsLocalDecl(
D) &&
"expected a local declaration");
2130 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2137 return CacheEntry =
D;
2140template <
typename T>
2143 T *MostRecent =
First->getMostRecentDecl();
2144 T *DAsT =
static_cast<T *
>(
D);
2145 if (MostRecent !=
First) {
2147 "Not considered redeclarable?");
2154 if (DAsT == FirstLocal) {
2158 unsigned I =
Record.size();
2171 if (!Prev->isFromASTFile())
2176 if (LocalRedecls.empty())
2182 Record.AddDeclRef(FirstLocal);
2202 Record.push_back(
D->isCBuffer());
2203 Record.AddSourceLocation(
D->getLocStart());
2204 Record.AddSourceLocation(
D->getLBraceLoc());
2205 Record.AddSourceLocation(
D->getRBraceLoc());
2211 Record.writeOMPChildren(
D->Data);
2217 Record.writeOMPChildren(
D->Data);
2223 Record.writeOMPChildren(
D->Data);
2230 "You need to update the serializer after you change the "
2231 "NumOMPDeclareReductionDeclBits");
2235 Record.AddStmt(
D->getCombinerIn());
2236 Record.AddStmt(
D->getCombinerOut());
2237 Record.AddStmt(
D->getCombiner());
2238 Record.AddStmt(
D->getInitOrig());
2239 Record.AddStmt(
D->getInitPriv());
2240 Record.AddStmt(
D->getInitializer());
2241 Record.push_back(llvm::to_underlying(
D->getInitializerKind()));
2242 Record.AddDeclRef(
D->getPrevDeclInScope());
2247 Record.writeOMPChildren(
D->Data);
2249 Record.AddDeclarationName(
D->getVarName());
2250 Record.AddDeclRef(
D->getPrevDeclInScope());
2264template <FunctionDecl::TemplatedKind Kind>
2265std::shared_ptr<llvm::BitCodeAbbrev>
2267 using namespace llvm;
2269 auto Abv = std::make_shared<BitCodeAbbrev>();
2270 Abv->Add(BitCodeAbbrevOp(Code));
2272 Abv->Add(BitCodeAbbrevOp(0));
2273 Abv->Add(BitCodeAbbrevOp(Kind));
2278 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2281 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2283 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2284 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2286 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2287 }
else if constexpr (
Kind ==
2289 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2290 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2292 Abv->Add(BitCodeAbbrevOp(1));
2295 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2296 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2297 Abv->Add(BitCodeAbbrevOp(0));
2298 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2299 Abv->Add(BitCodeAbbrevOp(0));
2301 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2305 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2306 Abv->Add(BitCodeAbbrevOp(0));
2308 llvm_unreachable(
"Unknown templated kind?");
2311 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2320 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2321 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2324 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2325 Abv->Add(BitCodeAbbrevOp(0));
2327 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2329 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2330 Abv->Add(BitCodeAbbrevOp(0));
2331 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2333 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2334 Abv->Add(BitCodeAbbrevOp(
2335 BitCodeAbbrevOp::Fixed,
2343 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2344 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2353 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2354 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2358template <FunctionDecl::TemplatedKind Kind>
2359std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() {
2364void ASTWriter::WriteDeclAbbrevs() {
2365 using namespace llvm;
2367 std::shared_ptr<BitCodeAbbrev> Abv;
2370 Abv = std::make_shared<BitCodeAbbrev>();
2373 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2381 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2382 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2384 Abv->Add(BitCodeAbbrevOp(0));
2385 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2386 Abv->Add(BitCodeAbbrevOp(0));
2388 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2390 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2391 Abv->Add(BitCodeAbbrevOp(0));
2392 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2394 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2395 Abv->Add(BitCodeAbbrevOp(0));
2397 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2398 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2399 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2402 Abv = std::make_shared<BitCodeAbbrev>();
2405 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2410 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2411 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2413 Abv->Add(BitCodeAbbrevOp(0));
2414 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2415 Abv->Add(BitCodeAbbrevOp(0));
2417 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2419 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2420 Abv->Add(BitCodeAbbrevOp(0));
2421 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2423 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2424 Abv->Add(BitCodeAbbrevOp(0));
2426 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2427 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2429 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2430 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2431 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2434 Abv = std::make_shared<BitCodeAbbrev>();
2437 Abv->Add(BitCodeAbbrevOp(0));
2439 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2447 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2448 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2450 Abv->Add(BitCodeAbbrevOp(0));
2451 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2452 Abv->Add(BitCodeAbbrevOp(0));
2454 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2455 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2457 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2458 Abv->Add(BitCodeAbbrevOp(
2459 BitCodeAbbrevOp::Fixed,
2463 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2464 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2466 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2467 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2468 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2469 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2470 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2471 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2473 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2474 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2475 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2476 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2477 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2480 Abv = std::make_shared<BitCodeAbbrev>();
2483 Abv->Add(BitCodeAbbrevOp(0));
2485 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2493 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2494 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2496 Abv->Add(BitCodeAbbrevOp(0));
2497 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2498 Abv->Add(BitCodeAbbrevOp(0));
2500 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2501 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2503 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2504 Abv->Add(BitCodeAbbrevOp(
2505 BitCodeAbbrevOp::Fixed,
2509 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2510 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2512 Abv->Add(BitCodeAbbrevOp(
2513 BitCodeAbbrevOp::Fixed,
2524 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2527 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2528 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2529 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2530 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2531 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2534 Abv = std::make_shared<BitCodeAbbrev>();
2537 Abv->Add(BitCodeAbbrevOp(0));
2539 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2545 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2546 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2548 Abv->Add(BitCodeAbbrevOp(0));
2549 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2550 Abv->Add(BitCodeAbbrevOp(0));
2552 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2554 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2555 Abv->Add(BitCodeAbbrevOp(0));
2556 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2559 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2562 Abv->Add(BitCodeAbbrevOp(0));
2564 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2565 Abv->Add(BitCodeAbbrevOp(
2566 BitCodeAbbrevOp::Fixed,
2571 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2572 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2573 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2576 Abv = std::make_shared<BitCodeAbbrev>();
2579 Abv->Add(BitCodeAbbrevOp(0));
2581 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2587 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2588 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2590 Abv->Add(BitCodeAbbrevOp(0));
2591 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2592 Abv->Add(BitCodeAbbrevOp(0));
2594 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2595 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2597 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2598 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2599 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2602 Abv = std::make_shared<BitCodeAbbrev>();
2605 Abv->Add(BitCodeAbbrevOp(0));
2607 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2612 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2613 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2615 Abv->Add(BitCodeAbbrevOp(0));
2616 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2617 Abv->Add(BitCodeAbbrevOp(0));
2619 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2621 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2622 Abv->Add(BitCodeAbbrevOp(0));
2623 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2625 Abv->Add(BitCodeAbbrevOp(
2626 BitCodeAbbrevOp::Fixed,
2634 Abv->Add(BitCodeAbbrevOp(0));
2636 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2637 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2638 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2641 DeclCXXMethodAbbrev =
2642 Stream.EmitAbbrev(getCXXMethodAbbrev<FunctionDecl::TK_NonTemplate>());
2643 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2644 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplate>());
2645 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2646 getCXXMethodAbbrev<FunctionDecl::TK_DependentNonTemplate>());
2647 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2648 getCXXMethodAbbrev<FunctionDecl::TK_MemberSpecialization>());
2649 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2650 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplateSpecialization>());
2651 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2656 Abv = std::make_shared<BitCodeAbbrev>();
2658 Abv->Add(BitCodeAbbrevOp(0));
2660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2666 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2667 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2669 Abv->Add(BitCodeAbbrevOp(0));
2670 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2671 Abv->Add(BitCodeAbbrevOp(0));
2673 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2674 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2677 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2678 Abv->Add(BitCodeAbbrevOp(0));
2679 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2682 Abv = std::make_shared<BitCodeAbbrev>();
2685 Abv->Add(BitCodeAbbrevOp(0));
2687 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2692 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2693 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2695 Abv->Add(BitCodeAbbrevOp(0));
2696 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2697 Abv->Add(BitCodeAbbrevOp(0));
2699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2700 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2701 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2704 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2707 Abv = std::make_shared<BitCodeAbbrev>();
2712 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2713 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2718 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2719 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2720 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2721 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2724 Abv = std::make_shared<BitCodeAbbrev>();
2729 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2730 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2733 Abv->Add(BitCodeAbbrevOp(32));
2734 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2735 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2738 Abv = std::make_shared<BitCodeAbbrev>();
2743 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2744 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2747 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2748 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2749 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2752 Abv = std::make_shared<BitCodeAbbrev>();
2757 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2758 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2760 Abv->Add(BitCodeAbbrevOp(0));
2762 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2764 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2767 Abv = std::make_shared<BitCodeAbbrev>();
2773 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2774 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2777 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2778 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2779 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2782 Abv = std::make_shared<BitCodeAbbrev>();
2788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2789 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2793 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2794 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2796 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2797 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2798 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2801 Abv = std::make_shared<BitCodeAbbrev>();
2806 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2807 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2809 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2810 Abv->Add(BitCodeAbbrevOp(0));
2811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2812 CallExprAbbrev = 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 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2828 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2830 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2833 Abv = std::make_shared<BitCodeAbbrev>();
2838 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2839 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2841 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2842 Abv->Add(BitCodeAbbrevOp(0));
2843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2845 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2848 Abv = std::make_shared<BitCodeAbbrev>();
2852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2853 Abv->Add(BitCodeAbbrevOp(0));
2854 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2856 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
2858 Abv = std::make_shared<BitCodeAbbrev>();
2860 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2861 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2863 Abv = std::make_shared<BitCodeAbbrev>();
2865 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2866 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2868 Abv = std::make_shared<BitCodeAbbrev>();
2870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2871 DeclModuleLocalVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2873 Abv = std::make_shared<BitCodeAbbrev>();
2875 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2876 DeclTULocalLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2878 Abv = std::make_shared<BitCodeAbbrev>();
2880 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2881 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2883 Abv = std::make_shared<BitCodeAbbrev>();
2885 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2886 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2911 if (isa<PragmaCommentDecl, PragmaDetectMismatchDecl>(
D))
2921 if (isa<FileScopeAsmDecl, TopLevelStmtDecl, ObjCImplDecl>(
D))
2939 assert(!
D->
isFromASTFile() &&
"should not be emitting imported decl");
2946 assert(ID >= FirstDeclID &&
"invalid decl ID");
2962 unsigned Index =
ID.getRawValue() - FirstDeclID.
getRawValue();
2963 if (DeclOffsets.size() == Index)
2964 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
2965 else if (DeclOffsets.size() < Index) {
2967 DeclOffsets.resize(Index+1);
2968 DeclOffsets[Index].setRawLoc(RawLoc);
2969 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
2971 llvm_unreachable(
"declarations should be emitted in ID order");
2976 associateDeclWithFile(
D, ID);
2989 bool ModulesCodegen =
false;
2991 std::optional<GVALinkage>
Linkage;
2992 if (Writer->WritingModule &&
2998 Linkage = getASTContext().GetGVALinkageForFunction(FD);
3002 (FD->
hasAttr<DLLExportAttr>() &&
3003 Writer->
getLangOpts().BuildingPCHWithObjectFile)) {
3007 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
3009 Linkage = getASTContext().GetGVALinkageForFunction(FD);
3015 Record->push_back(ModulesCodegen);
3017 Writer->
AddDeclRef(FD, Writer->ModularCodegenDecls);
3018 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
3019 Record->push_back(CD->getNumCtorInitializers());
3020 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)