24#include "llvm/Bitstream/BitstreamWriter.h"
25#include "llvm/Support/ErrorHandling.h"
27using namespace serialization;
37template <
typename DT>
bool isDefinitionInDependentContext(DT *
D) {
38 return D->isDependentContext() &&
D->isThisDeclarationADefinition();
55 bool GeneratingReducedBMI =
false;
61 Code((serialization::
DeclCode)0), AbbrevToUse(0),
62 GeneratingReducedBMI(GeneratingReducedBMI) {}
66 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
68 return Record.Emit(Code, AbbrevToUse);
190 for (
auto *typeParam : *typeParams) {
191 Record.AddDeclRef(typeParam);
200 const Decl *
D,
bool IncludeLocal,
201 llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
205 if (R->isFromASTFile())
207 else if (IncludeLocal)
216 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
219 for (
const auto &F : Firsts)
220 Record.AddDeclRef(F.second);
226 if (!GeneratingReducedBMI)
233 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(Spec))
234 Args = CTSD->getTemplateArgs().asArray();
235 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(Spec))
236 Args = VTSD->getTemplateArgs().asArray();
238 Args = cast<FunctionDecl>(Spec)
239 ->getTemplateSpecializationArgs()
246 switch (TA.getKind()) {
248 Linkage L = TA.getAsType()->getLinkage();
254 if (!TA.getAsDecl()->isExternallyVisible())
272 assert((isa<ClassTemplateSpecializationDecl>(
D) ||
273 isa<VarTemplateSpecializationDecl>(
D) || isa<FunctionDecl>(
D)) &&
274 "Must not be called with other decls");
275 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
278 for (
const auto &F : Firsts) {
284 PartialSpecsInMap.push_back(F.second);
286 SpecsInMap.push_back(F.second);
291 template <
typename EntryType>
300 return Common->PartialSpecializations;
307 template<
typename DeclTy>
309 auto *Common =
D->getCommonPtr();
314 if (Writer.Chain !=
Record.getASTContext().getExternalSource() &&
316 D->LoadLazySpecializations();
323 for (
auto &Entry : Common->Specializations)
330 for (
auto *
D : AllSpecs) {
335 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
339 if (isa<FunctionTemplateDecl>(
D)) {
340 assert(PartialSpecs.empty());
344 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
345 D, PartialSpecs,
true));
368 Writer.PartialSpecializationsUpdates[cast<NamedDecl>(
Template)]
371 Writer.SpecializationsUpdates[cast<NamedDecl>(
Template)].push_back(
395 (!VD->
hasAttr<DLLExportAttr>() ||
409 (FD->
hasAttr<DLLExportAttr>() &&
430 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
431 if (FD->isInlined() || FD->isConstexpr() || FD->isConsteval())
440 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
441 if (VD->getDeclContext()->isDependentContext())
447 if (VD->hasConstantInitialization() || VD->isConstexpr())
465 if (
auto *DD = dyn_cast<DeclaratorDecl>(
D)) {
466 if (
auto *TInfo = DD->getTypeSourceInfo())
467 Record.AddTypeLoc(TInfo->getTypeLoc());
473 if (
auto *FD = dyn_cast<FunctionDecl>(
D)) {
475 Record.push_back(FD->doesThisDeclarationHaveABody());
476 if (FD->doesThisDeclarationHaveABody())
477 Record.AddFunctionDefinition(FD);
486 if (
auto *VD = dyn_cast<VarDecl>(
D)) {
488 Record.AddVarDeclInit(VD);
495 if (
auto *FD = dyn_cast<FieldDecl>(
D)) {
496 if (FD->hasInClassInitializer()) {
497 if (
Expr *
Init = FD->getInClassInitializer()) {
510 if (
auto *DC = dyn_cast<DeclContext>(
D))
535 Record.push_back(DeclBits);
556 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
557 if (!NS->isFromASTFile())
559 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
560 if (!NS->isInlineNamespace())
562 DC = NS->getParent();
568 StringRef Arg =
D->getArg();
569 Record.push_back(Arg.size());
572 Record.push_back(
D->getCommentKind());
579 StringRef Name =
D->getName();
580 StringRef
Value =
D->getValue();
590 llvm_unreachable(
"Translation units aren't directly serialized");
595 Record.AddDeclarationName(
D->getDeclName());
604 if (!isa<TagDecl, TypedefDecl, TypeAliasDecl>(
D))
611 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
612 Record.push_back(
D->isModed());
614 Record.AddTypeRef(
D->getUnderlyingType());
615 Record.AddDeclRef(
D->getAnonDeclWithTypedefName(
false));
636 Record.AddDeclRef(
D->getDescribedAliasTemplate());
642 "You need to update the serializer after you change the "
650 TagDeclBits.
addBits(llvm::to_underlying(
D->getTagKind()), 3);
651 TagDeclBits.
addBit(!isa<CXXRecordDecl>(
D) ?
D->isCompleteDefinition() : 0);
652 TagDeclBits.
addBit(
D->isEmbeddedInDeclarator());
653 TagDeclBits.
addBit(
D->isFreeStanding());
654 TagDeclBits.
addBit(
D->isCompleteDefinitionRequired());
656 D->hasExtInfo() ? 1 : (
D->getTypedefNameForAnonDecl() ? 2 : 0),
658 Record.push_back(TagDeclBits);
660 Record.AddSourceRange(
D->getBraceRange());
662 if (
D->hasExtInfo()) {
663 Record.AddQualifierInfo(*
D->getExtInfo());
664 }
else if (
auto *TD =
D->getTypedefNameForAnonDecl()) {
666 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
672 "You need to update the serializer after you change the "
676 Record.AddTypeSourceInfo(
D->getIntegerTypeSourceInfo());
677 if (!
D->getIntegerTypeSourceInfo())
678 Record.AddTypeRef(
D->getIntegerType());
679 Record.AddTypeRef(
D->getPromotionType());
682 EnumDeclBits.
addBits(
D->getNumPositiveBits(), 8);
683 EnumDeclBits.
addBits(
D->getNumNegativeBits(), 8);
684 EnumDeclBits.
addBit(
D->isScoped());
685 EnumDeclBits.
addBit(
D->isScopedUsingClassTag());
686 EnumDeclBits.
addBit(
D->isFixed());
687 Record.push_back(EnumDeclBits);
689 Record.push_back(
D->getODRHash());
692 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
693 Record.push_back(MemberInfo->getTemplateSpecializationKind());
694 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
696 Record.AddDeclRef(
nullptr);
701 !
D->getTypedefNameForAnonDecl() &&
705 !
D->getIntegerTypeSourceInfo() && !
D->getMemberSpecializationInfo() &&
715 "You need to update the serializer after you change the "
721 RecordDeclBits.
addBit(
D->hasFlexibleArrayMember());
722 RecordDeclBits.
addBit(
D->isAnonymousStructOrUnion());
723 RecordDeclBits.
addBit(
D->hasObjectMember());
724 RecordDeclBits.
addBit(
D->hasVolatileMember());
725 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDefaultInitialize());
726 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveCopy());
727 RecordDeclBits.
addBit(
D->isNonTrivialToPrimitiveDestroy());
728 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDefaultInitializeCUnion());
729 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveDestructCUnion());
730 RecordDeclBits.
addBit(
D->hasNonTrivialToPrimitiveCopyCUnion());
731 RecordDeclBits.
addBit(
D->hasUninitializedExplicitInitFields());
732 RecordDeclBits.
addBit(
D->isParamDestroyedInCallee());
733 RecordDeclBits.
addBits(llvm::to_underlying(
D->getArgPassingRestrictions()), 2);
734 Record.push_back(RecordDeclBits);
738 if (!isa<CXXRecordDecl>(
D))
739 Record.push_back(
D->getODRHash());
743 !
D->getTypedefNameForAnonDecl() &&
756 Record.AddTypeRef(
D->getType());
761 Record.push_back(
D->getInitExpr()? 1 : 0);
762 if (
D->getInitExpr())
763 Record.AddStmt(
D->getInitExpr());
764 Record.AddAPSInt(
D->getInitVal());
771 Record.AddSourceLocation(
D->getInnerLocStart());
772 Record.push_back(
D->hasExtInfo());
773 if (
D->hasExtInfo()) {
774 DeclaratorDecl::ExtInfo *Info =
D->getExtInfo();
775 Record.AddQualifierInfo(*Info);
777 const_cast<Expr *
>(Info->TrailingRequiresClause.ConstraintExpr));
778 Record.writeUnsignedOrNone(Info->TrailingRequiresClause.ArgPackSubstIndex);
781 Record.AddTypeRef(
D->getTypeSourceInfo() ?
D->getTypeSourceInfo()->getType()
787 "You need to update the serializer after you change the "
792 Record.push_back(
D->getTemplatedKind());
793 switch (
D->getTemplatedKind()) {
797 Record.AddDeclRef(
D->getInstantiatedFromDecl());
800 Record.AddDeclRef(
D->getDescribedFunctionTemplate());
811 FTSInfo =
D->getTemplateSpecializationInfo();
824 Record.AddASTTemplateArgumentListInfo(
832 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
833 Record.push_back(MemberInfo->getTemplateSpecializationKind());
834 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
848 DFTSInfo =
D->getDependentSpecializationInfo();
858 Record.AddASTTemplateArgumentListInfo(
865 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
873 FunctionDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()), 3);
874 FunctionDeclBits.
addBits((uint32_t)
D->getStorageClass(), 3);
875 FunctionDeclBits.
addBit(
D->isInlineSpecified());
876 FunctionDeclBits.
addBit(
D->isInlined());
877 FunctionDeclBits.
addBit(
D->hasSkippedBody());
878 FunctionDeclBits.
addBit(
D->isVirtualAsWritten());
879 FunctionDeclBits.
addBit(
D->isPureVirtual());
880 FunctionDeclBits.
addBit(
D->hasInheritedPrototype());
881 FunctionDeclBits.
addBit(
D->hasWrittenPrototype());
882 FunctionDeclBits.
addBit(
D->isDeletedBit());
883 FunctionDeclBits.
addBit(
D->isTrivial());
884 FunctionDeclBits.
addBit(
D->isTrivialForCall());
885 FunctionDeclBits.
addBit(
D->isDefaulted());
886 FunctionDeclBits.
addBit(
D->isExplicitlyDefaulted());
887 FunctionDeclBits.
addBit(
D->isIneligibleOrNotSelected());
888 FunctionDeclBits.
addBits((uint64_t)(
D->getConstexprKind()), 2);
889 FunctionDeclBits.
addBit(
D->hasImplicitReturnZero());
890 FunctionDeclBits.
addBit(
D->isMultiVersion());
891 FunctionDeclBits.
addBit(
D->isLateTemplateParsed());
892 FunctionDeclBits.
addBit(
D->isInstantiatedFromMemberTemplate());
893 FunctionDeclBits.
addBit(
D->FriendConstraintRefersToEnclosingTemplate());
894 FunctionDeclBits.
addBit(
D->usesSEHTry());
895 FunctionDeclBits.
addBit(
D->isDestroyingOperatorDelete());
896 FunctionDeclBits.
addBit(
D->isTypeAwareOperatorNewOrDelete());
897 Record.push_back(FunctionDeclBits);
900 if (
D->isExplicitlyDefaulted())
901 Record.AddSourceLocation(
D->getDefaultLoc());
903 Record.push_back(
D->getODRHash());
905 if (
D->isDefaulted() ||
D->isDeletedAsWritten()) {
906 if (
auto *FDI =
D->getDefalutedOrDeletedInfo()) {
910 Record.push_back(1 | (DeletedMessage ? 2 : 0));
912 Record.AddStmt(DeletedMessage);
914 Record.push_back(FDI->getUnqualifiedLookups().size());
916 Record.AddDeclRef(
P.getDecl());
917 Record.push_back(
P.getAccess());
928 if (
auto *RD = dyn_cast<CXXRecordDecl>(
D->getLexicalParent());
929 RD && isDefinitionInDependentContext(RD)) {
930 Writer.RelatedDeclsMap[Writer.
GetDeclRef(RD)].push_back(
935 Record.push_back(
D->param_size());
936 for (
auto *
P :
D->parameters())
943 uint64_t Kind =
static_cast<uint64_t
>(ES.
getKind());
944 Kind = Kind << 1 | static_cast<bool>(ES.
getExpr());
955 Record.push_back(
static_cast<unsigned char>(
D->getDeductionCandidateKind()));
956 Record.AddDeclRef(
D->getSourceDeductionGuide());
958 static_cast<unsigned char>(
D->getSourceDeductionGuideKind()));
964 "You need to update the serializer after you change the "
965 "ObjCMethodDeclBits");
970 bool HasBodyStuff =
D->
getBody() !=
nullptr;
971 Record.push_back(HasBodyStuff);
975 Record.AddDeclRef(
D->getSelfDecl());
976 Record.AddDeclRef(
D->getCmdDecl());
977 Record.push_back(
D->isInstanceMethod());
978 Record.push_back(
D->isVariadic());
979 Record.push_back(
D->isPropertyAccessor());
980 Record.push_back(
D->isSynthesizedAccessorStub());
981 Record.push_back(
D->isDefined());
982 Record.push_back(
D->isOverriding());
983 Record.push_back(
D->hasSkippedBody());
985 Record.push_back(
D->isRedeclaration());
986 Record.push_back(
D->hasRedeclaration());
987 if (
D->hasRedeclaration()) {
988 assert(
Record.getASTContext().getObjCMethodRedeclaration(
D));
989 Record.AddDeclRef(
Record.getASTContext().getObjCMethodRedeclaration(
D));
993 Record.push_back(llvm::to_underlying(
D->getImplementationControl()));
995 Record.push_back(
D->getObjCDeclQualifier());
996 Record.push_back(
D->hasRelatedResultType());
997 Record.AddTypeRef(
D->getReturnType());
998 Record.AddTypeSourceInfo(
D->getReturnTypeSourceInfo());
1000 Record.push_back(
D->param_size());
1001 for (
const auto *
P :
D->parameters())
1004 Record.push_back(
D->getSelLocsKind());
1005 unsigned NumStoredSelLocs =
D->getNumStoredSelLocs();
1007 Record.push_back(NumStoredSelLocs);
1008 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
1009 Record.AddSourceLocation(SelLocs[i]);
1016 Record.push_back(
D->Variance);
1018 Record.AddSourceLocation(
D->VarianceLoc);
1019 Record.AddSourceLocation(
D->ColonLoc);
1026 "You need to update the serializer after you change the "
1027 "ObjCContainerDeclBits");
1030 Record.AddSourceLocation(
D->getAtStartLoc());
1031 Record.AddSourceRange(
D->getAtEndRange());
1041 Record.push_back(
D->isThisDeclarationADefinition());
1042 if (
D->isThisDeclarationADefinition()) {
1044 ObjCInterfaceDecl::DefinitionData &
Data =
D->data();
1046 Record.AddTypeSourceInfo(
D->getSuperClassTInfo());
1047 Record.AddSourceLocation(
D->getEndOfDefinitionLoc());
1048 Record.push_back(
Data.HasDesignatedInitializers);
1049 Record.push_back(
D->getODRHash());
1052 Record.push_back(
Data.ReferencedProtocols.size());
1053 for (
const auto *
P :
D->protocols())
1055 for (
const auto &PL :
D->protocol_locs())
1056 Record.AddSourceLocation(PL);
1059 Record.push_back(
Data.AllReferencedProtocols.size());
1061 P =
Data.AllReferencedProtocols.begin(),
1062 PEnd =
Data.AllReferencedProtocols.end();
1069 Writer.ObjCClassesWithCategories.insert(
D);
1072 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
1083 Record.push_back(
D->getAccessControl());
1084 Record.push_back(
D->getSynthesize());
1093 !
D->getBitWidth() &&
1105 Record.push_back(
D->isThisDeclarationADefinition());
1106 if (
D->isThisDeclarationADefinition()) {
1107 Record.push_back(
D->protocol_size());
1108 for (
const auto *I :
D->protocols())
1110 for (
const auto &PL :
D->protocol_locs())
1111 Record.AddSourceLocation(PL);
1112 Record.push_back(
D->getODRHash());
1125 Record.AddSourceLocation(
D->getCategoryNameLoc());
1126 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1127 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1128 Record.AddDeclRef(
D->getClassInterface());
1130 Record.push_back(
D->protocol_size());
1131 for (
const auto *I :
D->protocols())
1133 for (
const auto &PL :
D->protocol_locs())
1134 Record.AddSourceLocation(PL);
1140 Record.AddDeclRef(
D->getClassInterface());
1146 Record.AddSourceLocation(
D->getAtLoc());
1147 Record.AddSourceLocation(
D->getLParenLoc());
1148 Record.AddTypeRef(
D->getType());
1149 Record.AddTypeSourceInfo(
D->getTypeSourceInfo());
1151 Record.push_back((
unsigned)
D->getPropertyAttributes());
1152 Record.push_back((
unsigned)
D->getPropertyAttributesAsWritten());
1154 Record.push_back((
unsigned)
D->getPropertyImplementation());
1155 Record.AddDeclarationName(
D->getGetterName());
1156 Record.AddSourceLocation(
D->getGetterNameLoc());
1157 Record.AddDeclarationName(
D->getSetterName());
1158 Record.AddSourceLocation(
D->getSetterNameLoc());
1159 Record.AddDeclRef(
D->getGetterMethodDecl());
1160 Record.AddDeclRef(
D->getSetterMethodDecl());
1161 Record.AddDeclRef(
D->getPropertyIvarDecl());
1167 Record.AddDeclRef(
D->getClassInterface());
1173 Record.AddSourceLocation(
D->getCategoryNameLoc());
1179 Record.AddDeclRef(
D->getSuperClass());
1180 Record.AddSourceLocation(
D->getSuperClassLoc());
1181 Record.AddSourceLocation(
D->getIvarLBraceLoc());
1182 Record.AddSourceLocation(
D->getIvarRBraceLoc());
1183 Record.push_back(
D->hasNonZeroConstructors());
1184 Record.push_back(
D->hasDestructors());
1185 Record.push_back(
D->NumIvarInitializers);
1186 if (
D->NumIvarInitializers)
1187 Record.AddCXXCtorInitializers(
1195 Record.AddDeclRef(
D->getPropertyDecl());
1196 Record.AddDeclRef(
D->getPropertyIvarDecl());
1197 Record.AddSourceLocation(
D->getPropertyIvarDeclLoc());
1198 Record.AddDeclRef(
D->getGetterMethodDecl());
1199 Record.AddDeclRef(
D->getSetterMethodDecl());
1200 Record.AddStmt(
D->getGetterCXXConstructor());
1201 Record.AddStmt(
D->getSetterCXXAssignment());
1207 Record.push_back(
D->isMutable());
1209 Record.push_back((
D->StorageKind << 1) |
D->BitField);
1210 if (
D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1212 else if (
D->BitField)
1213 Record.AddStmt(
D->getBitWidth());
1215 if (!
D->getDeclName() ||
D->isPlaceholderVar(Writer.
getLangOpts()))
1217 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(
D));
1227 !
D->getBitWidth() &&
1228 !
D->hasInClassInitializer() &&
1229 !
D->hasCapturedVLAType() &&
1241 Record.AddIdentifierRef(
D->getGetterId());
1242 Record.AddIdentifierRef(
D->getSetterId());
1259 Record.AddAPValue(
D->getValue());
1265 Record.AddAPValue(
D->getValue());
1271 Record.push_back(
D->getChainingSize());
1273 for (
const auto *
P :
D->chain())
1286 VarDeclBits.
addBits(llvm::to_underlying(
D->getLinkageInternal()),
1290 VarDeclBits.
addBit(ModulesCodegen);
1292 VarDeclBits.
addBits(
D->getStorageClass(), 3);
1293 VarDeclBits.
addBits(
D->getTSCSpec(), 2);
1294 VarDeclBits.
addBits(
D->getInitStyle(), 2);
1295 VarDeclBits.
addBit(
D->isARCPseudoStrong());
1297 bool HasDeducedType =
false;
1298 if (!isa<ParmVarDecl>(
D)) {
1299 VarDeclBits.
addBit(
D->isThisDeclarationADemotedDefinition());
1300 VarDeclBits.
addBit(
D->isExceptionVariable());
1301 VarDeclBits.
addBit(
D->isNRVOVariable());
1302 VarDeclBits.
addBit(
D->isCXXForRangeDecl());
1304 VarDeclBits.
addBit(
D->isInline());
1305 VarDeclBits.
addBit(
D->isInlineSpecified());
1306 VarDeclBits.
addBit(
D->isConstexpr());
1307 VarDeclBits.
addBit(
D->isInitCapture());
1308 VarDeclBits.
addBit(
D->isPreviousDeclInSameBlockScope());
1310 VarDeclBits.
addBit(
D->isEscapingByref());
1311 HasDeducedType =
D->getType()->getContainedDeducedType();
1312 VarDeclBits.
addBit(HasDeducedType);
1314 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(
D))
1315 VarDeclBits.
addBits(llvm::to_underlying(IPD->getParameterKind()),
1320 VarDeclBits.
addBit(
D->isObjCForDecl());
1321 VarDeclBits.
addBit(
D->isCXXForRangeImplicitVar());
1324 Record.push_back(VarDeclBits);
1332 if (
Init.getCopyExpr())
1337 VarNotTemplate = 0,
VarTemplate, StaticDataMemberSpecialization
1341 Record.AddDeclRef(TemplD);
1343 =
D->getMemberSpecializationInfo()) {
1344 Record.push_back(StaticDataMemberSpecialization);
1345 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1346 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1347 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1349 Record.push_back(VarNotTemplate);
1357 D->
getKind() == Decl::Var && !
D->isInline() && !
D->isConstexpr() &&
1358 !
D->isInitCapture() && !
D->isPreviousDeclInSameBlockScope() &&
1359 !
D->hasInitWithSideEffects() && !
D->isEscapingByref() &&
1360 !HasDeducedType &&
D->getStorageDuration() !=
SD_Static &&
1361 !
D->getDescribedVarTemplate() && !
D->getMemberSpecializationInfo() &&
1362 !
D->isObjCForDecl() && !isa<ImplicitParamDecl>(
D) &&
1363 !
D->isEscapingByref())
1380 Record.push_back(
D->getFunctionScopeIndex());
1383 ParmVarDeclBits.
addBit(
D->isObjCMethodParameter());
1384 ParmVarDeclBits.
addBits(
D->getFunctionScopeDepth(), 7);
1386 ParmVarDeclBits.
addBits(
D->getObjCDeclQualifier(), 7);
1387 ParmVarDeclBits.
addBit(
D->isKNRPromoted());
1388 ParmVarDeclBits.
addBit(
D->hasInheritedDefaultArg());
1389 ParmVarDeclBits.
addBit(
D->hasUninstantiatedDefaultArg());
1390 ParmVarDeclBits.
addBit(
D->getExplicitObjectParamThisLoc().isValid());
1391 Record.push_back(ParmVarDeclBits);
1393 if (
D->hasUninstantiatedDefaultArg())
1394 Record.AddStmt(
D->getUninstantiatedDefaultArg());
1395 if (
D->getExplicitObjectParamThisLoc().isValid())
1396 Record.AddSourceLocation(
D->getExplicitObjectParamThisLoc());
1406 D->getInit() ==
nullptr)
1411 assert(!
D->getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1412 assert(!
D->isThisDeclarationADemotedDefinition()
1413 &&
"PARM_VAR_DECL can't be demoted definition.");
1415 assert(!
D->isExceptionVariable() &&
"PARM_VAR_DECL can't be exception var");
1416 assert(
D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1417 assert(!
D->isStaticDataMember() &&
1418 "PARM_VAR_DECL can't be static data member");
1423 Record.push_back(
D->bindings().size());
1426 for (
auto *B :
D->bindings())
1433 Record.AddStmt(
D->getBinding());
1439 Record.AddStmt(
D->getAsmStringExpr());
1440 Record.AddSourceLocation(
D->getRParenLoc());
1458 Record.AddDeclRef(
D->getExtendingDecl());
1459 Record.AddStmt(
D->getTemporaryExpr());
1460 Record.push_back(
static_cast<bool>(
D->getValue()));
1462 Record.AddAPValue(*
D->getValue());
1463 Record.push_back(
D->getManglingNumber());
1469 Record.AddTypeSourceInfo(
D->getSignatureAsWritten());
1470 Record.push_back(
D->param_size());
1473 Record.push_back(
D->isVariadic());
1474 Record.push_back(
D->blockMissingReturnType());
1475 Record.push_back(
D->isConversionFromLambda());
1476 Record.push_back(
D->doesNotEscape());
1477 Record.push_back(
D->canAvoidCopyToHeap());
1478 Record.push_back(
D->capturesCXXThis());
1479 Record.push_back(
D->getNumCaptures());
1480 for (
const auto &capture :
D->captures()) {
1481 Record.AddDeclRef(capture.getVariable());
1484 if (capture.isByRef()) flags |= 1;
1485 if (capture.isNested()) flags |= 2;
1486 if (capture.hasCopyExpr()) flags |= 4;
1489 if (capture.hasCopyExpr())
Record.AddStmt(capture.getCopyExpr());
1496 Record.push_back(
D->getNumParams());
1498 for (
unsigned I = 0; I <
D->getNumParams(); ++I)
1499 Record.AddDeclRef(
D->getParam(I));
1500 Record.push_back(
D->isNothrow() ? 1 : 0);
1518 "You need to update the serializer after you change the"
1519 "LinkageSpecDeclBits");
1522 Record.push_back(llvm::to_underlying(
D->getLanguage()));
1523 Record.AddSourceLocation(
D->getExternLoc());
1524 Record.AddSourceLocation(
D->getRBraceLoc());
1530 Record.AddSourceLocation(
D->getRBraceLoc());
1546 NamespaceDeclBits.
addBit(
D->isInline());
1547 NamespaceDeclBits.
addBit(
D->isNested());
1548 Record.push_back(NamespaceDeclBits);
1551 Record.AddSourceLocation(
D->getRBraceLoc());
1554 Record.AddDeclRef(
D->getAnonymousNamespace());
1557 if (Writer.
hasChain() &&
D->isAnonymousNamespace() &&
1564 D->getParent()->getRedeclContext()->getPrimaryContext());
1565 if (
Parent->isFromASTFile() || isa<TranslationUnitDecl>(
Parent)) {
1566 Writer.DeclUpdates[
Parent].push_back(
1567 ASTWriter::DeclUpdate(DeclUpdateKind::CXXAddedAnonymousNamespace,
D));
1575 Record.AddSourceLocation(
D->getNamespaceLoc());
1576 Record.AddSourceLocation(
D->getTargetNameLoc());
1577 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1578 Record.AddDeclRef(
D->getNamespace());
1584 Record.AddSourceLocation(
D->getUsingLoc());
1585 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1586 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1587 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1588 Record.push_back(
D->hasTypename());
1589 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingDecl(
D));
1595 Record.AddSourceLocation(
D->getUsingLoc());
1596 Record.AddSourceLocation(
D->getEnumLoc());
1597 Record.AddTypeSourceInfo(
D->getEnumType());
1598 Record.AddDeclRef(
D->FirstUsingShadow.getPointer());
1599 Record.AddDeclRef(
Record.getASTContext().getInstantiatedFromUsingEnumDecl(
D));
1604 Record.push_back(
D->NumExpansions);
1606 Record.AddDeclRef(
D->getInstantiatedFromUsingDecl());
1607 for (
auto *
E :
D->expansions())
1615 Record.AddDeclRef(
D->getTargetDecl());
1617 Record.AddDeclRef(
D->UsingOrNextShadow);
1619 Record.getASTContext().getInstantiatedFromUsingShadowDecl(
D));
1633 Record.AddDeclRef(
D->NominatedBaseClassShadowDecl);
1634 Record.AddDeclRef(
D->ConstructedBaseClassShadowDecl);
1635 Record.push_back(
D->IsVirtual);
1641 Record.AddSourceLocation(
D->getUsingLoc());
1642 Record.AddSourceLocation(
D->getNamespaceKeyLocation());
1643 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1644 Record.AddDeclRef(
D->getNominatedNamespace());
1645 Record.AddDeclRef(dyn_cast<Decl>(
D->getCommonAncestor()));
1651 Record.AddSourceLocation(
D->getUsingLoc());
1652 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1653 Record.AddDeclarationNameLoc(
D->DNLoc,
D->getDeclName());
1654 Record.AddSourceLocation(
D->getEllipsisLoc());
1661 Record.AddSourceLocation(
D->getTypenameLoc());
1662 Record.AddNestedNameSpecifierLoc(
D->getQualifierLoc());
1663 Record.AddSourceLocation(
D->getEllipsisLoc());
1677 CXXRecNotTemplate = 0,
1679 CXXRecMemberSpecialization,
1683 Record.push_back(CXXRecTemplate);
1684 Record.AddDeclRef(TemplD);
1686 =
D->getMemberSpecializationInfo()) {
1687 Record.push_back(CXXRecMemberSpecialization);
1688 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1689 Record.push_back(MSInfo->getTemplateSpecializationKind());
1690 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1691 }
else if (
D->isLambda()) {
1693 Record.push_back(CXXLambda);
1694 if (
auto *Context =
D->getLambdaContextDecl()) {
1695 Record.AddDeclRef(Context);
1696 Record.push_back(
D->getLambdaIndexInContext());
1702 if (
auto *FD = llvm::dyn_cast_or_null<FunctionDecl>(
D->
getDeclContext());
1703 FD && isDefinitionInDependentContext(FD)) {
1704 Writer.RelatedDeclsMap[Writer.
GetDeclRef(FD)].push_back(
1708 Record.push_back(CXXRecNotTemplate);
1711 Record.push_back(
D->isThisDeclarationADefinition());
1712 if (
D->isThisDeclarationADefinition())
1713 Record.AddCXXDefinitionData(
D);
1723 if (
D->isCompleteDefinition())
1724 Record.AddDeclRef(
Record.getASTContext().getCurrentKeyFunction(
D));
1732 Record.push_back(
D->size_overridden_methods());
1744 !
D->hasExtInfo() && !
D->isExplicitlyDefaulted()) {
1750 else if (
D->getTemplatedKind() ==
1753 D->getTemplateSpecializationInfo();
1762 }
else if (
D->getTemplatedKind() ==
1765 D->getDependentSpecializationInfo();
1776 "You need to update the serializer after you change the "
1777 "CXXConstructorDeclBits");
1779 Record.push_back(
D->getTrailingAllocKind());
1781 if (
auto Inherited =
D->getInheritedConstructor()) {
1782 Record.AddDeclRef(Inherited.getShadowDecl());
1783 Record.AddDeclRef(Inherited.getConstructor());
1793 Record.AddDeclRef(
D->getOperatorDelete());
1794 if (
D->getOperatorDelete())
1795 Record.AddStmt(
D->getOperatorDeleteThisArg());
1808 Record.push_back(Writer.getSubmoduleID(
D->getImportedModule()));
1810 Record.push_back(!IdentifierLocs.empty());
1811 if (IdentifierLocs.empty()) {
1815 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1816 Record.AddSourceLocation(IdentifierLocs[I]);
1817 Record.push_back(IdentifierLocs.size());
1826 Record.AddSourceLocation(
D->getColonLoc());
1833 Record.push_back(
D->NumTPLists);
1835 bool hasFriendDecl = isa<NamedDecl *>(
D->Friend);
1836 Record.push_back(hasFriendDecl);
1838 Record.AddDeclRef(
D->getFriendDecl());
1840 Record.AddTypeSourceInfo(
D->getFriendType());
1841 for (
unsigned i = 0; i <
D->NumTPLists; ++i)
1842 Record.AddTemplateParameterList(
D->getFriendTypeTemplateParameterList(i));
1843 Record.AddDeclRef(
D->getNextFriend());
1844 Record.push_back(
D->UnsupportedFriend);
1845 Record.AddSourceLocation(
D->FriendLoc);
1846 Record.AddSourceLocation(
D->EllipsisLoc);
1852 Record.push_back(
D->getNumTemplateParameters());
1853 for (
unsigned i = 0, e =
D->getNumTemplateParameters(); i != e; ++i)
1854 Record.AddTemplateParameterList(
D->getTemplateParameterList(i));
1855 Record.push_back(
D->getFriendDecl() !=
nullptr);
1856 if (
D->getFriendDecl())
1857 Record.AddDeclRef(
D->getFriendDecl());
1859 Record.AddTypeSourceInfo(
D->getFriendType());
1860 Record.AddSourceLocation(
D->getFriendLoc());
1867 Record.AddTemplateParameterList(
D->getTemplateParameters());
1868 Record.AddDeclRef(
D->getTemplatedDecl());
1873 Record.AddStmt(
D->getConstraintExpr());
1879 Record.push_back(
D->getTemplateArguments().size());
1882 Record.AddTemplateArgument(Arg);
1897 Record.AddDeclRef(
D->getInstantiatedFromMemberTemplate());
1898 if (
D->getInstantiatedFromMemberTemplate())
1899 Record.push_back(
D->isMemberSpecialization());
1916 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
D);
1932 =
D->getSpecializedTemplateOrPartial();
1934 Record.AddDeclRef(InstFromD);
1936 Record.AddDeclRef(cast<ClassTemplatePartialSpecializationDecl *>(InstFrom));
1937 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
1940 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
1941 Record.AddSourceLocation(
D->getPointOfInstantiation());
1942 Record.push_back(
D->getSpecializationKind());
1943 Record.push_back(
D->hasStrictPackMatch());
1952 D->getTemplateSpecializationKind() ==
1957 Record.AddSourceLocation(
D->getExternKeywordLoc());
1958 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
1962 D->getTemplateArgsAsWritten();
1963 Record.push_back(!!ArgsWritten);
1965 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1974 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
1975 D->getSpecializedTemplate());
1985 Record.AddTemplateParameterList(
D->getTemplateParameters());
1991 Record.AddDeclRef(
D->getInstantiatedFromMember());
1992 Record.push_back(
D->isMemberSpecialization());
2010 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
2011 InstFrom =
D->getSpecializedTemplateOrPartial();
2013 Record.AddDeclRef(InstFromD);
2015 Record.AddDeclRef(cast<VarTemplatePartialSpecializationDecl *>(InstFrom));
2016 Record.AddTemplateArgumentList(&
D->getTemplateInstantiationArgs());
2020 D->getTemplateSpecializationKind() ==
2025 Record.AddSourceLocation(
D->getExternKeywordLoc());
2026 Record.AddSourceLocation(
D->getTemplateKeywordLoc());
2030 D->getTemplateArgsAsWritten();
2031 Record.push_back(!!ArgsWritten);
2033 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
2035 Record.AddTemplateArgumentList(&
D->getTemplateArgs());
2036 Record.AddSourceLocation(
D->getPointOfInstantiation());
2037 Record.push_back(
D->getSpecializationKind());
2038 Record.push_back(
D->IsCompleteDefinition);
2054 Record.AddTemplateParameterList(
D->getTemplateParameters());
2060 Record.AddDeclRef(
D->getInstantiatedFromMember());
2061 Record.push_back(
D->isMemberSpecialization());
2076 Record.push_back(
D->hasTypeConstraint());
2079 Record.push_back(
D->wasDeclaredWithTypename());
2082 if (
D->hasTypeConstraint())
2083 Record.push_back(TC !=
nullptr);
2086 Record.push_back(CR !=
nullptr);
2088 Record.AddConceptReference(CR);
2091 Record.writeUnsignedOrNone(
D->getNumExpansionParameters());
2094 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2095 !
D->defaultArgumentWasInherited();
2096 Record.push_back(OwnsDefaultArg);
2098 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2100 if (!
D->hasTypeConstraint() && !OwnsDefaultArg &&
2114 Record.push_back(
D->hasPlaceholderTypeConstraint());
2115 if (
D->isExpandedParameterPack())
2116 Record.push_back(
D->getNumExpansionTypes());
2120 Record.push_back(
D->getDepth());
2121 Record.push_back(
D->getPosition());
2123 if (
D->hasPlaceholderTypeConstraint())
2124 Record.AddStmt(
D->getPlaceholderTypeConstraint());
2126 if (
D->isExpandedParameterPack()) {
2127 for (
unsigned I = 0, N =
D->getNumExpansionTypes(); I != N; ++I) {
2128 Record.AddTypeRef(
D->getExpansionType(I));
2129 Record.AddTypeSourceInfo(
D->getExpansionTypeSourceInfo(I));
2136 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2137 !
D->defaultArgumentWasInherited();
2138 Record.push_back(OwnsDefaultArg);
2140 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2149 if (
D->isExpandedParameterPack())
2150 Record.push_back(
D->getNumExpansionTemplateParameters());
2153 Record.push_back(
D->templateParameterKind());
2154 Record.push_back(
D->wasDeclaredWithTypename());
2156 Record.push_back(
D->getDepth());
2157 Record.push_back(
D->getPosition());
2159 if (
D->isExpandedParameterPack()) {
2160 for (
unsigned I = 0, N =
D->getNumExpansionTemplateParameters();
2162 Record.AddTemplateParameterList(
D->getExpansionTemplateParameters(I));
2167 bool OwnsDefaultArg =
D->hasDefaultArgument() &&
2168 !
D->defaultArgumentWasInherited();
2169 Record.push_back(OwnsDefaultArg);
2171 Record.AddTemplateArgumentLoc(
D->getDefaultArgument());
2183 Record.AddStmt(
D->getAssertExpr());
2184 Record.push_back(
D->isFailed());
2185 Record.AddStmt(
D->getMessage());
2186 Record.AddSourceLocation(
D->getRParenLoc());
2193 "You need to update the serializer after you change the "
2198 cast<NamespaceDecl>(DC)->isFromExplicitGlobalModule()) {
2202 Writer.DelayedNamespace.push_back(cast<NamespaceDecl>(DC));
2205 Writer.WriteDeclContextLexicalBlock(
Record.getASTContext(), DC);
2206 Writer.WriteDeclContextVisibleBlock(
Record.getASTContext(), DC, Offsets);
2209 Record.AddLookupOffsets(Offsets);
2213 assert(
IsLocalDecl(
D) &&
"expected a local declaration");
2219 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2226 return CacheEntry =
D;
2229template <
typename T>
2232 T *MostRecent =
First->getMostRecentDecl();
2233 T *DAsT =
static_cast<T *
>(
D);
2234 if (MostRecent !=
First) {
2236 "Not considered redeclarable?");
2243 if (DAsT == FirstLocal) {
2247 unsigned I =
Record.size();
2260 if (!Prev->isFromASTFile())
2265 if (LocalRedecls.empty())
2271 Record.AddDeclRef(FirstLocal);
2291 Record.push_back(
D->isCBuffer());
2292 Record.AddSourceLocation(
D->getLocStart());
2293 Record.AddSourceLocation(
D->getLBraceLoc());
2294 Record.AddSourceLocation(
D->getRBraceLoc());
2300 Record.writeOMPChildren(
D->Data);
2306 Record.writeOMPChildren(
D->Data);
2312 Record.writeOMPChildren(
D->Data);
2319 "You need to update the serializer after you change the "
2320 "NumOMPDeclareReductionDeclBits");
2324 Record.AddStmt(
D->getCombinerIn());
2325 Record.AddStmt(
D->getCombinerOut());
2326 Record.AddStmt(
D->getCombiner());
2327 Record.AddStmt(
D->getInitOrig());
2328 Record.AddStmt(
D->getInitPriv());
2329 Record.AddStmt(
D->getInitializer());
2330 Record.push_back(llvm::to_underlying(
D->getInitializerKind()));
2331 Record.AddDeclRef(
D->getPrevDeclInScope());
2336 Record.writeOMPChildren(
D->Data);
2338 Record.AddDeclarationName(
D->getVarName());
2339 Record.AddDeclRef(
D->getPrevDeclInScope());
2349 Record.writeUInt32(
D->clauses().size());
2352 Record.AddSourceLocation(
D->DirectiveLoc);
2353 Record.AddSourceLocation(
D->EndLoc);
2354 Record.writeOpenACCClauseList(
D->clauses());
2358 Record.writeUInt32(
D->clauses().size());
2361 Record.AddSourceLocation(
D->DirectiveLoc);
2362 Record.AddSourceLocation(
D->EndLoc);
2363 Record.AddSourceRange(
D->ParensLoc);
2365 Record.writeOpenACCClauseList(
D->clauses());
2374template <FunctionDecl::TemplatedKind Kind>
2375std::shared_ptr<llvm::BitCodeAbbrev>
2377 using namespace llvm;
2379 auto Abv = std::make_shared<BitCodeAbbrev>();
2380 Abv->Add(BitCodeAbbrevOp(Code));
2382 Abv->Add(BitCodeAbbrevOp(0));
2383 Abv->Add(BitCodeAbbrevOp(Kind));
2388 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2391 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2393 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2394 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2396 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2397 }
else if constexpr (
Kind ==
2399 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2400 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2402 Abv->Add(BitCodeAbbrevOp(1));
2405 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2406 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2407 Abv->Add(BitCodeAbbrevOp(0));
2408 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2409 Abv->Add(BitCodeAbbrevOp(0));
2411 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2415 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2416 Abv->Add(BitCodeAbbrevOp(0));
2418 llvm_unreachable(
"Unknown templated kind?");
2421 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2430 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2431 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2434 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2435 Abv->Add(BitCodeAbbrevOp(0));
2437 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2439 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2440 Abv->Add(BitCodeAbbrevOp(0));
2441 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2443 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2444 Abv->Add(BitCodeAbbrevOp(
2445 BitCodeAbbrevOp::Fixed,
2453 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2454 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2463 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2464 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2468template <FunctionDecl::TemplatedKind Kind>
2469std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() {
2474void ASTWriter::WriteDeclAbbrevs() {
2475 using namespace llvm;
2477 std::shared_ptr<BitCodeAbbrev> Abv;
2480 Abv = std::make_shared<BitCodeAbbrev>();
2483 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2491 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2492 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2494 Abv->Add(BitCodeAbbrevOp(0));
2495 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2496 Abv->Add(BitCodeAbbrevOp(0));
2498 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2500 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2501 Abv->Add(BitCodeAbbrevOp(0));
2502 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2504 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2505 Abv->Add(BitCodeAbbrevOp(0));
2507 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2508 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2509 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2512 Abv = std::make_shared<BitCodeAbbrev>();
2515 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2520 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2521 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2523 Abv->Add(BitCodeAbbrevOp(0));
2524 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2525 Abv->Add(BitCodeAbbrevOp(0));
2527 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2529 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2530 Abv->Add(BitCodeAbbrevOp(0));
2531 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2533 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2534 Abv->Add(BitCodeAbbrevOp(0));
2536 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2537 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2539 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2540 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2541 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2544 Abv = std::make_shared<BitCodeAbbrev>();
2547 Abv->Add(BitCodeAbbrevOp(0));
2549 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2557 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2558 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2560 Abv->Add(BitCodeAbbrevOp(0));
2561 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2562 Abv->Add(BitCodeAbbrevOp(0));
2564 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2566 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2567 Abv->Add(BitCodeAbbrevOp(
2568 BitCodeAbbrevOp::Fixed,
2572 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2573 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2575 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2576 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2577 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2578 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2579 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2580 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2582 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2583 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2584 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2585 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2586 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2589 Abv = std::make_shared<BitCodeAbbrev>();
2592 Abv->Add(BitCodeAbbrevOp(0));
2594 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2602 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2603 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2605 Abv->Add(BitCodeAbbrevOp(0));
2606 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2607 Abv->Add(BitCodeAbbrevOp(0));
2609 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2611 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2612 Abv->Add(BitCodeAbbrevOp(
2613 BitCodeAbbrevOp::Fixed,
2617 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2618 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2620 Abv->Add(BitCodeAbbrevOp(
2621 BitCodeAbbrevOp::Fixed,
2632 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2635 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2636 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2637 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2638 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2639 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2642 Abv = std::make_shared<BitCodeAbbrev>();
2645 Abv->Add(BitCodeAbbrevOp(0));
2647 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2653 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2654 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2656 Abv->Add(BitCodeAbbrevOp(0));
2657 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2658 Abv->Add(BitCodeAbbrevOp(0));
2660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2662 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2663 Abv->Add(BitCodeAbbrevOp(0));
2664 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2667 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2670 Abv->Add(BitCodeAbbrevOp(0));
2672 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2673 Abv->Add(BitCodeAbbrevOp(
2674 BitCodeAbbrevOp::Fixed,
2679 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2680 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2681 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2684 Abv = std::make_shared<BitCodeAbbrev>();
2687 Abv->Add(BitCodeAbbrevOp(0));
2689 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2695 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2696 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2698 Abv->Add(BitCodeAbbrevOp(0));
2699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2700 Abv->Add(BitCodeAbbrevOp(0));
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2703 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2705 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2706 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2707 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2710 Abv = std::make_shared<BitCodeAbbrev>();
2713 Abv->Add(BitCodeAbbrevOp(0));
2715 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2720 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2721 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2723 Abv->Add(BitCodeAbbrevOp(0));
2724 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2725 Abv->Add(BitCodeAbbrevOp(0));
2727 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2729 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2730 Abv->Add(BitCodeAbbrevOp(0));
2731 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2733 Abv->Add(BitCodeAbbrevOp(
2734 BitCodeAbbrevOp::Fixed,
2743 Abv->Add(BitCodeAbbrevOp(0));
2745 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2747 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2750 DeclCXXMethodAbbrev =
2751 Stream.EmitAbbrev(getCXXMethodAbbrev<FunctionDecl::TK_NonTemplate>());
2752 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2753 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplate>());
2754 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2755 getCXXMethodAbbrev<FunctionDecl::TK_DependentNonTemplate>());
2756 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2757 getCXXMethodAbbrev<FunctionDecl::TK_MemberSpecialization>());
2758 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2759 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplateSpecialization>());
2760 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2765 Abv = std::make_shared<BitCodeAbbrev>();
2767 Abv->Add(BitCodeAbbrevOp(0));
2769 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2775 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2776 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2778 Abv->Add(BitCodeAbbrevOp(0));
2779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2780 Abv->Add(BitCodeAbbrevOp(0));
2782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2783 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2786 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2787 Abv->Add(BitCodeAbbrevOp(0));
2788 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2791 Abv = std::make_shared<BitCodeAbbrev>();
2794 Abv->Add(BitCodeAbbrevOp(0));
2796 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2801 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2802 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2804 Abv->Add(BitCodeAbbrevOp(0));
2805 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2806 Abv->Add(BitCodeAbbrevOp(0));
2808 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2809 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2810 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2813 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2816 Abv = std::make_shared<BitCodeAbbrev>();
2821 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2822 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2827 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2828 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2830 DeclRefExprAbbrev = 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(32));
2843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2844 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2847 Abv = std::make_shared<BitCodeAbbrev>();
2852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2853 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2856 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2858 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2861 Abv = std::make_shared<BitCodeAbbrev>();
2866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2869 Abv->Add(BitCodeAbbrevOp(0));
2871 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2873 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2876 Abv = std::make_shared<BitCodeAbbrev>();
2882 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2883 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2886 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2887 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2888 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2891 Abv = std::make_shared<BitCodeAbbrev>();
2897 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2898 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2902 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2907 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2910 Abv = std::make_shared<BitCodeAbbrev>();
2915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2916 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2919 Abv->Add(BitCodeAbbrevOp(0));
2920 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2921 CallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2924 Abv = std::make_shared<BitCodeAbbrev>();
2929 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2930 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2933 Abv->Add(BitCodeAbbrevOp(0));
2934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2936 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2937 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2938 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2941 Abv = std::make_shared<BitCodeAbbrev>();
2946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2947 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2950 Abv->Add(BitCodeAbbrevOp(0));
2951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2953 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2956 Abv = std::make_shared<BitCodeAbbrev>();
2960 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2961 Abv->Add(BitCodeAbbrevOp(0));
2962 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2964 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
2966 Abv = std::make_shared<BitCodeAbbrev>();
2968 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2969 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2971 Abv = std::make_shared<BitCodeAbbrev>();
2973 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2974 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2976 Abv = std::make_shared<BitCodeAbbrev>();
2978 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2979 DeclModuleLocalVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2981 Abv = std::make_shared<BitCodeAbbrev>();
2983 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2984 DeclTULocalLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2986 Abv = std::make_shared<BitCodeAbbrev>();
2988 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2989 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2991 Abv = std::make_shared<BitCodeAbbrev>();
2993 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2994 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
3019 if (isa<PragmaCommentDecl, PragmaDetectMismatchDecl>(
D))
3029 if (isa<FileScopeAsmDecl, TopLevelStmtDecl, ObjCImplDecl>(
D))
3047 assert(!
D->
isFromASTFile() &&
"should not be emitting imported decl");
3054 assert(ID >= FirstDeclID &&
"invalid decl ID");
3070 unsigned Index =
ID.getRawValue() - FirstDeclID.
getRawValue();
3071 if (DeclOffsets.size() == Index)
3072 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
3073 else if (DeclOffsets.size() < Index) {
3075 DeclOffsets.resize(Index+1);
3076 DeclOffsets[Index].setRawLoc(RawLoc);
3077 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
3079 llvm_unreachable(
"declarations should be emitted in ID order");
3084 associateDeclWithFile(
D, ID);
3098 Record->push_back(ModulesCodegen);
3100 Writer->
AddDeclRef(FD, Writer->ModularCodegenDecls);
3101 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
3102 Record->push_back(CD->getNumCtorInitializers());
3103 if (CD->getNumCtorInitializers())
static void addExplicitSpecifier(ExplicitSpecifier ES, ASTRecordWriter &Record)
static bool shouldVarGenerateHereOnly(const VarDecl *VD)
static bool shouldFunctionGenerateHereOnly(const FunctionDecl *FD)
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...
const LangOptions & getLangOpts() const
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
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 VisitOpenACCDeclareDecl(OpenACCDeclareDecl *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)
bool shouldSkipWritingSpecializations(T *Spec)
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 VisitOpenACCRoutineDecl(OpenACCRoutineDecl *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.
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc)
Return the raw encodings for source locations.
unsigned getDeclCXXMethodAbbrev(FunctionDecl::TemplatedKind Kind) const
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
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,...
ASTContext & getASTContext() const LLVM_READONLY
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 isThisDeclarationReferenced() const
Whether this declaration was referenced.
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?
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this 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.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ 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...
UnsignedOrNone getArgPackSubstIndex() const
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.
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
@ CInit
C-style initialization with assignment.
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
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...
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.
@ Template
We are parsing a template declaration.
@ ExplicitInstantiation
We are parsing an explicit instantiation.
@ VarTemplate
The name was classified as a variable template name.
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...
bool isExternallyVisible(Linkage L)
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)