23 #include "llvm/Bitcode/BitstreamWriter.h"
24 #include "llvm/Support/ErrorHandling.h"
25 using namespace clang;
26 using namespace serialization;
44 : Writer(Writer), Context(Context), Record(Writer, Record),
45 Code((serialization::
DeclCode)0), AbbrevToUse(0) {}
49 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
51 return Record.Emit(Code, AbbrevToUse);
56 void VisitDecl(
Decl *D);
74 void VisitClassTemplateSpecializationDecl(
76 void VisitClassTemplatePartialSpecializationDecl(
79 void VisitVarTemplatePartialSpecializationDecl(
81 void VisitClassScopeFunctionSpecializationDecl(
157 Record.push_back(typeParams->
size());
158 for (
auto typeParam : *typeParams) {
159 Record.AddDeclRef(typeParam);
161 Record.AddSourceLocation(typeParams->getLAngleLoc());
162 Record.AddSourceLocation(typeParams->getRAngleLoc());
169 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
172 if (R->isFromASTFile())
173 Firsts[Writer.Chain->getOwningModuleFile(R)] = R;
174 else if (IncludeLocal)
177 for (
const auto &F : Firsts)
178 Record.AddDeclRef(F.second);
182 template <
typename EntryType>
191 return Common->PartialSpecializations;
197 template<
typename DeclTy>
199 auto *Common = D->getCommonPtr();
204 if (Writer.Chain != Writer.Context->getExternalSource() &&
205 Common->LazySpecializations) {
206 D->LoadLazySpecializations();
207 assert(!Common->LazySpecializations);
211 if (
auto *LS = Common->LazySpecializations)
212 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
215 unsigned I = Record.size();
221 for (
auto &Entry : Common->Specializations)
222 Specs.push_back(getSpecializationDecl(Entry));
223 for (
auto &Entry : getPartialSpecializations(Common))
224 Specs.push_back(getSpecializationDecl(Entry));
226 for (
auto *D : Specs) {
227 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
228 AddFirstDeclFromEachModule(D,
true);
230 Record.append(LazySpecializations.begin(), LazySpecializations.end());
233 Record[
I] = Record.size() - I - 1;
239 const Decl *Specialization) {
251 if (Writer.getFirstLocalDecl(Specialization) != Specialization)
254 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
267 Record.AddTypeSourceInfo(DD->getTypeSourceInfo());
274 Record.push_back(FD->doesThisDeclarationHaveABody());
275 if (FD->doesThisDeclarationHaveABody())
276 Record.AddFunctionDefinition(FD);
283 VisitDeclContext(DC);
295 Record.AddAttributes(D->
getAttrs());
297 Record.push_back(D->
isUsed(
false));
314 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
315 if (!NS->isFromASTFile())
317 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
318 if (!NS->isInlineNamespace())
326 StringRef Arg = D->
getArg();
327 Record.push_back(Arg.size());
331 Record.AddString(Arg);
339 Record.push_back(Name.size() + 1 + Value.size());
342 Record.AddString(Name);
343 Record.AddString(Value);
348 llvm_unreachable(
"Translation units aren't directly serialized");
355 ? Writer.getAnonymousDeclarationNumber(D)
366 VisitRedeclarable(D);
369 Record.push_back(D->
isModed());
376 VisitTypedefNameDecl(D);
386 AbbrevToUse = Writer.getDeclTypedefAbbrev();
392 VisitTypedefNameDecl(D);
398 VisitRedeclarable(D);
402 if (!isa<CXXRecordDecl>(D))
409 if (D->hasExtInfo()) {
411 Record.AddQualifierInfo(*D->getExtInfo());
414 Record.AddDeclRef(TD);
415 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
431 Record.push_back(D->
isFixed());
433 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
434 Record.push_back(MemberInfo->getTemplateSpecializationKind());
435 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
437 Record.AddDeclRef(
nullptr);
457 AbbrevToUse = Writer.getDeclEnumAbbrev();
484 AbbrevToUse = Writer.getDeclRecordAbbrev();
491 Record.AddTypeRef(D->
getType());
507 Record.push_back(D->hasExtInfo());
509 Record.AddQualifierInfo(*D->getExtInfo());
513 VisitRedeclarable(D);
514 VisitDeclaratorDecl(D);
515 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
521 Record.push_back((
int)D->SClass);
522 Record.push_back(D->IsInline);
523 Record.push_back(D->IsInlineSpecified);
525 Record.push_back(D->IsVirtualAsWritten);
526 Record.push_back(D->IsPure);
527 Record.push_back(D->HasInheritedPrototype);
528 Record.push_back(D->HasWrittenPrototype);
529 Record.push_back(D->IsDeleted);
530 Record.push_back(D->IsTrivial);
531 Record.push_back(D->IsDefaulted);
532 Record.push_back(D->IsExplicitlyDefaulted);
533 Record.push_back(D->HasImplicitReturnZero);
534 Record.push_back(D->IsConstexpr);
535 Record.push_back(D->UsesSEHTry);
536 Record.push_back(D->HasSkippedBody);
537 Record.push_back(D->IsLateTemplateParsed);
539 Record.AddSourceLocation(D->
getLocEnd());
559 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
573 Record.AddTemplateArgumentLoc(
609 Record.AddDeclRef(
P);
614 VisitFunctionDecl(D);
622 bool HasBodyStuff = D->
getBody() !=
nullptr ||
624 Record.push_back(HasBodyStuff);
634 Record.push_back(D->IsOverriding);
635 Record.push_back(D->HasSkippedBody);
637 Record.push_back(D->IsRedeclaration);
638 Record.push_back(D->HasRedeclaration);
639 if (D->HasRedeclaration) {
651 Record.AddSourceLocation(D->
getLocEnd());
654 Record.AddDeclRef(
P);
656 Record.push_back(D->SelLocsKind);
657 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
659 Record.push_back(NumStoredSelLocs);
660 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
661 Record.AddSourceLocation(SelLocs[i]);
667 VisitTypedefNameDecl(D);
668 Record.push_back(D->Variance);
669 Record.push_back(D->Index);
670 Record.AddSourceLocation(D->VarianceLoc);
671 Record.AddSourceLocation(D->ColonLoc);
684 VisitRedeclarable(D);
685 VisitObjCContainerDecl(D);
687 AddObjCTypeParamList(D->TypeParamList);
692 ObjCInterfaceDecl::DefinitionData &Data = D->data();
696 Record.push_back(Data.HasDesignatedInitializers);
699 Record.push_back(Data.ReferencedProtocols.size());
701 Record.AddDeclRef(
P);
703 Record.AddSourceLocation(PL);
706 Record.push_back(Data.AllReferencedProtocols.size());
708 P = Data.AllReferencedProtocols.begin(),
709 PEnd = Data.AllReferencedProtocols.end();
711 Record.AddDeclRef(*
P);
716 Writer.ObjCClassesWithCategories.insert(D);
719 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
720 (
void)Writer.GetDeclRef(Cat);
743 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
749 VisitRedeclarable(D);
750 VisitObjCContainerDecl(D);
756 Record.AddDeclRef(
I);
758 Record.AddSourceLocation(PL);
770 VisitObjCContainerDecl(D);
775 AddObjCTypeParamList(D->TypeParamList);
778 Record.AddDeclRef(
I);
780 Record.AddSourceLocation(PL);
792 Record.AddSourceLocation(D->
getAtLoc());
794 Record.AddTypeRef(D->
getType());
812 VisitObjCContainerDecl(D);
818 VisitObjCImplDecl(D);
824 VisitObjCImplDecl(D);
831 Record.push_back(D->NumIvarInitializers);
832 if (D->NumIvarInitializers)
833 Record.AddCXXCtorInitializers(
850 VisitDeclaratorDecl(D);
852 if (D->InitStorage.getInt() == FieldDecl::ISK_BitWidthOrNothing &&
853 D->InitStorage.getPointer() ==
nullptr) {
855 }
else if (D->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) {
856 Record.push_back(D->InitStorage.getInt() + 1);
858 QualType(static_cast<Type *>(D->InitStorage.getPointer()), 0));
860 Record.push_back(D->InitStorage.getInt() + 1);
861 Record.AddStmt(static_cast<Expr *>(D->InitStorage.getPointer()));
880 AbbrevToUse = Writer.getDeclFieldAbbrev();
886 VisitDeclaratorDecl(D);
896 for (
const auto *
P : D->
chain())
897 Record.AddDeclRef(
P);
902 VisitRedeclarable(D);
903 VisitDeclaratorDecl(D);
907 if (!isa<ParmVarDecl>(D)) {
918 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
919 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
933 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
936 Record.push_back(VarTemplate);
937 Record.AddDeclRef(TemplD);
940 Record.push_back(StaticDataMemberSpecialization);
941 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
942 Record.push_back(SpecInfo->getTemplateSpecializationKind());
943 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
945 Record.push_back(VarNotTemplate);
967 AbbrevToUse = Writer.getDeclVarAbbrev();
1012 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1016 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1018 &&
"PARM_VAR_DECL can't be demoted definition.");
1019 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1021 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1023 "PARM_VAR_DECL can't be static data member");
1028 Record.push_back(D->
bindings().size());
1032 Record.AddDeclRef(B);
1060 Record.AddDeclRef(
P);
1066 for (
const auto &capture : D->
captures()) {
1067 Record.AddDeclRef(capture.getVariable());
1070 if (capture.isByRef()) flags |= 1;
1071 if (capture.isNested()) flags |= 2;
1072 if (capture.hasCopyExpr()) flags |= 4;
1073 Record.push_back(flags);
1075 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1085 Record.push_back(CD->
isNothrow() ? 1 : 0);
1114 VisitRedeclarable(D);
1130 Decl *Parent = cast<Decl>(
1132 if (Parent->
isFromASTFile() || isa<TranslationUnitDecl>(Parent)) {
1133 Writer.DeclUpdates[Parent].push_back(
1140 VisitRedeclarable(D);
1153 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1154 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1161 Record.push_back(D->NumExpansions);
1165 Record.AddDeclRef(
E);
1170 VisitRedeclarable(D);
1173 Record.AddDeclRef(D->UsingOrNextShadow);
1180 VisitUsingShadowDecl(D);
1181 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1182 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1183 Record.push_back(D->IsVirtual);
1201 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1219 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1222 Record.push_back(CXXRecTemplate);
1223 Record.AddDeclRef(TemplD);
1226 Record.push_back(CXXRecMemberSpecialization);
1227 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1228 Record.push_back(MSInfo->getTemplateSpecializationKind());
1229 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1231 Record.push_back(CXXRecNotTemplate);
1236 Record.AddCXXDefinitionData(D);
1240 if (D->IsCompleteDefinition)
1247 VisitFunctionDecl(D);
1253 Record.AddDeclRef(*
I);
1256 Record.push_back(0);
1268 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1275 Record.AddDeclRef(Inherited.getShadowDecl());
1276 Record.AddDeclRef(Inherited.getConstructor());
1282 VisitCXXMethodDecl(D);
1290 VisitCXXMethodDecl(D);
1298 VisitCXXMethodDecl(D);
1306 Record.push_back(!IdentifierLocs.empty());
1307 if (IdentifierLocs.empty()) {
1308 Record.AddSourceLocation(D->
getLocEnd());
1309 Record.push_back(1);
1311 for (
unsigned I = 0, N = IdentifierLocs.size();
I != N; ++
I)
1312 Record.AddSourceLocation(IdentifierLocs[
I]);
1313 Record.push_back(IdentifierLocs.size());
1329 Record.push_back(D->NumTPLists);
1331 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1332 Record.push_back(hasFriendDecl);
1337 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1339 Record.AddDeclRef(D->getNextFriend());
1340 Record.push_back(D->UnsupportedFriend);
1341 Record.AddSourceLocation(D->FriendLoc);
1367 VisitRedeclarable(D);
1378 VisitTemplateDecl(D);
1383 VisitRedeclarableTemplateDecl(D);
1386 AddTemplateSpecializations(D);
1394 VisitCXXRecordDecl(D);
1399 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1400 Record.AddDeclRef(InstFromD);
1428 VisitClassTemplateSpecializationDecl(D);
1443 VisitRedeclarableTemplateDecl(D);
1446 AddTemplateSpecializations(D);
1456 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1459 Record.AddDeclRef(InstFromD);
1487 VisitVarTemplateSpecializationDecl(D);
1510 VisitRedeclarableTemplateDecl(D);
1513 AddTemplateSpecializations(D);
1524 Record.push_back(OwnsDefaultArg);
1538 VisitDeclaratorDecl(D);
1555 Record.push_back(OwnsDefaultArg);
1569 VisitTemplateDecl(D);
1584 Record.push_back(OwnsDefaultArg);
1592 VisitRedeclarableTemplateDecl(D);
1607 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(
Context, DC));
1608 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(
Context, DC));
1612 assert(IsLocalDecl(D) &&
"expected a local declaration");
1615 if (IsLocalDecl(Canon))
1618 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1623 if (IsLocalDecl(Redecl))
1625 return CacheEntry = D;
1628 template <
typename T>
1631 T *MostRecent = First->getMostRecentDecl();
1632 T *DAsT =
static_cast<T *
>(D);
1633 if (MostRecent != First) {
1635 "Not considered redeclarable?");
1637 Record.AddDeclRef(First);
1641 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1642 if (DAsT == FirstLocal) {
1646 unsigned I = Record.size();
1647 Record.push_back(0);
1649 AddFirstDeclFromEachModule(DAsT,
false);
1651 Record[
I] = Record.size() -
I;
1659 if (!Prev->isFromASTFile())
1664 if (LocalRedecls.empty())
1665 Record.push_back(0);
1669 Record.push_back(0);
1670 Record.AddDeclRef(FirstLocal);
1680 (void)Writer.GetDeclRef(MostRecent);
1683 Record.push_back(0);
1713 void ASTWriter::WriteDeclAbbrevs() {
1714 using namespace llvm;
1716 std::shared_ptr<BitCodeAbbrev> Abv;
1719 Abv = std::make_shared<BitCodeAbbrev>();
1722 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1723 Abv->Add(BitCodeAbbrevOp(0));
1724 Abv->Add(BitCodeAbbrevOp(0));
1725 Abv->Add(BitCodeAbbrevOp(0));
1726 Abv->Add(BitCodeAbbrevOp(0));
1727 Abv->Add(BitCodeAbbrevOp(0));
1728 Abv->Add(BitCodeAbbrevOp(0));
1729 Abv->Add(BitCodeAbbrevOp(0));
1730 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1731 Abv->Add(BitCodeAbbrevOp(0));
1732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1734 Abv->Add(BitCodeAbbrevOp(0));
1735 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1736 Abv->Add(BitCodeAbbrevOp(0));
1738 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1740 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1741 Abv->Add(BitCodeAbbrevOp(0));
1743 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1744 Abv->Add(BitCodeAbbrevOp(0));
1746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1747 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1748 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1749 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1752 Abv = std::make_shared<BitCodeAbbrev>();
1755 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1756 Abv->Add(BitCodeAbbrevOp(0));
1757 Abv->Add(BitCodeAbbrevOp(0));
1758 Abv->Add(BitCodeAbbrevOp(0));
1759 Abv->Add(BitCodeAbbrevOp(0));
1760 Abv->Add(BitCodeAbbrevOp(0));
1761 Abv->Add(BitCodeAbbrevOp(0));
1762 Abv->Add(BitCodeAbbrevOp(0));
1763 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1764 Abv->Add(BitCodeAbbrevOp(0));
1765 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1767 Abv->Add(BitCodeAbbrevOp(0));
1768 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1769 Abv->Add(BitCodeAbbrevOp(0));
1771 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1773 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1774 Abv->Add(BitCodeAbbrevOp(0));
1776 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1777 Abv->Add(BitCodeAbbrevOp(0));
1779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1780 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1783 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1784 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1785 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1788 Abv = std::make_shared<BitCodeAbbrev>();
1791 Abv->Add(BitCodeAbbrevOp(0));
1793 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1794 Abv->Add(BitCodeAbbrevOp(0));
1795 Abv->Add(BitCodeAbbrevOp(0));
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(
AS_none));
1802 Abv->Add(BitCodeAbbrevOp(0));
1803 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1805 Abv->Add(BitCodeAbbrevOp(0));
1806 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1807 Abv->Add(BitCodeAbbrevOp(0));
1809 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1810 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1812 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1814 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1815 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1816 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1817 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1818 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1819 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1820 Abv->Add(BitCodeAbbrevOp(0));
1822 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1823 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1825 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1826 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1827 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1828 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1832 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1833 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1834 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
1837 Abv = std::make_shared<BitCodeAbbrev>();
1840 Abv->Add(BitCodeAbbrevOp(0));
1842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1843 Abv->Add(BitCodeAbbrevOp(0));
1844 Abv->Add(BitCodeAbbrevOp(0));
1845 Abv->Add(BitCodeAbbrevOp(0));
1846 Abv->Add(BitCodeAbbrevOp(0));
1847 Abv->Add(BitCodeAbbrevOp(0));
1848 Abv->Add(BitCodeAbbrevOp(0));
1849 Abv->Add(BitCodeAbbrevOp(0));
1850 Abv->Add(BitCodeAbbrevOp(
AS_none));
1851 Abv->Add(BitCodeAbbrevOp(0));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1854 Abv->Add(BitCodeAbbrevOp(0));
1855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1856 Abv->Add(BitCodeAbbrevOp(0));
1858 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1859 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1861 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1862 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1863 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1864 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1865 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1868 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1869 Abv->Add(BitCodeAbbrevOp(0));
1871 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1872 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1873 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1874 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1876 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1878 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
1881 Abv = std::make_shared<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(0));
1892 Abv->Add(BitCodeAbbrevOp(0));
1893 Abv->Add(BitCodeAbbrevOp(0));
1894 Abv->Add(BitCodeAbbrevOp(
AS_none));
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));
1904 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1905 Abv->Add(BitCodeAbbrevOp(0));
1907 Abv->Add(BitCodeAbbrevOp(0));
1908 Abv->Add(BitCodeAbbrevOp(0));
1909 Abv->Add(BitCodeAbbrevOp(0));
1910 Abv->Add(BitCodeAbbrevOp(0));
1911 Abv->Add(BitCodeAbbrevOp(0));
1912 Abv->Add(BitCodeAbbrevOp(0));
1914 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1915 Abv->Add(BitCodeAbbrevOp(0));
1916 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(0));
1919 Abv->Add(BitCodeAbbrevOp(0));
1920 Abv->Add(BitCodeAbbrevOp(0));
1922 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1923 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1924 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1925 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1928 Abv = std::make_shared<BitCodeAbbrev>();
1931 Abv->Add(BitCodeAbbrevOp(0));
1933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1934 Abv->Add(BitCodeAbbrevOp(0));
1935 Abv->Add(BitCodeAbbrevOp(0));
1936 Abv->Add(BitCodeAbbrevOp(0));
1937 Abv->Add(BitCodeAbbrevOp(0));
1938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1939 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1940 Abv->Add(BitCodeAbbrevOp(0));
1941 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1942 Abv->Add(BitCodeAbbrevOp(0));
1943 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1945 Abv->Add(BitCodeAbbrevOp(0));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1947 Abv->Add(BitCodeAbbrevOp(0));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1953 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1954 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
1957 Abv = std::make_shared<BitCodeAbbrev>();
1960 Abv->Add(BitCodeAbbrevOp(0));
1962 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1963 Abv->Add(BitCodeAbbrevOp(0));
1964 Abv->Add(BitCodeAbbrevOp(0));
1965 Abv->Add(BitCodeAbbrevOp(0));
1966 Abv->Add(BitCodeAbbrevOp(0));
1967 Abv->Add(BitCodeAbbrevOp(0));
1968 Abv->Add(BitCodeAbbrevOp(0));
1969 Abv->Add(BitCodeAbbrevOp(0));
1970 Abv->Add(BitCodeAbbrevOp(
AS_none));
1971 Abv->Add(BitCodeAbbrevOp(0));
1972 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1974 Abv->Add(BitCodeAbbrevOp(0));
1975 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1976 Abv->Add(BitCodeAbbrevOp(0));
1978 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1980 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1981 Abv->Add(BitCodeAbbrevOp(0));
1983 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1984 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1985 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
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(BitCodeAbbrevOp::Fixed, 1));
1991 Abv->Add(BitCodeAbbrevOp(0));
1992 Abv->Add(BitCodeAbbrevOp(0));
1993 Abv->Add(BitCodeAbbrevOp(0));
1994 Abv->Add(BitCodeAbbrevOp(0));
1995 Abv->Add(BitCodeAbbrevOp(0));
1996 Abv->Add(BitCodeAbbrevOp(0));
1997 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1998 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2001 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2003 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2004 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2007 Abv = std::make_shared<BitCodeAbbrev>();
2010 Abv->Add(BitCodeAbbrevOp(0));
2012 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2013 Abv->Add(BitCodeAbbrevOp(0));
2014 Abv->Add(BitCodeAbbrevOp(0));
2015 Abv->Add(BitCodeAbbrevOp(0));
2016 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2017 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2018 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2019 Abv->Add(BitCodeAbbrevOp(0));
2020 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2021 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2022 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2025 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2026 Abv->Add(BitCodeAbbrevOp(0));
2028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2030 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2031 Abv->Add(BitCodeAbbrevOp(0));
2033 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2034 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2035 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2036 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2037 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2038 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2039 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2040 Abv->Add(BitCodeAbbrevOp(0));
2041 Abv->Add(BitCodeAbbrevOp(1));
2042 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2043 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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, 1));
2049 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2050 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2051 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2052 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2053 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2062 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2063 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2064 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2067 Abv = std::make_shared<BitCodeAbbrev>();
2071 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2072 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2073 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2074 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2075 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2076 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2077 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2079 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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,
2085 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2086 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2087 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2090 Abv = std::make_shared<BitCodeAbbrev>();
2094 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2095 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2096 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2097 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2098 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2099 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2100 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2102 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2103 Abv->Add(BitCodeAbbrevOp(32));
2104 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2105 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2108 Abv = std::make_shared<BitCodeAbbrev>();
2112 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2113 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2114 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2115 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2116 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2117 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2118 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2121 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2122 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2123 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2126 Abv = std::make_shared<BitCodeAbbrev>();
2130 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2131 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2132 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2133 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2134 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2135 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2136 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2138 Abv->Add(BitCodeAbbrevOp(0));
2139 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2141 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2143 Abv = std::make_shared<BitCodeAbbrev>();
2145 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2146 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2148 Abv = std::make_shared<BitCodeAbbrev>();
2150 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2151 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2167 bool WritingModule) {
2173 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) ||
2174 D->
hasAttr<OMPDeclareTargetDeclAttr>())
2177 if (WritingModule && (isa<VarDecl>(D) || isa<ImportDecl>(D))) {
2189 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2196 assert(ID >= FirstDeclID &&
"invalid decl ID");
2205 uint64_t
Offset = W.Emit(D);
2209 unsigned Index = ID - FirstDeclID;
2210 if (DeclOffsets.size() == Index)
2211 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2212 else if (DeclOffsets.size() < Index) {
2214 DeclOffsets.resize(Index+1);
2215 DeclOffsets[Index].setLocation(Loc);
2216 DeclOffsets[Index].BitOffset =
Offset;
2218 llvm_unreachable(
"declarations should be emitted in ID order");
2223 associateDeclWithFile(D, ID);
2228 EagerlyDeserializedDecls.push_back(ID);
2233 Writer->ClearSwitchCaseIDs();
2236 bool ModulesCodegen =
false;
2244 Writer->Context->getLangOpts().ModulesCodegen ||
2248 Record->push_back(ModulesCodegen);
2250 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2251 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2252 Record->push_back(CD->getNumCtorInitializers());
2253 if (CD->getNumCtorInitializers())
2254 AddCXXCtorInitializers(
2255 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
void VisitExportDecl(ExportDecl *D)
CXXMethodDecl * getSpecialization() const
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
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.
Decl - This represents one declaration (or definition), e.g.
An ImplicitCastExpr record.
A VarTemplatePartialSpecializationDecl record.
Defines the C++ template declaration subclasses.
bool hasFlexibleArrayMember() const
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
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)
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
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
Expr * getBinding() const
Get the expression to which this declaration is bound.
SourceLocation getLocEnd() const LLVM_READONLY
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
AccessSpecifier getAccess() 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.
unsigned IsExplicitSpecified
A TemplateTemplateParmDecl record.
ParmVarDecl - Represents a parameter to a function.
A ObjCInterfaceDecl record.
Provides information about a dependent function-template specialization declaration.
SourceLocation getSetterNameLoc() const
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()
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes, if any.
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)
bool isReferenced() const
Whether any declaration of this entity was referenced.
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.
unsigned getIdentifierNamespace() const
SourceLocation getGetterNameLoc() const
TagKind getTagKind() const
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
void VisitDecompositionDecl(DecompositionDecl *D)
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
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
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
Retrieves the canonical declaration of this template.
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 isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
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.
A DecompositionDecl 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)
void VisitBindingDecl(BindingDecl *D)
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
A ClassTemplateSpecializationDecl record.
Represents an Objective-C protocol declaration.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
ArrayRef< BindingDecl * > bindings() const
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
A binding in a decomposition declaration.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
size_t param_size() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
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.
A CXXDeductionGuideDecl record.
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
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
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.
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
void VisitTemplateDecl(TemplateDecl *D)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
DeclContext * getDeclContext()
void VisitUsingDecl(UsingDecl *D)
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
const char * getDeclKindName() const
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.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
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)
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.
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
Represents a C++ deduction guide declaration.
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.
SourceLocation getLocStart() const LLVM_READONLY
Represents a C++ Modules TS module export declaration.
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)
void VisitUsingPackDecl(UsingPackDecl *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
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
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)
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
ObjCIvarDecl * getPropertyIvarDecl() const
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
bool isInvalidDecl() const
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
A decomposition declaration.
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
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
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...
Module * getOwningModule() const
Get the module that owns this declaration.
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
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.
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
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
Retrieves the canonical declaration of this template.
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
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.
SourceLocation getLocation() const
SourceLocation getRBraceLoc() const
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...
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
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.
Represents a pack of using declarations that a single using-declarator pack-expanded into...
void VisitObjCIvarDecl(ObjCIvarDecl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
This is a C++ Modules TS module interface unit.
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