24#include "llvm/Bitstream/BitstreamWriter.h"
25#include "llvm/Support/ErrorHandling.h"
37template <
typename DT>
bool isDefinitionInDependentContext(DT *D) {
38 return D->isDependentContext() && D->isThisDeclarationADefinition();
55 bool GeneratingReducedBMI =
false;
60 : Writer(Writer), Record(Context, Writer, Record),
62 GeneratingReducedBMI(GeneratingReducedBMI) {}
66 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
68 return Record.Emit(Code, AbbrevToUse);
191 Record.push_back(typeParams->
size());
192 for (
auto *typeParam : *typeParams) {
193 Record.AddDeclRef(typeParam);
203 auto Firsts = Writer.CollectFirstDeclFromEachModule(D, IncludeLocal);
204 for (
const auto &[_,
First] : Firsts)
205 Record.AddDeclRef(
First);
211 if (!GeneratingReducedBMI)
218 if (
auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(Spec))
219 Args = CTSD->getTemplateArgs().asArray();
220 else if (
auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(Spec))
221 Args = VTSD->getTemplateArgs().asArray();
224 ->getTemplateSpecializationArgs()
231 switch (TA.getKind()) {
233 Linkage L = TA.getAsType()->getLinkage();
239 if (!TA.getAsDecl()->isExternallyVisible())
259 "Must not be called with other decls");
261 Writer.CollectFirstDeclFromEachModule(D,
true);
262 for (
const auto &[_,
First] : Firsts) {
268 PartialSpecsInMap.push_back(
First);
270 SpecsInMap.push_back(
First);
275 template <
typename EntryType>
284 return Common->PartialSpecializations;
291 template<
typename DeclTy>
293 auto *Common = D->getCommonPtr();
298 if (Writer.Chain != Record.getASTContext().getExternalSource() &&
299 Writer.Chain && Writer.Chain->haveUnloadedSpecializations(D)) {
300 D->LoadLazySpecializations();
301 assert(!Writer.Chain->haveUnloadedSpecializations(D));
307 for (
auto &Entry : Common->Specializations)
314 for (
auto *D : AllSpecs) {
315 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
319 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
324 assert(PartialSpecs.empty());
328 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
329 D, PartialSpecs,
true));
380 (!VD->
hasAttr<DLLExportAttr>() ||
394 (FD->
hasAttr<DLLExportAttr>() &&
401 if (!FD->
hasAttr<AlwaysInlineAttr>() &&
402 !FD->
hasAttr<ExcludeFromExplicitInstantiationAttr>() &&
419 if (
auto *FD = dyn_cast<FunctionDecl>(D)) {
420 if (FD->isInlined() || FD->isConstexpr() || FD->isConsteval())
429 if (
auto *VD = dyn_cast<VarDecl>(D)) {
430 if (VD->getDeclContext()->isDependentContext())
436 if (VD->hasConstantInitialization() || VD->isConstexpr())
454 if (
auto *DD = dyn_cast<DeclaratorDecl>(D)) {
455 if (
auto *TInfo = DD->getTypeSourceInfo())
456 Record.AddTypeLoc(TInfo->getTypeLoc());
462 if (
auto *FD = dyn_cast<FunctionDecl>(D)) {
464 Record.push_back(FD->doesThisDeclarationHaveABody());
465 if (FD->doesThisDeclarationHaveABody())
466 Record.AddFunctionDefinition(FD);
475 if (
auto *VD = dyn_cast<VarDecl>(D)) {
477 Record.AddVarDeclInit(VD);
484 if (
auto *FD = dyn_cast<FieldDecl>(D)) {
485 if (FD->hasInClassInitializer()) {
486 if (
Expr *
Init = FD->getInClassInitializer()) {
488 Record.AddStmt(
Init);
499 if (
auto *DC = dyn_cast<DeclContext>(D))
520 DeclBits.
addBit(Writer.isWritingStdCXXNamedModules() ?
true : D->
isUsed(
false));
527 Record.push_back(DeclBits);
534 Record.AddAttributes(D->
getAttrs());
548 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
549 if (!NS->isFromASTFile())
551 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
552 if (!NS->isInlineNamespace())
554 DC = NS->getParent();
560 StringRef Arg = D->
getArg();
561 Record.push_back(Arg.size());
565 Record.AddString(Arg);
573 Record.push_back(Name.size() + 1 +
Value.size());
576 Record.AddString(Name);
577 Record.AddString(
Value);
582 llvm_unreachable(
"Translation units aren't directly serialized");
589 ? Writer.getAnonymousDeclarationNumber(D)
604 Record.push_back(D->
isModed());
621 AbbrevToUse = Writer.getDeclTypedefAbbrev();
634 "You need to update the serializer after you change the "
650 Record.push_back(TagDeclBits);
654 if (D->hasExtInfo()) {
655 Record.AddQualifierInfo(*D->getExtInfo());
657 Record.AddDeclRef(TD);
658 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
664 "You need to update the serializer after you change the "
679 Record.push_back(EnumDeclBits);
684 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
685 Record.push_back(MemberInfo->getTemplateSpecializationKind());
686 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
688 Record.AddDeclRef(
nullptr);
700 AbbrevToUse = Writer.getDeclEnumAbbrev();
707 "You need to update the serializer after you change the "
726 Record.push_back(RecordDeclBits);
741 AbbrevToUse = Writer.getDeclRecordAbbrev();
748 Record.AddTypeRef(D->
getType());
764 Record.push_back(D->hasExtInfo());
765 if (D->hasExtInfo()) {
766 DeclaratorDecl::ExtInfo *Info = D->getExtInfo();
767 Record.AddQualifierInfo(*Info);
779 "You need to update the serializer after you change the "
816 Record.AddASTTemplateArgumentListInfo(
824 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
825 Record.push_back(MemberInfo->getTemplateSpecializationKind());
826 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
845 Record.AddDeclRef(FTD);
850 Record.AddASTTemplateArgumentListInfo(
857 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
874 FunctionDeclBits.
addBit(D->isDeletedBit());
889 Record.push_back(FunctionDeclBits);
891 Record.AddSourceLocation(D->
getEndLoc());
902 Record.push_back(1 | (DeletedMessage ? 2 : 0));
904 Record.AddStmt(DeletedMessage);
906 Record.push_back(FDI->getFPFeatures().getAsOpaqueInt());
908 Record.push_back(FDI->getUnqualifiedLookups().size());
910 Record.AddDeclRef(P.getDecl());
911 Record.push_back(P.getAccess());
923 RD && isDefinitionInDependentContext(RD)) {
924 Writer.RelatedDeclsMap[Writer.GetDeclRef(RD)].push_back(
925 Writer.GetDeclRef(D));
930 for (
auto *EID : Record.getASTContext().getExplicitInstantiationDecls(D))
931 Writer.GetDeclRef(EID);
935 Record.AddDeclRef(P);
942 Kind = Kind << 1 | static_cast<bool>(ES.
getExpr());
962 "You need to update the serializer after you change the "
963 "ObjCMethodDeclBits");
968 bool HasBodyStuff = D->
getBody() !=
nullptr;
969 Record.push_back(HasBodyStuff);
986 assert(Record.getASTContext().getObjCMethodRedeclaration(D));
987 Record.AddDeclRef(Record.getASTContext().getObjCMethodRedeclaration(D));
997 Record.AddSourceLocation(D->
getEndLoc());
1000 Record.AddDeclRef(P);
1002 Record.push_back(D->getSelLocsKind());
1003 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
1005 Record.push_back(NumStoredSelLocs);
1006 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
1007 Record.AddSourceLocation(SelLocs[i]);
1014 Record.push_back(D->Variance);
1015 Record.push_back(D->Index);
1016 Record.AddSourceLocation(D->VarianceLoc);
1017 Record.AddSourceLocation(D->ColonLoc);
1024 "You need to update the serializer after you change the "
1025 "ObjCContainerDeclBits");
1042 ObjCInterfaceDecl::DefinitionData &
Data = D->data();
1046 Record.push_back(
Data.HasDesignatedInitializers);
1050 Record.push_back(
Data.ReferencedProtocols.size());
1052 Record.AddDeclRef(P);
1054 Record.AddSourceLocation(PL);
1057 Record.push_back(
Data.AllReferencedProtocols.size());
1059 P =
Data.AllReferencedProtocols.begin(),
1060 PEnd =
Data.AllReferencedProtocols.end();
1062 Record.AddDeclRef(*P);
1067 Writer.ObjCClassesWithCategories.insert(D);
1070 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
1071 (void)Writer.GetDeclRef(Cat);
1094 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
1107 Record.AddDeclRef(I);
1109 Record.AddSourceLocation(PL);
1130 Record.AddDeclRef(I);
1132 Record.AddSourceLocation(PL);
1144 Record.AddSourceLocation(D->
getAtLoc());
1146 Record.AddTypeRef(D->
getType());
1183 Record.push_back(D->NumIvarInitializers);
1184 if (D->NumIvarInitializers)
1185 Record.AddCXXCtorInitializers(
1207 Record.push_back((D->StorageKind << 1) | D->BitField);
1208 if (D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1210 else if (D->BitField)
1215 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(D));
1232 AbbrevToUse = Writer.getDeclFieldAbbrev();
1247 Record.push_back(Parts.
Part1);
1248 Record.push_back(Parts.
Part2);
1249 Record.push_back(Parts.
Part3);
1271 for (
const auto *P : D->
chain())
1272 Record.AddDeclRef(P);
1288 VarDeclBits.
addBit(ModulesCodegen);
1295 bool HasDeducedType =
false;
1310 VarDeclBits.
addBit(HasDeducedType);
1312 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
1313 VarDeclBits.
addBits(llvm::to_underlying(IPD->getParameterKind()),
1322 Record.push_back(VarDeclBits);
1325 Writer.AddDeclRef(D, Writer.ModularCodegenDecls);
1327 if (D->
hasAttr<BlocksAttr>()) {
1329 Record.AddStmt(
Init.getCopyExpr());
1330 if (
Init.getCopyExpr())
1331 Record.push_back(
Init.canThrow());
1335 VarNotTemplate = 0,
VarTemplate, StaticDataMemberSpecialization
1339 Record.AddDeclRef(TemplD);
1342 Record.push_back(StaticDataMemberSpecialization);
1343 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1344 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1345 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1347 Record.push_back(VarNotTemplate);
1362 AbbrevToUse = Writer.getDeclVarAbbrev();
1389 Record.push_back(ParmVarDeclBits);
1405 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1409 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1411 &&
"PARM_VAR_DECL can't be demoted definition.");
1412 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1414 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1416 "PARM_VAR_DECL can't be static data member");
1421 Record.push_back(D->
bindings().size());
1425 Record.AddDeclRef(B);
1459 Record.push_back(
static_cast<bool>(D->
getValue()));
1471 Record.AddDeclRef(P);
1479 for (
const auto &capture : D->
captures()) {
1480 Record.AddDeclRef(capture.getVariable());
1483 if (capture.isByRef()) flags |= 1;
1484 if (capture.isNested()) flags |= 2;
1485 if (capture.hasCopyExpr()) flags |= 4;
1486 Record.push_back(flags);
1488 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1499 Record.push_back(D->
isNothrow() ? 1 : 0);
1508 Record.push_back(CD->
isNothrow() ? 1 : 0);
1511 Record.AddDeclRef(CD->
getParam(I));
1517 "You need to update the serializer after you change the"
1518 "LinkageSpecDeclBits");
1521 Record.push_back(llvm::to_underlying(D->
getLanguage()));
1547 Record.push_back(NamespaceDeclBits);
1565 Writer.DeclUpdates[Parent].push_back(
1585 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1586 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1588 Record.AddDeclRef(Record.getASTContext().getInstantiatedFromUsingDecl(D));
1597 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1598 Record.AddDeclRef(Record.getASTContext().getInstantiatedFromUsingEnumDecl(D));
1603 Record.push_back(D->NumExpansions);
1607 Record.AddDeclRef(E);
1616 Record.AddDeclRef(D->UsingOrNextShadow);
1618 Record.getASTContext().getInstantiatedFromUsingShadowDecl(D));
1624 AbbrevToUse = Writer.getDeclUsingShadowAbbrev();
1632 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1633 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1634 Record.push_back(D->IsVirtual);
1652 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1676 CXXRecNotTemplate = 0,
1678 CXXRecMemberSpecialization,
1682 Record.push_back(CXXRecTemplate);
1683 Record.AddDeclRef(TemplD);
1686 Record.push_back(CXXRecMemberSpecialization);
1687 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1688 Record.push_back(MSInfo->getTemplateSpecializationKind());
1689 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1692 Record.push_back(CXXLambda);
1694 Record.AddDeclRef(Context);
1697 Record.push_back(0);
1701 if (
auto *FD = llvm::dyn_cast_or_null<FunctionDecl>(D->
getDeclContext());
1702 FD && isDefinitionInDependentContext(FD)) {
1703 Writer.RelatedDeclsMap[Writer.GetDeclRef(FD)].push_back(
1707 Record.push_back(CXXRecNotTemplate);
1712 Record.AddCXXDefinitionData(D);
1715 Writer.AddDeclRef(D, Writer.ModularCodegenDecls);
1723 Record.AddDeclRef(Record.getASTContext().getCurrentKeyFunction(D));
1733 Record.AddDeclRef(MD);
1736 Record.push_back(0);
1775 "You need to update the serializer after you change the "
1776 "CXXConstructorDeclBits");
1778 Record.push_back(D->getTrailingAllocKind());
1781 Record.AddDeclRef(Inherited.getShadowDecl());
1782 Record.AddDeclRef(Inherited.getConstructor());
1787 Record.push_back((
unsigned)CtorClosureDefaultArgs.size());
1789 Record.writeStmtRef(Arg);
1818 Record.push_back(!IdentifierLocs.empty());
1819 if (IdentifierLocs.empty()) {
1820 Record.AddSourceLocation(D->
getEndLoc());
1821 Record.push_back(1);
1823 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1824 Record.AddSourceLocation(IdentifierLocs[I]);
1825 Record.push_back(IdentifierLocs.size());
1841 Record.push_back(hasFriendDecl);
1847 Record.AddSourceLocation(D->FriendLoc);
1848 Record.AddSourceLocation(D->EllipsisLoc);
1855 Record.push_back(D->NumTPLists);
1858 Record.AddTemplateParameterList(TPL);
1862 }
else if (D->Template.
isNull()) {
1868 Record.push_back(Kind);
1875 Record.AddTemplateName(D->Template);
1881 Record.AddTemplateName(D->Template);
1885 Record.AddSourceLocation(D->FriendLoc);
1886 Record.AddSourceLocation(D->EllipsisLoc);
1908 Record.AddTemplateArgument(Arg);
1940 if (Writer.isGeneratingReducedBMI()) {
1942 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(D);
1944 Writer.GetDeclRef(DG->getCanonicalDecl());
1959 if (
Decl *InstFromD = dyn_cast<ClassTemplateDecl *>(InstFrom)) {
1960 Record.AddDeclRef(InstFromD);
1989 Record.push_back(!!ArgsWritten);
1991 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1998 if (Writer.isWritingStdCXXNamedModules()) {
2000 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
2003 Writer.GetDeclRef(DG->getCanonicalDecl());
2007 for (
auto *EID : Record.getASTContext().getExplicitInstantiationDecls(D))
2008 Writer.GetDeclRef(EID);
2040 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
2042 if (
Decl *InstFromD = dyn_cast<VarTemplateDecl *>(InstFrom)) {
2043 Record.AddDeclRef(InstFromD);
2061 Record.push_back(!!ArgsWritten);
2063 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
2068 Record.push_back(D->IsCompleteDefinition);
2080 for (
auto *EID : Record.getASTContext().getExplicitInstantiationDecls(D))
2081 Writer.GetDeclRef(EID);
2117 Record.push_back(TC !=
nullptr);
2120 Record.push_back(CR !=
nullptr);
2122 Record.AddConceptReference(CR);
2130 Record.push_back(OwnsDefaultArg);
2139 AbbrevToUse = Writer.getDeclTemplateTypeParmAbbrev();
2172 Record.push_back(OwnsDefaultArg);
2203 Record.push_back(OwnsDefaultArg);
2230 Flags |= ExplicitInstantiationDecl::HasQualifierFlag;
2232 Flags |= ExplicitInstantiationDecl::HasArgsAsWrittenFlag;
2233 Record.push_back(Flags);
2239 Record.AddTypeSourceInfo(D->getRawTypeSourceInfo());
2244 if (
const auto *Args = D->getTrailingArgsInfo())
2245 Record.AddASTTemplateArgumentListInfo(Args);
2260 "You need to update the serializer after you change the "
2272 Writer.WriteDeclContextLexicalBlock(Record.getASTContext(), DC);
2273 Writer.WriteDeclContextVisibleBlock(Record.getASTContext(), DC, Offsets);
2276 Record.AddLookupOffsets(Offsets);
2280 assert(
IsLocalDecl(D) &&
"expected a local declaration");
2286 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2293 return CacheEntry = D;
2296template <
typename T>
2299 T *MostRecent =
First->getMostRecentDecl();
2300 T *DAsT =
static_cast<T *
>(D);
2301 if (MostRecent !=
First) {
2303 "Not considered redeclarable?");
2305 Record.AddDeclRef(
First);
2309 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
2310 if (DAsT == FirstLocal) {
2314 unsigned I = Record.size();
2315 Record.push_back(0);
2319 Record[I] = Record.size() - I;
2327 if (!Prev->isFromASTFile())
2332 if (LocalRedecls.empty())
2333 Record.push_back(0);
2337 Record.push_back(0);
2338 Record.AddDeclRef(FirstLocal);
2348 (void)Writer.GetDeclRef(MostRecent);
2351 Record.push_back(0);
2367 Record.writeOMPChildren(D->
Data);
2373 Record.writeOMPChildren(D->
Data);
2379 Record.writeOMPChildren(D->
Data);
2386 "You need to update the serializer after you change the "
2387 "NumOMPDeclareReductionDeclBits");
2403 Record.writeOMPChildren(D->
Data);
2416 Record.writeUInt32(D->
clauses().size());
2418 Record.writeEnum(D->DirKind);
2419 Record.AddSourceLocation(D->DirectiveLoc);
2420 Record.AddSourceLocation(D->EndLoc);
2421 Record.writeOpenACCClauseList(D->
clauses());
2425 Record.writeUInt32(D->
clauses().size());
2427 Record.writeEnum(D->DirKind);
2428 Record.AddSourceLocation(D->DirectiveLoc);
2429 Record.AddSourceLocation(D->EndLoc);
2430 Record.AddSourceRange(D->ParensLoc);
2431 Record.AddStmt(D->FuncRef);
2432 Record.writeOpenACCClauseList(D->
clauses());
2441template <FunctionDecl::TemplatedKind Kind>
2442std::shared_ptr<llvm::BitCodeAbbrev>
2444 using namespace llvm;
2446 auto Abv = std::make_shared<BitCodeAbbrev>();
2447 Abv->Add(BitCodeAbbrevOp(Code));
2449 Abv->Add(BitCodeAbbrevOp(0));
2450 Abv->Add(BitCodeAbbrevOp(Kind));
2455 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2458 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2460 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2461 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2463 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2464 }
else if constexpr (
Kind ==
2466 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2467 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2469 Abv->Add(BitCodeAbbrevOp(1));
2472 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2473 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2474 Abv->Add(BitCodeAbbrevOp(0));
2475 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2476 Abv->Add(BitCodeAbbrevOp(0));
2478 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2479 }
else if constexpr (
Kind == FunctionDecl::
2480 TK_DependentFunctionTemplateSpecialization) {
2482 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2483 Abv->Add(BitCodeAbbrevOp(0));
2485 llvm_unreachable(
"Unknown templated kind?");
2488 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2497 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2498 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2501 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2502 Abv->Add(BitCodeAbbrevOp(0));
2504 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2506 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2507 Abv->Add(BitCodeAbbrevOp(0));
2508 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2510 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2511 Abv->Add(BitCodeAbbrevOp(
2512 BitCodeAbbrevOp::Fixed,
2520 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2521 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2530 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2531 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2535template <FunctionDecl::TemplatedKind Kind>
2536std::shared_ptr<llvm::BitCodeAbbrev> getCXXMethodAbbrev() {
2541void ASTWriter::WriteDeclAbbrevs() {
2542 using namespace llvm;
2544 std::shared_ptr<BitCodeAbbrev> Abv;
2547 Abv = std::make_shared<BitCodeAbbrev>();
2550 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2558 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2559 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2561 Abv->Add(BitCodeAbbrevOp(0));
2562 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2563 Abv->Add(BitCodeAbbrevOp(0));
2565 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2567 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2568 Abv->Add(BitCodeAbbrevOp(0));
2569 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2571 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2572 Abv->Add(BitCodeAbbrevOp(0));
2574 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2575 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2576 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2579 Abv = std::make_shared<BitCodeAbbrev>();
2582 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));
2596 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2597 Abv->Add(BitCodeAbbrevOp(0));
2598 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2600 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2601 Abv->Add(BitCodeAbbrevOp(0));
2603 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2604 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2606 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2607 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2608 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2611 Abv = std::make_shared<BitCodeAbbrev>();
2614 Abv->Add(BitCodeAbbrevOp(0));
2616 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2624 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2625 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2627 Abv->Add(BitCodeAbbrevOp(0));
2628 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2629 Abv->Add(BitCodeAbbrevOp(0));
2631 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2633 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2634 Abv->Add(BitCodeAbbrevOp(
2635 BitCodeAbbrevOp::Fixed,
2639 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2640 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2642 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2643 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2644 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2645 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2646 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2647 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2649 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2650 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2651 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2652 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2653 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2656 Abv = std::make_shared<BitCodeAbbrev>();
2659 Abv->Add(BitCodeAbbrevOp(0));
2661 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2669 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2670 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2672 Abv->Add(BitCodeAbbrevOp(0));
2673 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2674 Abv->Add(BitCodeAbbrevOp(0));
2676 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2678 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2679 Abv->Add(BitCodeAbbrevOp(
2680 BitCodeAbbrevOp::Fixed,
2684 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2685 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2687 Abv->Add(BitCodeAbbrevOp(
2688 BitCodeAbbrevOp::Fixed,
2699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2703 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2704 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2705 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2706 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2709 Abv = std::make_shared<BitCodeAbbrev>();
2712 Abv->Add(BitCodeAbbrevOp(0));
2714 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));
2734 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2737 Abv->Add(BitCodeAbbrevOp(0));
2739 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2740 Abv->Add(BitCodeAbbrevOp(
2741 BitCodeAbbrevOp::Fixed,
2746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2747 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2748 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2751 Abv = std::make_shared<BitCodeAbbrev>();
2754 Abv->Add(BitCodeAbbrevOp(0));
2756 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2762 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2763 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2765 Abv->Add(BitCodeAbbrevOp(0));
2766 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2767 Abv->Add(BitCodeAbbrevOp(0));
2769 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2772 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2773 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2774 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2777 Abv = std::make_shared<BitCodeAbbrev>();
2780 Abv->Add(BitCodeAbbrevOp(0));
2782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2790 Abv->Add(BitCodeAbbrevOp(0));
2791 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2792 Abv->Add(BitCodeAbbrevOp(0));
2794 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2796 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2797 Abv->Add(BitCodeAbbrevOp(0));
2798 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2800 Abv->Add(BitCodeAbbrevOp(
2801 BitCodeAbbrevOp::Fixed,
2810 Abv->Add(BitCodeAbbrevOp(0));
2812 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2814 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2817 DeclCXXMethodAbbrev =
2818 Stream.EmitAbbrev(getCXXMethodAbbrev<FunctionDecl::TK_NonTemplate>());
2819 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2820 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplate>());
2821 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2822 getCXXMethodAbbrev<FunctionDecl::TK_DependentNonTemplate>());
2823 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2824 getCXXMethodAbbrev<FunctionDecl::TK_MemberSpecialization>());
2825 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2826 getCXXMethodAbbrev<FunctionDecl::TK_FunctionTemplateSpecialization>());
2827 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2832 Abv = std::make_shared<BitCodeAbbrev>();
2834 Abv->Add(BitCodeAbbrevOp(0));
2836 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2845 Abv->Add(BitCodeAbbrevOp(0));
2846 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2847 Abv->Add(BitCodeAbbrevOp(0));
2849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2850 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2853 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2854 Abv->Add(BitCodeAbbrevOp(0));
2855 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2858 Abv = std::make_shared<BitCodeAbbrev>();
2861 Abv->Add(BitCodeAbbrevOp(0));
2863 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2868 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2871 Abv->Add(BitCodeAbbrevOp(0));
2872 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2873 Abv->Add(BitCodeAbbrevOp(0));
2875 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2876 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2878 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2880 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2883 Abv = std::make_shared<BitCodeAbbrev>();
2888 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2889 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2894 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2895 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2896 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2897 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2900 Abv = std::make_shared<BitCodeAbbrev>();
2905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2908 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2909 Abv->Add(BitCodeAbbrevOp(32));
2910 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2911 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2914 Abv = std::make_shared<BitCodeAbbrev>();
2919 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2920 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2922 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2923 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2924 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2925 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2928 Abv = std::make_shared<BitCodeAbbrev>();
2933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2936 Abv->Add(BitCodeAbbrevOp(0));
2938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2940 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2943 Abv = std::make_shared<BitCodeAbbrev>();
2949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2953 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2955 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2958 Abv = std::make_shared<BitCodeAbbrev>();
2964 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2965 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2969 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2970 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2972 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2973 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2974 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2977 Abv = std::make_shared<BitCodeAbbrev>();
2982 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2983 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2985 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2986 Abv->Add(BitCodeAbbrevOp(0));
2987 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2988 CallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2991 Abv = std::make_shared<BitCodeAbbrev>();
2996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2997 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3000 Abv->Add(BitCodeAbbrevOp(0));
3001 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3003 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3004 Abv->Add(BitCodeAbbrevOp(0));
3005 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3006 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
3009 Abv = std::make_shared<BitCodeAbbrev>();
3014 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
3015 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3017 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3018 Abv->Add(BitCodeAbbrevOp(0));
3019 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3021 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
3024 Abv = std::make_shared<BitCodeAbbrev>();
3028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3029 Abv->Add(BitCodeAbbrevOp(0));
3030 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3031 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
3032 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
3034 Abv = std::make_shared<BitCodeAbbrev>();
3036 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3037 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
3039 Abv = std::make_shared<BitCodeAbbrev>();
3041 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3042 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
3044 Abv = std::make_shared<BitCodeAbbrev>();
3046 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3047 DeclModuleLocalVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
3049 Abv = std::make_shared<BitCodeAbbrev>();
3051 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3052 DeclTULocalLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
3054 Abv = std::make_shared<BitCodeAbbrev>();
3056 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3057 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
3059 Abv = std::make_shared<BitCodeAbbrev>();
3061 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
3062 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
3106 return Context.DeclMustBeEmitted(D);
3110 PrettyDeclStackTraceEntry CrashInfo(Context, D, SourceLocation(),
3115 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
3116 LocalDeclID &IDR = DeclIDs[D];
3122 assert(ID >= FirstDeclID &&
"invalid decl ID");
3138 unsigned Index =
ID.getRawValue() - FirstDeclID.getRawValue();
3139 if (DeclOffsets.size() == Index)
3140 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
3141 else if (DeclOffsets.size() < Index) {
3143 DeclOffsets.resize(Index+1);
3144 DeclOffsets[Index].setRawLoc(RawLoc);
3145 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
3147 llvm_unreachable(
"declarations should be emitted in ID order");
3152 associateDeclWithFile(D, ID);
3162 Writer->ClearSwitchCaseIDs();
3166 Record->push_back(ModulesCodegen);
3168 Writer->AddDeclRef(FD, Writer->ModularCodegenDecls);
3169 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
3170 Record->push_back(CD->getNumCtorInitializers());
3171 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()
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)
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 VisitCXXExpansionStmtDecl(CXXExpansionStmtDecl *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 VisitExplicitInstantiationDecl(ExplicitInstantiationDecl *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)
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.
bool IsLocalDecl(const Decl *D) const
Is this a local declaration (that is, one that will be written to our AST file)?
SmallVectorImpl< uint64_t > RecordDataImpl
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc)
Return the raw encodings for source locations.
friend class ASTDeclWriter
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
SmallVector< uint64_t, 64 > RecordData
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
Represents an access specifier followed by colon ':'.
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
A binding in a decomposition declaration.
Expr * getBinding() const
Get the expression to which this declaration is bound.
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.
unsigned getNumCaptures() const
Returns the number of captured variables.
bool canAvoidCopyToHeap() const
size_t param_size() const
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
ArrayRef< Capture > captures() const
bool blockMissingReturnType() const
bool capturesCXXThis() const
bool doesNotEscape() const
bool isConversionFromLambda() const
ArrayRef< ParmVarDecl * > parameters() const
TypeSourceInfo * getSignatureAsWritten() const
Represents a C++ constructor within a class.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
ArrayRef< CXXDefaultArgExpr * > getCtorClosureDefaultArgs() const
Represents a C++ conversion function within a class.
ExplicitSpecifier getExplicitSpecifier() const
Represents a C++ deduction guide declaration.
ExplicitSpecifier getExplicitSpecifier() const
CXXConstructorDecl * getCorrespondingConstructor() const
Get the constructor from which this deduction guide was generated, if this is an implicit deduction g...
const CXXDeductionGuideDecl * getSourceDeductionGuide() const
Get the deduction guide from which this deduction guide was generated, if it was generated as part of...
DeductionCandidate getDeductionCandidateKind() const
SourceDeductionGuideKind getSourceDeductionGuideKind() const
A default argument (C++ [dcl.fct.default]).
Represents a C++ destructor within a class.
const FunctionDecl * getOperatorGlobalDelete() const
const FunctionDecl * getGlobalArrayOperatorDelete() const
const FunctionDecl * getOperatorDelete() const
Expr * getOperatorDeleteThisArg() const
const FunctionDecl * getArrayOperatorDelete() const
Represents a C++26 expansion statement declaration.
CXXExpansionStmtPattern * getExpansionPattern()
CXXExpansionStmtInstantiation * getInstantiations()
NonTypeTemplateParmDecl * getIndexTemplateParm()
Represents a static or instance method of a struct/union/class.
CXXMethodDecl * getMostRecentDecl()
overridden_method_range overridden_methods() const
unsigned size_overridden_methods() const
Represents a C++ struct/union/class.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
unsigned getLambdaIndexInContext() const
Retrieve the index of this lambda within the context declaration returned by getLambdaContextDecl().
bool isLambda() const
Determine whether this class describes a lambda function object.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
static bool classofKind(Kind K)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
CXXRecordDecl * getPreviousDecl()
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.
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
bool isMemberSpecialization() const
Determines whether this class template partial specialization template was a specialization of a memb...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a class template specialization, which refers to a class template with a given set of temp...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
SourceLocation getExternKeywordLoc() const
Gets the location of the extern keyword, if present.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
bool hasStrictPackMatch() const
Declaration of a C++20 concept.
Expr * getConstraintExpr() const
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...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
@ NumOMPDeclareReductionDeclBits
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
@ NumCXXConstructorDeclBits
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
@ NumObjCContainerDeclBits
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
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 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 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.
NameKind getNameKind() const
Determine what kind of name this is.
Represents a ValueDecl that came out of a declarator.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
TypeSourceInfo * getTypeSourceInfo() const
A decomposition declaration.
ArrayRef< BindingDecl * > bindings() const
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.
llvm::APSInt getInitVal() const
const Expr * getInitExpr() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists,...
EnumDecl * getMostRecentDecl()
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum.
QualType getPromotionType() const
Return the integer type that enumerators should promote to.
Represents an explicit instantiation of a template entity in source code.
TemplateSpecializationKind getTemplateSpecializationKind() const
SourceLocation getExternLoc() const
bool hasTrailingQualifier() const
NamedDecl * getSpecialization() const
NestedNameSpecifierLoc getQualifierLoc() const
Returns the qualifier regardless of where it is stored.
SourceLocation getNameLoc() const
bool hasTrailingArgsAsWritten() const
Store information needed for an explicit specifier.
ExplicitSpecKind getKind() const
const Expr * getExpr() const
Represents a standard C++ module export declaration.
SourceLocation getRBraceLoc() const
This represents one expression.
Represents a member of a struct/union/class.
bool isMutable() const
Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
const Expr * getAsmStringExpr() const
SourceLocation getRParenLoc() const
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
virtual NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
FriendDecl * getNextFriend()
Declaration of a friend template.
NamedDecl * getFriendDecl() const override
If this friend declaration doesn't name a type, return the inner declaration.
ArrayRef< TemplateParameterList * > getTemplateParameterLists() const
Represents a function declaration or definition.
bool isMultiVersion() const
True if this function is considered a multiversioned function.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
bool isTrivialForCall() const
ConstexprSpecKind getConstexprKind() const
DefaultedOrDeletedFunctionInfo * getDefaultedOrDeletedInfo() const
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
bool isDestroyingOperatorDelete() const
Determine whether this is a destroying operator delete.
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
SourceLocation getDefaultLoc() const
bool usesSEHTry() const
Indicates the function uses __try.
ArrayRef< ParmVarDecl * > parameters() const
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool hasWrittenPrototype() const
Whether this function has a written prototype.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization,...
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
unsigned getODRHash()
Returns ODRHash of the function.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool FriendConstraintRefersToEnclosingTemplate() const
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
bool isDeletedAsWritten() const
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
bool isTypeAwareOperatorNewOrDelete() const
Determine whether this is a type aware operator new or delete.
bool isDefaulted() const
Whether this function is defaulted.
bool isIneligibleOrNotSelected() const
FunctionDecl * getInstantiatedFromDecl() const
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
size_t param_size() const
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
bool isInstantiatedFromMemberTemplate() const
Declaration of a template function.
FunctionTemplateDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
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.
SourceLocation getLBraceLoc() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getRBraceLoc() const
ArrayRef< TemplateArgument > getTemplateArguments() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Represents a field injected from an anonymous union/struct into the parent scope.
unsigned getChainingSize() const
ArrayRef< NamedDecl * > chain() const
Represents the declaration of a label.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
unsigned getManglingNumber() const
APValue * getValue() const
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
ValueDecl * getExtendingDecl()
Represents a linkage specification.
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
SourceLocation getExternLoc() const
SourceLocation getRBraceLoc() const
Parts getParts() const
Get the decomposed parts of this declaration.
An instance of this class represents the declaration of a property member.
IdentifierInfo * getGetterId() const
IdentifierInfo * getSetterId() const
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.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
bool isPlaceholderVar(const LangOptions &LangOpts) const
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a C++ namespace alias.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
Represent a C++ namespace.
SourceLocation getRBraceLoc() const
NamespaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
SourceLocation getBeginLoc() const LLVM_READONLY
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
bool isInline() const
Returns true if this is an inline namespace declaration.
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace that inhabits this namespace, if any.
bool isNested() const
Returns true if this is a nested namespace declaration.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
bool hasPlaceholderTypeConstraint() const
Determine whether this non-type template parameter's type has a placeholder with a type-constraint.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Expr * getPlaceholderTypeConstraint() const
Return the constraint introduced by the placeholder type of this non-type template parameter (if any)...
This represents 'pragma omp allocate ...' directive.
Pseudo declaration for capturing expressions.
OMPChildren * Data
Data, associated with the directive.
This represents 'pragma omp declare mapper ...' directive.
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name.
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
This represents 'pragma omp declare reduction ...' directive.
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Expr * getInitPriv()
Get Priv variable of the initializer.
Expr * getCombinerOut()
Get Out variable of the combiner.
Expr * getCombinerIn()
Get In variable of the combiner.
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name.
Expr * getInitOrig()
Get Orig variable of the initializer.
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
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.
protocol_loc_range protocol_locs() const
unsigned protocol_size() const
ObjCInterfaceDecl * getClassInterface()
SourceLocation getIvarLBraceLoc() const
SourceLocation getIvarRBraceLoc() const
protocol_range protocols() const
SourceLocation getCategoryNameLoc() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
SourceLocation getCategoryNameLoc() const
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
ObjCContainerDecl - Represents a container for method declarations.
SourceRange getAtEndRange() const
SourceLocation getAtStartLoc() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
SourceLocation getSuperClassLoc() const
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getIvarLBraceLoc() const
Represents an ObjC class declaration.
protocol_range protocols() const
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
protocol_loc_range protocol_locs() const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
const Type * getTypeForDecl() const
SourceLocation getEndOfDefinitionLoc() const
TypeSourceInfo * getSuperClassTInfo() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
bool getSynthesize() const
static bool classofKind(Kind K)
ObjCMethodDecl - Represents an instance or class method declaration.
ImplicitParamDecl * getSelfDecl() const
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
unsigned param_size() const
bool isPropertyAccessor() const
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
bool hasRedeclaration() const
True if redeclared in the same interface.
bool isSynthesizedAccessorStub() const
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
ImplicitParamDecl * getCmdDecl() const
bool isInstanceMethod() const
QualType getReturnType() const
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
Represents one property declaration in an Objective-C interface.
SourceLocation getGetterNameLoc() const
ObjCMethodDecl * getGetterMethodDecl() const
ObjCMethodDecl * getSetterMethodDecl() const
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
ObjCIvarDecl * getPropertyIvarDecl() const
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
Selector getGetterName() const
SourceLocation getLParenLoc() const
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
ObjCPropertyAttribute::Kind getPropertyAttributes() const
PropertyControl getPropertyImplementation() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
ObjCMethodDecl * getSetterMethodDecl() const
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
protocol_loc_range protocol_locs() const
protocol_range protocols() const
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
unsigned protocol_size() const
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
ArrayRef< const OpenACCClause * > clauses() const
Represents a partial function definition.
ImplicitParamDecl * getParam(unsigned i) const
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
unsigned getNumParams() const
Represents a parameter to a function.
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion:
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
SourceLocation getExplicitObjectParamThisLoc() const
bool isObjCMethodParameter() const
ObjCDeclQualifier getObjCDeclQualifier() const
bool hasUninstantiatedDefaultArg() const
bool hasInheritedDefaultArg() const
Expr * getUninstantiatedDefaultArg()
unsigned getFunctionScopeDepth() const
Represents a #pragma detect_mismatch line.
StringRef getName() const
StringRef getValue() const
A (possibly-)qualified type.
Represents a struct/union/class.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
bool hasNonTrivialToPrimitiveDestructCUnion() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
RecordArgPassingKind getArgPassingRestrictions() const
bool hasVolatileMember() const
bool hasFlexibleArrayMember() const
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
bool hasObjectMember() const
bool isNonTrivialToPrimitiveDestroy() const
bool isNonTrivialToPrimitiveCopy() const
bool isParamDestroyedInCallee() const
RecordDecl * getMostRecentDecl()
bool hasUninitializedExplicitInitFields() const
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
bool isAnonymousStructOrUnion() const
Whether this is an anonymous struct or union.
Declaration of a redeclarable template.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or nullptr if this template w...
Provides common interface for the Decls that can be redeclared.
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
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.
bool isLocalSourceLocation(SourceLocation Loc) const
Returns true if Loc did not come from a PCH/Module.
Represents a C++11 static_assert declaration.
SourceLocation getRParenLoc() const
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
SourceRange getBraceRange() const
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
TypedefNameDecl * getTypedefNameForAnonDecl() const
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
TagKind getTagKind() const
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.).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isNull() const
Determine whether this template name is NULL.
A template parameter object.
const APValue & getValue() const
Stores a list of template parameters for a TemplateDecl and its derived classes.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
bool wasDeclaredWithTypename() const
Whether this template template parameter was declared with the 'typename' keyword.
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
TemplateNameKind templateParameterKind() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool hasTypeConstraint() const
Determine whether this template parameter has a type-constraint.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
UnsignedOrNone getNumExpansionParameters() const
Whether this parameter is a template type parameter pack that has a known list of different type-cons...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
A declaration that models statements at global scope.
unsigned getOrdinal() const
The top declaration context.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
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.
const Type * getTypeForDecl() const
SourceLocation getBeginLoc() const LLVM_READONLY
QualType getType() const
Return the type wrapped by this type source info.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
TypeSourceInfo * getTypeSourceInfo() const
TypedefNameDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
QualType getUnderlyingType() const
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes,...
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
const APValue & getValue() const
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.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Represents a dependent using declaration which was not marked with typename.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Represents a C++ using-declaration.
bool hasTypename() const
Return true if the using declaration has 'typename'.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
Represents C++ using-directive.
SourceLocation getUsingLoc() const
Return the location of the using keyword.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Represents a C++ using-enum-declaration.
SourceLocation getEnumLoc() const
The source location of the 'enum' keyword.
TypeSourceInfo * getEnumType() const
SourceLocation getUsingLoc() const
The source location of the 'using' keyword.
Represents a pack of using declarations that a single using-declarator pack-expanded into.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
UsingShadowDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
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.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
VarDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
@ CInit
C-style initialization with assignment.
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C.
bool hasInitWithSideEffects() const
Checks whether this declaration has an initializer with side effects.
bool isInlineSpecified() const
bool isStaticDataMember() const
Determines whether this is a static data member.
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
bool isCXXForRangeImplicitVar() const
Whether this variable is the implicit '__range' variable in C++ range-based for loops.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
bool isInline() const
Whether this variable is (C++1z) inline.
ThreadStorageClassSpecifier getTSCSpec() const
const Expr * getInit() const
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool isEscapingByref() const
Indicates the capture is a __block variable that is captured by a block that can potentially escape (...
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
VarDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization,...
Declaration of a variable template.
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
bool isMemberSpecialization() const
Determines whether this variable template partial specialization was a specialization of a member par...
Represents a variable template specialization, which refers to a variable template with a given set o...
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
SourceLocation getExternKeywordLoc() const
Gets the location of the extern keyword, if present.
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
FriendTemplateDeclKind
Kinds of friend payloads owned by FriendTemplateDecl.
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_EXPANSION_STMT
A C++ expansion statement.
@ 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_EXPLICIT_INSTANTIATION
An ExplicitInstantiationDecl 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...
@ CXXAddedAnonymousNamespace
Top level wrappers for InstallAPI frontend operations.
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_Thread
Thread storage duration.
@ SD_Static
Static storage duration.
const FunctionProtoType * T
@ 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.
@ 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...
U cast(CodeGen::Address addr)
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>".
const Expr * ConstraintExpr
UnsignedOrNone ArgPackSubstIndex
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.
uint16_t Part2
...-89ab-...
uint32_t Part1
{01234567-...
uint16_t Part3
...-cdef-...
uint8_t Part4And5[8]
...-0123-456789abcdef}
static DeclType * getDecl(EntryType *D)