23 #include "llvm/ADT/Twine.h"
24 #include "llvm/Bitcode/BitstreamWriter.h"
25 #include "llvm/Support/ErrorHandling.h"
26 using namespace clang;
27 using namespace serialization;
45 : Writer(Writer), Context(Context), Record(Writer, Record),
46 Code((serialization::
DeclCode)0), AbbrevToUse(0) {}
50 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
51 D->getDeclKindName() +
"'");
52 return Record.Emit(Code, AbbrevToUse);
57 void VisitDecl(
Decl *D);
75 void VisitClassTemplateSpecializationDecl(
77 void VisitClassTemplatePartialSpecializationDecl(
80 void VisitVarTemplatePartialSpecializationDecl(
82 void VisitClassScopeFunctionSpecializationDecl(
153 Record.push_back(typeParams->
size());
154 for (
auto typeParam : *typeParams) {
155 Record.AddDeclRef(typeParam);
157 Record.AddSourceLocation(typeParams->getLAngleLoc());
158 Record.AddSourceLocation(typeParams->getRAngleLoc());
165 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
167 for (
const Decl *R = D->getMostRecentDecl(); R; R = R->getPreviousDecl()) {
168 if (R->isFromASTFile())
169 Firsts[Writer.Chain->getOwningModuleFile(R)] = R;
170 else if (IncludeLocal)
173 for (
const auto &F : Firsts)
174 Record.AddDeclRef(F.second);
178 template <
typename EntryType>
187 return Common->PartialSpecializations;
193 template<
typename DeclTy>
195 auto *Common = D->getCommonPtr();
200 if (Writer.Chain != Writer.Context->getExternalSource() &&
201 Common->LazySpecializations) {
202 D->LoadLazySpecializations();
203 assert(!Common->LazySpecializations);
207 if (
auto *LS = Common->LazySpecializations)
208 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
211 unsigned I = Record.size();
217 for (
auto &Entry : Common->Specializations)
218 Specs.push_back(getSpecializationDecl(Entry));
219 for (
auto &Entry : getPartialSpecializations(Common))
220 Specs.push_back(getSpecializationDecl(Entry));
222 for (
auto *D : Specs) {
223 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
224 AddFirstDeclFromEachModule(D,
true);
226 Record.append(LazySpecializations.begin(), LazySpecializations.end());
229 Record[
I] = Record.size() - I - 1;
235 const Decl *Specialization) {
236 Template = Template->getCanonicalDecl();
242 if (!Template->isFromASTFile())
247 if (Writer.getFirstLocalDecl(Specialization) != Specialization)
250 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
263 Record.AddTypeSourceInfo(DD->getTypeSourceInfo());
270 Record.push_back(FD->doesThisDeclarationHaveABody());
271 if (FD->doesThisDeclarationHaveABody())
272 Record.AddFunctionDefinition(FD);
279 VisitDeclContext(DC);
283 Record.AddDeclRef(cast_or_null<Decl>(D->getDeclContext()));
284 if (D->getDeclContext() != D->getLexicalDeclContext())
285 Record.AddDeclRef(cast_or_null<Decl>(D->getLexicalDeclContext()));
288 Record.push_back(D->isInvalidDecl());
289 Record.push_back(D->hasAttrs());
291 Record.AddAttributes(D->getAttrs());
292 Record.push_back(D->isImplicit());
293 Record.push_back(D->isUsed(
false));
294 Record.push_back(D->isReferenced());
295 Record.push_back(D->isTopLevelDeclInObjCContainer());
296 Record.push_back(D->getAccess());
297 Record.push_back(D->isModulePrivate());
298 Record.push_back(Writer.inferSubmoduleIDFromLocation(D->getLocation()));
308 if (D->isOutOfLine()) {
309 auto *DC = D->getDeclContext();
310 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
311 if (!NS->isFromASTFile())
313 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
314 if (!NS->isInlineNamespace())
316 DC = NS->getParent();
322 StringRef Arg = D->
getArg();
323 Record.push_back(Arg.size());
325 Record.AddSourceLocation(D->getLocStart());
327 Record.AddString(Arg);
335 Record.push_back(Name.size() + 1 + Value.size());
337 Record.AddSourceLocation(D->getLocStart());
338 Record.AddString(Name);
339 Record.AddString(Value);
344 llvm_unreachable(
"Translation units aren't directly serialized");
351 ? Writer.getAnonymousDeclarationNumber(D)
362 VisitRedeclarable(D);
365 Record.push_back(D->
isModed());
371 VisitTypedefNameDecl(D);
372 if (D->getDeclContext() == D->getLexicalDeclContext() &&
376 !D->isInvalidDecl() &&
377 !D->isTopLevelDeclInObjCContainer() &&
378 !D->isModulePrivate() &&
381 AbbrevToUse = Writer.getDeclTypedefAbbrev();
387 VisitTypedefNameDecl(D);
393 VisitRedeclarable(D);
395 Record.push_back(D->getIdentifierNamespace());
397 if (!isa<CXXRecordDecl>(D))
404 if (D->hasExtInfo()) {
406 Record.AddQualifierInfo(*D->getExtInfo());
409 Record.AddDeclRef(TD);
410 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
426 Record.push_back(D->
isFixed());
428 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
429 Record.push_back(MemberInfo->getTemplateSpecializationKind());
430 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
432 Record.AddDeclRef(
nullptr);
435 if (D->getDeclContext() == D->getLexicalDeclContext() &&
442 !D->isInvalidDecl() &&
443 !D->isReferenced() &&
444 !D->isTopLevelDeclInObjCContainer() &&
446 !D->isModulePrivate() &&
452 AbbrevToUse = Writer.getDeclEnumAbbrev();
464 if (D->getDeclContext() == D->getLexicalDeclContext() &&
471 !D->isInvalidDecl() &&
472 !D->isReferenced() &&
473 !D->isTopLevelDeclInObjCContainer() &&
475 !D->isModulePrivate() &&
479 AbbrevToUse = Writer.getDeclRecordAbbrev();
486 Record.AddTypeRef(D->
getType());
502 Record.push_back(D->hasExtInfo());
504 Record.AddQualifierInfo(*D->getExtInfo());
508 VisitRedeclarable(D);
509 VisitDeclaratorDecl(D);
510 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
511 Record.push_back(D->getIdentifierNamespace());
516 Record.push_back((
int)D->SClass);
517 Record.push_back(D->IsInline);
518 Record.push_back(D->IsInlineSpecified);
519 Record.push_back(D->IsVirtualAsWritten);
520 Record.push_back(D->IsPure);
521 Record.push_back(D->HasInheritedPrototype);
522 Record.push_back(D->HasWrittenPrototype);
523 Record.push_back(D->IsDeleted);
524 Record.push_back(D->IsTrivial);
525 Record.push_back(D->IsDefaulted);
526 Record.push_back(D->IsExplicitlyDefaulted);
527 Record.push_back(D->HasImplicitReturnZero);
528 Record.push_back(D->IsConstexpr);
529 Record.push_back(D->HasSkippedBody);
530 Record.push_back(D->IsLateTemplateParsed);
532 Record.AddSourceLocation(D->getLocEnd());
552 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
566 Record.AddTemplateArgumentLoc(
574 if (D->isCanonicalDecl()) {
602 Record.AddDeclRef(
P);
610 bool HasBodyStuff = D->
getBody() !=
nullptr ||
612 Record.push_back(HasBodyStuff);
622 Record.push_back(D->IsOverriding);
623 Record.push_back(D->HasSkippedBody);
625 Record.push_back(D->IsRedeclaration);
626 Record.push_back(D->HasRedeclaration);
627 if (D->HasRedeclaration) {
639 Record.AddSourceLocation(D->
getLocEnd());
642 Record.AddDeclRef(
P);
644 Record.push_back(D->SelLocsKind);
645 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
647 Record.push_back(NumStoredSelLocs);
648 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
649 Record.AddSourceLocation(SelLocs[i]);
655 VisitTypedefNameDecl(D);
656 Record.push_back(D->Variance);
657 Record.push_back(D->Index);
658 Record.AddSourceLocation(D->VarianceLoc);
659 Record.AddSourceLocation(D->ColonLoc);
672 VisitRedeclarable(D);
673 VisitObjCContainerDecl(D);
675 AddObjCTypeParamList(D->TypeParamList);
680 ObjCInterfaceDecl::DefinitionData &Data = D->data();
684 Record.push_back(Data.HasDesignatedInitializers);
687 Record.push_back(Data.ReferencedProtocols.size());
689 Record.AddDeclRef(
P);
691 Record.AddSourceLocation(PL);
694 Record.push_back(Data.AllReferencedProtocols.size());
696 P = Data.AllReferencedProtocols.begin(),
697 PEnd = Data.AllReferencedProtocols.end();
699 Record.AddDeclRef(*
P);
704 Writer.ObjCClassesWithCategories.insert(D);
707 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
708 (
void)Writer.GetDeclRef(Cat);
721 if (D->getDeclContext() == D->getLexicalDeclContext() &&
725 !D->isInvalidDecl() &&
726 !D->isReferenced() &&
727 !D->isModulePrivate() &&
731 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
737 VisitRedeclarable(D);
738 VisitObjCContainerDecl(D);
744 Record.AddDeclRef(
I);
746 Record.AddSourceLocation(PL);
758 VisitObjCContainerDecl(D);
763 AddObjCTypeParamList(D->TypeParamList);
766 Record.AddDeclRef(
I);
768 Record.AddSourceLocation(PL);
780 Record.AddSourceLocation(D->
getAtLoc());
782 Record.AddTypeRef(D->
getType());
798 VisitObjCContainerDecl(D);
804 VisitObjCImplDecl(D);
811 VisitObjCImplDecl(D);
818 Record.push_back(D->NumIvarInitializers);
819 if (D->NumIvarInitializers)
820 Record.AddCXXCtorInitializers(
837 VisitDeclaratorDecl(D);
839 if (D->InitStorage.getInt() == FieldDecl::ISK_BitWidthOrNothing &&
840 D->InitStorage.getPointer() ==
nullptr) {
842 }
else if (D->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) {
843 Record.push_back(D->InitStorage.getInt() + 1);
845 QualType(static_cast<Type *>(D->InitStorage.getPointer()), 0));
847 Record.push_back(D->InitStorage.getInt() + 1);
848 Record.AddStmt(static_cast<Expr *>(D->InitStorage.getPointer()));
853 if (D->getDeclContext() == D->getLexicalDeclContext() &&
857 !D->isInvalidDecl() &&
858 !D->isReferenced() &&
859 !D->isTopLevelDeclInObjCContainer() &&
860 !D->isModulePrivate() &&
867 AbbrevToUse = Writer.getDeclFieldAbbrev();
873 VisitDeclaratorDecl(D);
883 for (
const auto *
P : D->
chain())
884 Record.AddDeclRef(
P);
889 VisitRedeclarable(D);
890 VisitDeclaratorDecl(D);
894 if (!isa<ParmVarDecl>(D)) {
915 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
918 Record.push_back(VarTemplate);
919 Record.AddDeclRef(TemplD);
922 Record.push_back(StaticDataMemberSpecialization);
923 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
924 Record.push_back(SpecInfo->getTemplateSpecializationKind());
925 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
927 Record.push_back(VarNotTemplate);
930 if (D->getDeclContext() == D->getLexicalDeclContext() &&
934 !D->isInvalidDecl() &&
935 !D->isReferenced() &&
936 !D->isTopLevelDeclInObjCContainer() &&
938 !D->isModulePrivate() &&
945 !isa<ParmVarDecl>(D) &&
946 !isa<VarTemplateSpecializationDecl>(D) &&
952 AbbrevToUse = Writer.getDeclVarAbbrev();
980 if (D->getDeclContext() == D->getLexicalDeclContext() &&
985 !D->isInvalidDecl() &&
986 !D->isReferenced() &&
988 !D->isModulePrivate() &&
997 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1001 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1002 assert(D->getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1004 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1006 "PARM_VAR_DECL can't be static data member");
1027 Record.AddDeclRef(
P);
1033 for (
const auto &capture : D->
captures()) {
1034 Record.AddDeclRef(capture.getVariable());
1037 if (capture.isByRef()) flags |= 1;
1038 if (capture.isNested()) flags |= 2;
1039 if (capture.hasCopyExpr()) flags |= 4;
1040 Record.push_back(flags);
1042 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1052 Record.push_back(CD->
isNothrow() ? 1 : 0);
1069 Record.AddSourceLocation(D->getLocStart());
1075 VisitRedeclarable(D);
1091 Decl *Parent = cast<Decl>(
1093 if (Parent->isFromASTFile() || isa<TranslationUnitDecl>(Parent)) {
1094 Writer.DeclUpdates[Parent].push_back(
1101 VisitRedeclarable(D);
1114 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1115 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1122 VisitRedeclarable(D);
1125 Record.AddDeclRef(D->UsingOrNextShadow);
1132 VisitUsingShadowDecl(D);
1133 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1134 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1135 Record.push_back(D->IsVirtual);
1153 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1169 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1172 Record.push_back(CXXRecTemplate);
1173 Record.AddDeclRef(TemplD);
1176 Record.push_back(CXXRecMemberSpecialization);
1177 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1178 Record.push_back(MSInfo->getTemplateSpecializationKind());
1179 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1181 Record.push_back(CXXRecNotTemplate);
1186 Record.AddCXXDefinitionData(D);
1190 if (D->IsCompleteDefinition)
1197 VisitFunctionDecl(D);
1198 if (D->isCanonicalDecl()) {
1203 Record.AddDeclRef(*
I);
1206 Record.push_back(0);
1209 if (D->getDeclContext() == D->getLexicalDeclContext() &&
1211 !D->isInvalidDecl() &&
1213 !D->isTopLevelDeclInObjCContainer() &&
1218 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1225 Record.AddDeclRef(Inherited.getShadowDecl());
1226 Record.AddDeclRef(Inherited.getConstructor());
1232 VisitCXXMethodDecl(D);
1234 Record.push_back(D->IsExplicitSpecified);
1242 VisitCXXMethodDecl(D);
1250 VisitCXXMethodDecl(D);
1251 Record.push_back(D->IsExplicitSpecified);
1259 Record.push_back(!IdentifierLocs.empty());
1260 if (IdentifierLocs.empty()) {
1261 Record.AddSourceLocation(D->getLocEnd());
1262 Record.push_back(1);
1264 for (
unsigned I = 0, N = IdentifierLocs.size();
I != N; ++
I)
1265 Record.AddSourceLocation(IdentifierLocs[
I]);
1266 Record.push_back(IdentifierLocs.size());
1282 Record.push_back(D->NumTPLists);
1284 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1285 Record.push_back(hasFriendDecl);
1290 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1292 Record.AddDeclRef(D->getNextFriend());
1293 Record.push_back(D->UnsupportedFriend);
1294 Record.AddSourceLocation(D->FriendLoc);
1320 VisitRedeclarable(D);
1331 VisitTemplateDecl(D);
1332 Record.push_back(D->getIdentifierNamespace());
1336 VisitRedeclarableTemplateDecl(D);
1339 AddTemplateSpecializations(D);
1347 VisitCXXRecordDecl(D);
1352 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1353 Record.AddDeclRef(InstFromD);
1362 Record.push_back(D->isCanonicalDecl());
1364 if (D->isCanonicalDecl()) {
1381 VisitClassTemplateSpecializationDecl(D);
1396 VisitRedeclarableTemplateDecl(D);
1399 AddTemplateSpecializations(D);
1409 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1412 Record.AddDeclRef(InstFromD);
1428 Record.push_back(D->isCanonicalDecl());
1430 if (D->isCanonicalDecl()) {
1440 VisitVarTemplateSpecializationDecl(D);
1463 VisitRedeclarableTemplateDecl(D);
1466 AddTemplateSpecializations(D);
1477 Record.push_back(OwnsDefaultArg);
1491 VisitDeclaratorDecl(D);
1508 Record.push_back(OwnsDefaultArg);
1522 VisitTemplateDecl(D);
1537 Record.push_back(OwnsDefaultArg);
1545 VisitRedeclarableTemplateDecl(D);
1560 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(
Context, DC));
1561 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(
Context, DC));
1565 assert(IsLocalDecl(D) &&
"expected a local declaration");
1567 const Decl *Canon = D->getCanonicalDecl();
1568 if (IsLocalDecl(Canon))
1571 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1575 for (
const Decl *Redecl = D; Redecl; Redecl = Redecl->getPreviousDecl())
1576 if (IsLocalDecl(Redecl))
1578 return CacheEntry = D;
1581 template <
typename T>
1584 T *MostRecent = First->getMostRecentDecl();
1585 T *DAsT =
static_cast<T *
>(D);
1586 if (MostRecent != First) {
1588 "Not considered redeclarable?");
1590 Record.AddDeclRef(First);
1594 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1595 if (DAsT == FirstLocal) {
1599 unsigned I = Record.size();
1600 Record.push_back(0);
1602 AddFirstDeclFromEachModule(DAsT,
false);
1604 Record[
I] = Record.size() -
I;
1610 for (
const Decl *Prev = FirstLocal->getMostRecentDecl();
1611 Prev != FirstLocal; Prev = Prev->getPreviousDecl())
1612 if (!Prev->isFromASTFile())
1617 if (LocalRedecls.empty())
1618 Record.push_back(0);
1622 Record.push_back(0);
1623 Record.AddDeclRef(FirstLocal);
1633 (void)Writer.GetDeclRef(MostRecent);
1636 Record.push_back(0);
1650 Record.AddSourceLocation(D->getLocStart());
1666 void ASTWriter::WriteDeclAbbrevs() {
1667 using namespace llvm;
1672 Abv =
new BitCodeAbbrev();
1675 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1676 Abv->Add(BitCodeAbbrevOp(0));
1677 Abv->Add(BitCodeAbbrevOp(0));
1678 Abv->Add(BitCodeAbbrevOp(0));
1679 Abv->Add(BitCodeAbbrevOp(0));
1680 Abv->Add(BitCodeAbbrevOp(0));
1681 Abv->Add(BitCodeAbbrevOp(0));
1682 Abv->Add(BitCodeAbbrevOp(0));
1683 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1684 Abv->Add(BitCodeAbbrevOp(0));
1685 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1687 Abv->Add(BitCodeAbbrevOp(0));
1688 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1689 Abv->Add(BitCodeAbbrevOp(0));
1691 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1693 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1694 Abv->Add(BitCodeAbbrevOp(0));
1696 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1697 Abv->Add(BitCodeAbbrevOp(0));
1699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1700 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1701 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1702 DeclFieldAbbrev = Stream.EmitAbbrev(Abv);
1705 Abv =
new BitCodeAbbrev();
1708 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1709 Abv->Add(BitCodeAbbrevOp(0));
1710 Abv->Add(BitCodeAbbrevOp(0));
1711 Abv->Add(BitCodeAbbrevOp(0));
1712 Abv->Add(BitCodeAbbrevOp(0));
1713 Abv->Add(BitCodeAbbrevOp(0));
1714 Abv->Add(BitCodeAbbrevOp(0));
1715 Abv->Add(BitCodeAbbrevOp(0));
1716 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1717 Abv->Add(BitCodeAbbrevOp(0));
1718 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1720 Abv->Add(BitCodeAbbrevOp(0));
1721 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1722 Abv->Add(BitCodeAbbrevOp(0));
1724 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1726 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1727 Abv->Add(BitCodeAbbrevOp(0));
1729 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1730 Abv->Add(BitCodeAbbrevOp(0));
1732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1733 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1735 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1736 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1737 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1738 DeclObjCIvarAbbrev = Stream.EmitAbbrev(Abv);
1741 Abv =
new BitCodeAbbrev();
1744 Abv->Add(BitCodeAbbrevOp(0));
1746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1747 Abv->Add(BitCodeAbbrevOp(0));
1748 Abv->Add(BitCodeAbbrevOp(0));
1749 Abv->Add(BitCodeAbbrevOp(0));
1750 Abv->Add(BitCodeAbbrevOp(0));
1751 Abv->Add(BitCodeAbbrevOp(0));
1752 Abv->Add(BitCodeAbbrevOp(0));
1753 Abv->Add(BitCodeAbbrevOp(0));
1754 Abv->Add(BitCodeAbbrevOp(
AS_none));
1755 Abv->Add(BitCodeAbbrevOp(0));
1756 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1758 Abv->Add(BitCodeAbbrevOp(0));
1759 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1760 Abv->Add(BitCodeAbbrevOp(0));
1762 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1763 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1765 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1766 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1767 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1768 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1769 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1771 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1772 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1773 Abv->Add(BitCodeAbbrevOp(0));
1775 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1776 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1777 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1778 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1780 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1781 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1783 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1785 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1786 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1787 DeclEnumAbbrev = Stream.EmitAbbrev(Abv);
1790 Abv =
new BitCodeAbbrev();
1793 Abv->Add(BitCodeAbbrevOp(0));
1795 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1796 Abv->Add(BitCodeAbbrevOp(0));
1797 Abv->Add(BitCodeAbbrevOp(0));
1798 Abv->Add(BitCodeAbbrevOp(0));
1799 Abv->Add(BitCodeAbbrevOp(0));
1800 Abv->Add(BitCodeAbbrevOp(0));
1801 Abv->Add(BitCodeAbbrevOp(0));
1802 Abv->Add(BitCodeAbbrevOp(0));
1803 Abv->Add(BitCodeAbbrevOp(
AS_none));
1804 Abv->Add(BitCodeAbbrevOp(0));
1805 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1807 Abv->Add(BitCodeAbbrevOp(0));
1808 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1809 Abv->Add(BitCodeAbbrevOp(0));
1811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1812 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1814 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1815 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1816 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1817 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1818 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1819 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1820 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1821 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1822 Abv->Add(BitCodeAbbrevOp(0));
1824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1825 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1826 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1827 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1831 DeclRecordAbbrev = Stream.EmitAbbrev(Abv);
1834 Abv =
new BitCodeAbbrev();
1837 Abv->Add(BitCodeAbbrevOp(0));
1839 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1840 Abv->Add(BitCodeAbbrevOp(0));
1841 Abv->Add(BitCodeAbbrevOp(0));
1842 Abv->Add(BitCodeAbbrevOp(0));
1843 Abv->Add(BitCodeAbbrevOp(0));
1844 Abv->Add(BitCodeAbbrevOp(0));
1845 Abv->Add(BitCodeAbbrevOp(0));
1846 Abv->Add(BitCodeAbbrevOp(0));
1847 Abv->Add(BitCodeAbbrevOp(
AS_none));
1848 Abv->Add(BitCodeAbbrevOp(0));
1849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1851 Abv->Add(BitCodeAbbrevOp(0));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1853 Abv->Add(BitCodeAbbrevOp(0));
1855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1858 Abv->Add(BitCodeAbbrevOp(0));
1860 Abv->Add(BitCodeAbbrevOp(0));
1861 Abv->Add(BitCodeAbbrevOp(0));
1862 Abv->Add(BitCodeAbbrevOp(0));
1863 Abv->Add(BitCodeAbbrevOp(0));
1864 Abv->Add(BitCodeAbbrevOp(0));
1865 Abv->Add(BitCodeAbbrevOp(0));
1867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1868 Abv->Add(BitCodeAbbrevOp(0));
1869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1870 Abv->Add(BitCodeAbbrevOp(0));
1871 Abv->Add(BitCodeAbbrevOp(0));
1872 Abv->Add(BitCodeAbbrevOp(0));
1873 Abv->Add(BitCodeAbbrevOp(0));
1875 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1876 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1878 DeclParmVarAbbrev = Stream.EmitAbbrev(Abv);
1881 Abv =
new BitCodeAbbrev();
1884 Abv->Add(BitCodeAbbrevOp(0));
1886 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1887 Abv->Add(BitCodeAbbrevOp(0));
1888 Abv->Add(BitCodeAbbrevOp(0));
1889 Abv->Add(BitCodeAbbrevOp(0));
1890 Abv->Add(BitCodeAbbrevOp(0));
1891 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1892 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1893 Abv->Add(BitCodeAbbrevOp(0));
1894 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1895 Abv->Add(BitCodeAbbrevOp(0));
1896 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1898 Abv->Add(BitCodeAbbrevOp(0));
1899 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1900 Abv->Add(BitCodeAbbrevOp(0));
1902 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1907 DeclTypedefAbbrev = Stream.EmitAbbrev(Abv);
1910 Abv =
new BitCodeAbbrev();
1913 Abv->Add(BitCodeAbbrevOp(0));
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1916 Abv->Add(BitCodeAbbrevOp(0));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(0));
1919 Abv->Add(BitCodeAbbrevOp(0));
1920 Abv->Add(BitCodeAbbrevOp(0));
1921 Abv->Add(BitCodeAbbrevOp(0));
1922 Abv->Add(BitCodeAbbrevOp(0));
1923 Abv->Add(BitCodeAbbrevOp(
AS_none));
1924 Abv->Add(BitCodeAbbrevOp(0));
1925 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1927 Abv->Add(BitCodeAbbrevOp(0));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1929 Abv->Add(BitCodeAbbrevOp(0));
1931 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1934 Abv->Add(BitCodeAbbrevOp(0));
1936 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1937 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1939 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1940 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1941 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1942 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1943 Abv->Add(BitCodeAbbrevOp(0));
1944 Abv->Add(BitCodeAbbrevOp(0));
1945 Abv->Add(BitCodeAbbrevOp(0));
1946 Abv->Add(BitCodeAbbrevOp(0));
1947 Abv->Add(BitCodeAbbrevOp(0));
1948 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1953 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1955 DeclVarAbbrev = Stream.EmitAbbrev(Abv);
1958 Abv =
new BitCodeAbbrev();
1961 Abv->Add(BitCodeAbbrevOp(0));
1963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1964 Abv->Add(BitCodeAbbrevOp(0));
1965 Abv->Add(BitCodeAbbrevOp(0));
1966 Abv->Add(BitCodeAbbrevOp(0));
1967 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1968 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1969 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1970 Abv->Add(BitCodeAbbrevOp(0));
1971 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1972 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1973 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1977 Abv->Add(BitCodeAbbrevOp(0));
1979 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1981 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1982 Abv->Add(BitCodeAbbrevOp(0));
1984 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
1985 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1987 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1988 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1989 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1990 Abv->Add(BitCodeAbbrevOp(0));
1991 Abv->Add(BitCodeAbbrevOp(1));
1992 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1993 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1994 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1995 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1997 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1998 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2000 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2001 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2011 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2012 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2013 DeclCXXMethodAbbrev = Stream.EmitAbbrev(Abv);
2016 Abv =
new BitCodeAbbrev();
2020 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2021 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2022 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2023 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2024 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2025 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2026 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2029 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2030 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2031 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2032 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2034 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2035 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2036 DeclRefExprAbbrev = Stream.EmitAbbrev(Abv);
2039 Abv =
new BitCodeAbbrev();
2043 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2044 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2045 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2046 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2047 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2048 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2049 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2051 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2052 Abv->Add(BitCodeAbbrevOp(32));
2053 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2054 IntegerLiteralAbbrev = Stream.EmitAbbrev(Abv);
2057 Abv =
new BitCodeAbbrev();
2061 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2062 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2063 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2064 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2065 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2066 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2067 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2069 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2070 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2071 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2072 CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
2075 Abv =
new BitCodeAbbrev();
2079 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2080 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2081 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2082 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2083 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2084 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2085 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2087 Abv->Add(BitCodeAbbrevOp(0));
2088 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2090 ExprImplicitCastAbbrev = Stream.EmitAbbrev(Abv);
2092 Abv =
new BitCodeAbbrev();
2094 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2095 DeclContextLexicalAbbrev = Stream.EmitAbbrev(Abv);
2097 Abv =
new BitCodeAbbrev();
2099 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2100 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(Abv);
2116 bool WritingModule) {
2122 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) ||
2123 D->hasAttr<OMPDeclareTargetDeclAttr>())
2129 if (isa<ImportDecl>(D) && !WritingModule)
2138 assert(!D->isFromASTFile() &&
"should not be emitting imported decl");
2145 assert(ID >= FirstDeclID &&
"invalid decl ID");
2154 uint64_t
Offset = W.Emit(D);
2158 unsigned Index = ID - FirstDeclID;
2159 if (DeclOffsets.size() == Index)
2160 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2161 else if (DeclOffsets.size() < Index) {
2163 DeclOffsets.resize(Index+1);
2164 DeclOffsets[Index].setLocation(Loc);
2165 DeclOffsets[Index].BitOffset =
Offset;
2167 llvm_unreachable(
"declarations should be emitted in ID order");
2172 associateDeclWithFile(D, ID);
2177 EagerlyDeserializedDecls.push_back(ID);
2182 Writer->ClearSwitchCaseIDs();
2185 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2186 Record->push_back(CD->getNumCtorInitializers());
2187 if (CD->getNumCtorInitializers())
2188 AddCXXCtorInitializers(
2189 llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
A FriendTemplateDecl record.
A NonTypeTemplateParmDecl record.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
void VisitAccessSpecDecl(AccessSpecDecl *D)
protocol_range protocols() const
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
void VisitStaticAssertDecl(StaticAssertDecl *D)
void VisitCXXMethodDecl(CXXMethodDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
A (possibly-)qualified type.
ArrayRef< Capture > captures() const
ImplementationControl getImplementationControl() const
unsigned getNumTemplates() const
Returns the number of function templates that this might be a specialization of.
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
ObjCInterfaceDecl * getClassInterface()
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
void VisitRedeclarable(Redeclarable< T > *D)
void VisitEmptyDecl(EmptyDecl *D)
void RegisterTemplateSpecialization(const Decl *Template, const Decl *Specialization)
Ensure that this template specialization is associated with the specified template on reload...
void VisitTypedefNameDecl(TypedefNameDecl *D)
An OMPThreadPrivateDecl record.
PropertyControl getPropertyImplementation() const
CXXMethodDecl * getSpecialization() const
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
const Expr * getInitExpr() const
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
void VisitCXXRecordDecl(CXXRecordDecl *D)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
An OMPDeclareReductionDecl record.
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
QualType getUnderlyingType() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
An ImplicitCastExpr record.
A VarTemplatePartialSpecializationDecl record.
Defines the C++ template declaration subclasses.
bool hasFlexibleArrayMember() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
A record that stores the set of declarations that are lexically stored within a given DeclContext...
Represents an empty-declaration.
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record)
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
Declaration of a variable template.
const Expr * getInit() const
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
NamespaceDecl - Represent a C++ namespace.
A ObjCPropertyDecl record.
ObjCDeclQualifier getObjCDeclQualifier() const
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
protocol_range protocols() const
Represents a C++ constructor within a class.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
ArrayRef< Decl > getPartialSpecializations(FunctionTemplateDecl::Common *)
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
FunctionTemplateDecl * getTemplate(unsigned I) const
Returns the i'th template candidate.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
A ClassTemplateDecl record.
A PragmaDetectMismatchDecl record.
An UnresolvedUsingTypenameDecl record.
void VisitBlockDecl(BlockDecl *D)
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
void VisitImplicitParamDecl(ImplicitParamDecl *D)
const Type * getTypeForDecl() const
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Expr * getSetterCXXAssignment() const
Declaration of a redeclarable template.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
bool capturesCXXThis() const
bool isInlineSpecified() const
An OMPCapturedExprDecl record.
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
SourceLocation getRParenLoc() const
A UsingShadowDecl record.
SourceLocation getIvarRBraceLoc() const
TypeSourceInfo * getSuperClassTInfo() const
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
SourceLocation getRAngleLoc() const
unsigned param_size() const
unsigned size() const
Determine the number of type parameters in this list.
A TemplateTemplateParmDecl record.
ParmVarDecl - Represents a parameter to a function.
A ObjCInterfaceDecl record.
Provides information about a dependent function-template specialization declaration.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the category interface associated with this implementat...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
TypeSourceInfo * getTypeSourceInfo() const
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
A CXXConstructorDecl record for an inherited constructor.
RecordDecl - Represents a struct/union/class.
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
bool hasUninstantiatedDefaultArg() const
Provides common interface for the Decls that can be redeclared.
Represents a class template specialization, which refers to a class template with a given set of temp...
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
method_iterator end_overridden_methods() const
StringLiteral * getMessage()
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
protocol_loc_range protocol_locs() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
ImplicitParamDecl * getCmdDecl() const
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
TagKind getTagKind() const
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
TypeSourceInfo * getFriendType() const
If this friend declaration names a templated type (or a dependent member type of a templated type)...
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
Stmt * getBody() const override
void VisitParmVarDecl(ParmVarDecl *D)
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
Represents an access specifier followed by colon ':'.
Declaration of a function specialization at template class scope.
unsigned getNumCaptures() const
getNumCaptures - Returns the number of captured variables.
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
SourceLocation getCategoryNameLoc() const
StorageClass getStorageClass() const
Returns the storage class as written in the source.
A IndirectFieldDecl record.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
Provides information about a function template specialization, which is a FunctionDecl that has been ...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents a C++ using-declaration.
ImplicitParamDecl * getParam(unsigned i) const
const TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
FunctionTemplateDecl * getCanonicalDecl() override
void VisitLabelDecl(LabelDecl *LD)
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void VisitClassTemplateDecl(ClassTemplateDecl *D)
IdentifierInfo * getSetterId() const
ObjCContainerDecl - Represents a container for method declarations.
protocol_loc_range protocol_locs() const
bool isInline() const
Returns true if this is an inline namespace declaration.
void VisitTypedefDecl(TypedefDecl *D)
An AccessSpecDecl record.
SourceLocation getIvarLBraceLoc() const
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
SourceLocation getRBraceLoc() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
void VisitUsingShadowDecl(UsingShadowDecl *D)
A ConstructorUsingShadowDecl record.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
A UsingDirecitveDecl record.
TypeDecl - Represents a declaration of a type.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
Expr * getGetterCXXConstructor() const
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
unsigned getNumTemplateParameters() const
Selector getSetterName() const
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
A ClassTemplateSpecializationDecl record.
Represents an Objective-C protocol declaration.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a linkage specification.
detail::InMemoryDirectory::const_iterator I
PropertyAttributeKind getPropertyAttributes() const
size_t param_size() const
SourceLocation getIvarLBraceLoc() const
SourceLocation getAtStartLoc() const
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
SourceLocation getAtLoc() const
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
unsigned getNumParams() const
SourceRange getAtEndRange() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
void VisitObjCContainerDecl(ObjCContainerDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
RecordDecl * getMostRecentDecl()
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
bool isConversionFromLambda() const
SourceLocation getLocStart() const LLVM_READONLY
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Represents a ValueDecl that came out of a declarator.
unsigned getChainingSize() const
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
ObjCDeclQualifier getObjCDeclQualifier() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
A StaticAssertDecl record.
SourceLocation getSuperClassLoc() const
A VarTemplateSpecializationDecl record.
const CXXMethodDecl *const * method_iterator
static bool classofKind(Kind K)
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
An ObjCTypeParamDecl record.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
const Type * getTypeForDecl() const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
A ObjCCategoryImplDecl record.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
A ObjCPropertyImplDecl record.
void VisitRecordDecl(RecordDecl *D)
Declaration of a template type parameter.
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type)...
ObjCIvarDecl * getPropertyIvarDecl() const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name...
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
Expr * getBitWidth() const
ArrayRef< NamedDecl * > chain() const
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D...
Represents a C++ destructor within a class.
A CXXConstructorDecl record.
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
void VisitTemplateDecl(TemplateDecl *D)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
void VisitUsingDecl(UsingDecl *D)
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
A VarTemplateDecl record.
ImplicitParamDecl * getSelfDecl() const
unsigned getContextParamPosition() const
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
EnumDecl * getMostRecentDecl()
bool isObjCMethodParameter() const
A CXXDestructorDecl record.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
SourceLocation getRParenLoc() const
bool isInstanceMethod() const
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
A NamespaceAliasDecl record.
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
ArrayRef< ParmVarDecl * > parameters() const
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
NamedDecl * getInstantiatedFromUsingDecl(UsingDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
protocol_loc_range protocol_locs() const
An ImplicitParamDecl record.
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
Represents a C++ conversion function within a class.
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
An EnumConstantDecl record.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
void VisitTagDecl(TagDecl *D)
An ImportDecl recording a module import.
A ObjCCategoryDecl record.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
TypedefNameDecl * getTypedefNameForAnonDecl() const
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
CXXMethodDecl * getMostRecentDecl()
TypeSourceInfo * getReturnTypeSourceInfo() const
static DeclType * getDecl(EntryType *D)
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
A FileScopeAsmDecl record.
void VisitMSPropertyDecl(MSPropertyDecl *D)
A ObjCCompatibleAliasDecl record.
void VisitVarTemplateDecl(VarTemplateDecl *D)
void VisitTypeAliasDecl(TypeAliasDecl *D)
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
bool isEmbeddedInDeclarator() const
ArrayRef< ParmVarDecl * > parameters() const
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
bool doesThisDeclarationHaveABody() const
doesThisDeclarationHaveABody - Returns whether this specific declaration of the function has a body -...
StringRef getValue() const
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
An UnresolvedUsingValueDecl record.
SourceLocation getExternLoc() const
IdentifierInfo * getGetterId() const
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
TypeSourceInfo * getDefaultArgumentInfo() const
Retrieves the default argument's source information, if any.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Encodes a location in the source.
unsigned protocol_size() const
This represents '#pragma omp declare reduction ...' directive.
A record that stores the set of declarations that are visible from a given DeclContext.
method_iterator begin_overridden_methods() const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
Pseudo declaration for capturing expressions.
void VisitObjCImplDecl(ObjCImplDecl *D)
const ObjCInterfaceDecl * getClassInterface() const
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
SourceLocation getLocStart() const LLVM_READONLY
SourceRange getBraceRange() const
bool isValid() const
Return true if this is a valid SourceLocation object.
TagDecl - Represents the declaration of a struct/union/class/enum.
unsigned size_overridden_methods() const
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
ObjCList - This is a simple template class used to hold various lists of decls etc, which is heavily used by the ObjC front-end.
LabelDecl - Represents the declaration of a label.
Represents a dependent using declaration which was not marked with typename.
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or NULL if this template was ...
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
bool getSynthesize() const
Represents a static or instance method of a struct/union/class.
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
bool blockMissingReturnType() const
C-style initialization with assignment.
ArrayRef< ParmVarDecl * > parameters() const
bool isMemberSpecialization()
Determines whether this variable template partial specialization was a specialization of a member par...
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
A TemplateTypeParmDecl record.
Data that is common to all of the declarations of a given function template.
ObjCCategoryDecl - Represents a category declaration.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
const ObjCInterfaceDecl * getClassInterface() const
bool isPropertyAccessor() const
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
bool hasVolatileMember() const
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
void VisitCapturedDecl(CapturedDecl *D)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
ThreadStorageClassSpecifier getTSCSpec() const
Represents one property declaration in an Objective-C interface.
A simple visitor class that helps create declaration visitors.
QualType getReturnType() const
Represents a C++11 static_assert declaration.
bool hasObjectMember() const
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
SourceLocation getCategoryNameLoc() const
const TemplateArgumentLoc & getTemplateArg(unsigned I) const
Returns the nth template argument.
unsigned varlist_size() const
SourceLocation getLParenLoc() const
bool isLocalSourceLocation(SourceLocation Loc) const
Returns true if Loc did not come from a PCH/Module.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
SourceLocation getUsingLoc() const
Return the location of the using keyword.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
A ObjCProtocolDecl record.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
Base class for declarations which introduce a typedef-name.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
A CXXConversionDecl record.
void VisitFieldDecl(FieldDecl *D)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
void AddTemplateSpecializations(DeclTy *D)
An IntegerLiteral record.
bool hasTypename() const
Return true if the using declaration has 'typename'.
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
The base class of all kinds of template declarations (e.g., class, function, etc.).
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
ObjCIvarDecl * getPropertyIvarDecl() const
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
void VisitNamedDecl(NamedDecl *D)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
bool isFreeStanding() const
A ClassTemplatePartialSpecializationDecl record.
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
DeclCode
Record codes for each kind of declaration.
const llvm::APSInt & getInitVal() const
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
void VisitTypeDecl(TypeDecl *D)
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
bool hasWrittenPrototype() const
SourceLocation getPropertyIvarDeclLoc() const
Represents a dependent using declaration which was marked with typename.
A ClassScopeFunctionSpecializationDecl record a class scope function specialization.
Represents the declaration of an Objective-C type parameter.
A CharacterLiteral record.
Selector getGetterName() const
A LinkageSpecDecl record.
decltype(T::PartialSpecializations)& getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
size_t param_size() const
EnumDecl - Represents an enum.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
unsigned getFunctionScopeDepth() const
detail::InMemoryDirectory::const_iterator E
SourceLocation getEndOfDefinitionLoc() const
void VisitDeclaratorDecl(DeclaratorDecl *D)
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
void VisitEnumDecl(EnumDecl *D)
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
StringRef getName() const
bool hasInheritedDefaultArg() const
A PragmaCommentDecl record.
void VisitNamespaceDecl(NamespaceDecl *D)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
ObjCMethodDecl * getGetterMethodDecl() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
void VisitVarDecl(VarDecl *D)
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
Expr * getUninstantiatedDefaultArg()
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
ObjCMethodDecl * getSetterMethodDecl() const
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
ClassTemplateDecl * getCanonicalDecl() override
unsigned getNumTemplateArgs() const
Returns the number of explicit template arguments that were given.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
SourceLocation getRBraceLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
unsigned protocol_size() const
protocol_range protocols() const
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void VisitFunctionDecl(FunctionDecl *D)
bool isStaticDataMember() const
Determines whether this is a static data member.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
SourceManager & getSourceManager()
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
static bool classofKind(Kind K)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
ObjCPropertyDecl * getPropertyDecl() const
AccessControl getAccessControl() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
static bool classofKind(Kind K)
Represents a field declaration created by an @defs(...).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or NULL if there isn't one...
Represents a C++ struct/union/class.
TypeSourceInfo * getSignatureAsWritten() const
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
An object for streaming information to a record.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
ObjCIvarDecl - Represents an ObjC instance variable.
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
Provides information a specialization of a member of a class template, which may be a member function...
A ObjCImplementationDecl record.
void VisitEnumConstantDecl(EnumConstantDecl *D)
bool isInline() const
Whether this variable is (C++1z) inline.
A ObjCAtDefsFieldDecl record.
Declaration of a class template.
void VisitCXXConversionDecl(CXXConversionDecl *D)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
Writes an AST file containing the contents of a translation unit.
VarTemplateDecl * getCanonicalDecl() override
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
const FunctionDecl * getOperatorDelete() const
TemplateParameterList * getTemplateParameterList(unsigned i) const
PropertyAttributeKind getPropertyAttributesAsWritten() const
SourceLocation getIvarRBraceLoc() const
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void VisitFriendDecl(FriendDecl *D)
TranslationUnitDecl - The top declaration context.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
static bool isRequiredDecl(const Decl *D, ASTContext &Context, bool WritingModule)
isRequiredDecl - Check if this is a "required" Decl, which must be seen by consumers of the AST...
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
NamedDecl * getMostRecentDecl()
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
A FunctionTemplateDecl record.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
A TypeAliasTemplateDecl record.
void VisitImportDecl(ImportDecl *D)
SourceLocation getLAngleLoc() const
An instance of this class represents the declaration of a property member.
NamedDecl - This represents a decl with a name.
Represents a C++ namespace alias.
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
Declaration of a friend template.
Represents C++ using-directive.
Represents a #pragma detect_mismatch line.
TypeSourceInfo * getTypeSourceInfo() const
void VisitObjCMethodDecl(ObjCMethodDecl *D)
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
This class handles loading and caching of source files into memory.
void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
void VisitValueDecl(ValueDecl *D)
Declaration of a template function.
Source range/offset of a preprocessed entity.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
void VisitObjCIvarDecl(ObjCIvarDecl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
const ObjCInterfaceDecl * getSuperClass() const
const StringLiteral * getAsmString() const