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 '") +
52 return Record.
Emit(Code, AbbrevToUse);
57 void VisitDecl(
Decl *D);
75 void VisitClassTemplateSpecializationDecl(
77 void VisitClassTemplatePartialSpecializationDecl(
80 void VisitVarTemplatePartialSpecializationDecl(
82 void VisitClassScopeFunctionSpecializationDecl(
159 for (
auto typeParam : *typeParams) {
170 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
173 if (R->isFromASTFile())
175 else if (IncludeLocal)
178 for (
const auto &F : Firsts)
183 template <
typename EntryType>
192 return Common->PartialSpecializations;
198 template<
typename DeclTy>
200 auto *Common = D->getCommonPtr();
206 Common->LazySpecializations) {
207 D->LoadLazySpecializations();
208 assert(!Common->LazySpecializations);
212 if (
auto *LS = Common->LazySpecializations)
213 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
216 unsigned I = Record.
size();
222 for (
auto &Entry : Common->Specializations)
223 Specs.push_back(getSpecializationDecl(Entry));
224 for (
auto &Entry : getPartialSpecializations(Common))
225 Specs.push_back(getSpecializationDecl(Entry));
227 for (
auto *D : Specs) {
228 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
229 AddFirstDeclFromEachModule(D,
true);
231 Record.
append(LazySpecializations.begin(), LazySpecializations.end());
234 Record[I] = Record.
size() - I - 1;
240 const Decl *Specialization) {
255 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
268 if (
auto *TInfo = DD->getTypeSourceInfo())
269 Record.AddTypeLoc(TInfo->getTypeLoc());
276 Record.push_back(FD->doesThisDeclarationHaveABody());
277 if (FD->doesThisDeclarationHaveABody())
278 Record.AddFunctionDefinition(FD);
285 VisitDeclContext(DC);
297 Record.AddAttributes(D->
getAttrs());
299 Record.push_back(D->
isUsed(
false));
316 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
317 if (!NS->isFromASTFile())
319 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
320 if (!NS->isInlineNamespace())
328 StringRef Arg = D->
getArg();
329 Record.push_back(Arg.size());
333 Record.AddString(Arg);
341 Record.push_back(Name.size() + 1 + Value.size());
344 Record.AddString(Name);
345 Record.AddString(Value);
350 llvm_unreachable(
"Translation units aren't directly serialized");
357 ? Writer.getAnonymousDeclarationNumber(D)
368 VisitRedeclarable(D);
371 Record.push_back(D->
isModed());
378 VisitTypedefNameDecl(D);
388 AbbrevToUse = Writer.getDeclTypedefAbbrev();
394 VisitTypedefNameDecl(D);
400 VisitRedeclarable(D);
404 if (!isa<CXXRecordDecl>(D))
411 if (D->hasExtInfo()) {
413 Record.AddQualifierInfo(*D->getExtInfo());
416 Record.AddDeclRef(TD);
417 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
433 Record.push_back(D->
isFixed());
437 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
438 Record.push_back(MemberInfo->getTemplateSpecializationKind());
439 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
441 Record.AddDeclRef(
nullptr);
461 AbbrevToUse = Writer.getDeclEnumAbbrev();
493 AbbrevToUse = Writer.getDeclRecordAbbrev();
500 Record.AddTypeRef(D->
getType());
516 Record.push_back(D->hasExtInfo());
518 Record.AddQualifierInfo(*D->getExtInfo());
525 VisitRedeclarable(D);
526 VisitDeclaratorDecl(D);
527 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
533 Record.push_back((
int)D->SClass);
534 Record.push_back(D->IsInline);
535 Record.push_back(D->IsInlineSpecified);
537 Record.push_back(D->IsVirtualAsWritten);
538 Record.push_back(D->IsPure);
539 Record.push_back(D->HasInheritedPrototype);
540 Record.push_back(D->HasWrittenPrototype);
541 Record.push_back(D->IsDeleted);
542 Record.push_back(D->IsTrivial);
543 Record.push_back(D->IsTrivialForCall);
544 Record.push_back(D->IsDefaulted);
545 Record.push_back(D->IsExplicitlyDefaulted);
546 Record.push_back(D->HasImplicitReturnZero);
547 Record.push_back(D->IsConstexpr);
548 Record.push_back(D->UsesSEHTry);
549 Record.push_back(D->HasSkippedBody);
550 Record.push_back(D->IsMultiVersion);
551 Record.push_back(D->IsLateTemplateParsed);
553 Record.AddSourceLocation(D->
getLocEnd());
575 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
589 Record.AddTemplateArgumentLoc(
625 Record.AddDeclRef(
P);
630 VisitFunctionDecl(D);
639 bool HasBodyStuff = D->
getBody() !=
nullptr ||
641 Record.push_back(HasBodyStuff);
651 Record.push_back(D->IsOverriding);
652 Record.push_back(D->HasSkippedBody);
654 Record.push_back(D->IsRedeclaration);
655 Record.push_back(D->HasRedeclaration);
656 if (D->HasRedeclaration) {
668 Record.AddSourceLocation(D->
getLocEnd());
671 Record.AddDeclRef(
P);
673 Record.push_back(D->SelLocsKind);
674 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
676 Record.push_back(NumStoredSelLocs);
677 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
678 Record.AddSourceLocation(SelLocs[i]);
684 VisitTypedefNameDecl(D);
685 Record.push_back(D->Variance);
686 Record.push_back(D->Index);
687 Record.AddSourceLocation(D->VarianceLoc);
688 Record.AddSourceLocation(D->ColonLoc);
701 VisitRedeclarable(D);
702 VisitObjCContainerDecl(D);
704 AddObjCTypeParamList(D->TypeParamList);
709 ObjCInterfaceDecl::DefinitionData &Data = D->data();
713 Record.push_back(Data.HasDesignatedInitializers);
716 Record.push_back(Data.ReferencedProtocols.size());
718 Record.AddDeclRef(
P);
720 Record.AddSourceLocation(PL);
723 Record.push_back(Data.AllReferencedProtocols.size());
725 P = Data.AllReferencedProtocols.begin(),
726 PEnd = Data.AllReferencedProtocols.end();
728 Record.AddDeclRef(*
P);
733 Writer.ObjCClassesWithCategories.insert(D);
736 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
737 (
void)Writer.GetDeclRef(Cat);
760 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
766 VisitRedeclarable(D);
767 VisitObjCContainerDecl(D);
773 Record.AddDeclRef(I);
775 Record.AddSourceLocation(PL);
787 VisitObjCContainerDecl(D);
792 AddObjCTypeParamList(D->TypeParamList);
795 Record.AddDeclRef(I);
797 Record.AddSourceLocation(PL);
809 Record.AddSourceLocation(D->
getAtLoc());
811 Record.AddTypeRef(D->
getType());
829 VisitObjCContainerDecl(D);
835 VisitObjCImplDecl(D);
841 VisitObjCImplDecl(D);
848 Record.push_back(D->NumIvarInitializers);
849 if (D->NumIvarInitializers)
850 Record.AddCXXCtorInitializers(
867 VisitDeclaratorDecl(D);
870 FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
871 Record.push_back(ISK);
872 if (ISK == FieldDecl::ISK_CapturedVLAType)
897 AbbrevToUse = Writer.getDeclFieldAbbrev();
903 VisitDeclaratorDecl(D);
913 for (
const auto *
P : D->
chain())
914 Record.AddDeclRef(
P);
919 VisitRedeclarable(D);
920 VisitDeclaratorDecl(D);
924 if (!isa<ParmVarDecl>(D)) {
936 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
937 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
951 bool ModulesCodegen =
false;
952 if (Writer.WritingModule &&
954 !isa<VarTemplateSpecializationDecl>(D)) {
963 Record.push_back(ModulesCodegen);
965 Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
969 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
972 Record.push_back(VarTemplate);
973 Record.AddDeclRef(TemplD);
976 Record.push_back(StaticDataMemberSpecialization);
977 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
978 Record.push_back(SpecInfo->getTemplateSpecializationKind());
979 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
981 Record.push_back(VarNotTemplate);
1004 AbbrevToUse = Writer.getDeclVarAbbrev();
1049 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1053 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1055 &&
"PARM_VAR_DECL can't be demoted definition.");
1056 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1058 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1060 "PARM_VAR_DECL can't be static data member");
1065 Record.push_back(D->
bindings().size());
1069 Record.AddDeclRef(B);
1097 Record.AddDeclRef(
P);
1103 for (
const auto &capture : D->
captures()) {
1104 Record.AddDeclRef(capture.getVariable());
1107 if (capture.isByRef()) flags |= 1;
1108 if (capture.isNested()) flags |= 2;
1109 if (capture.hasCopyExpr()) flags |= 4;
1110 Record.push_back(flags);
1112 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1122 Record.push_back(CD->
isNothrow() ? 1 : 0);
1125 Record.AddDeclRef(CD->
getParam(I));
1151 VisitRedeclarable(D);
1170 Writer.DeclUpdates[
Parent].push_back(
1177 VisitRedeclarable(D);
1190 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1191 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1198 Record.push_back(D->NumExpansions);
1202 Record.AddDeclRef(E);
1207 VisitRedeclarable(D);
1211 Record.AddDeclRef(D->UsingOrNextShadow);
1218 VisitUsingShadowDecl(D);
1219 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1220 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1221 Record.push_back(D->IsVirtual);
1239 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1257 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1260 Record.push_back(CXXRecTemplate);
1261 Record.AddDeclRef(TemplD);
1264 Record.push_back(CXXRecMemberSpecialization);
1265 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1266 Record.push_back(MSInfo->getTemplateSpecializationKind());
1267 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1269 Record.push_back(CXXRecNotTemplate);
1274 Record.AddCXXDefinitionData(D);
1278 if (D->IsCompleteDefinition)
1285 VisitFunctionDecl(D);
1289 Record.AddDeclRef(MD);
1292 Record.push_back(0);
1304 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1311 Record.AddDeclRef(Inherited.getShadowDecl());
1312 Record.AddDeclRef(Inherited.getConstructor());
1318 VisitCXXMethodDecl(D);
1326 VisitCXXMethodDecl(D);
1336 VisitCXXMethodDecl(D);
1344 Record.push_back(!IdentifierLocs.empty());
1345 if (IdentifierLocs.empty()) {
1346 Record.AddSourceLocation(D->
getLocEnd());
1347 Record.push_back(1);
1349 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1350 Record.AddSourceLocation(IdentifierLocs[I]);
1351 Record.push_back(IdentifierLocs.size());
1367 Record.push_back(D->NumTPLists);
1369 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1370 Record.push_back(hasFriendDecl);
1375 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1377 Record.AddDeclRef(D->getNextFriend());
1378 Record.push_back(D->UnsupportedFriend);
1379 Record.AddSourceLocation(D->FriendLoc);
1405 VisitRedeclarable(D);
1416 VisitTemplateDecl(D);
1421 VisitRedeclarableTemplateDecl(D);
1424 AddTemplateSpecializations(D);
1432 VisitCXXRecordDecl(D);
1437 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1438 Record.AddDeclRef(InstFromD);
1466 VisitClassTemplateSpecializationDecl(D);
1481 VisitRedeclarableTemplateDecl(D);
1484 AddTemplateSpecializations(D);
1494 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1497 Record.AddDeclRef(InstFromD);
1513 Record.push_back(D->IsCompleteDefinition);
1526 VisitVarTemplateSpecializationDecl(D);
1549 VisitRedeclarableTemplateDecl(D);
1552 AddTemplateSpecializations(D);
1563 Record.push_back(OwnsDefaultArg);
1577 VisitDeclaratorDecl(D);
1594 Record.push_back(OwnsDefaultArg);
1608 VisitTemplateDecl(D);
1623 Record.push_back(OwnsDefaultArg);
1631 VisitRedeclarableTemplateDecl(D);
1646 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1647 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1651 assert(IsLocalDecl(D) &&
"expected a local declaration");
1654 if (IsLocalDecl(Canon))
1657 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1662 if (IsLocalDecl(Redecl))
1664 return CacheEntry = D;
1667 template <
typename T>
1670 T *MostRecent = First->getMostRecentDecl();
1671 T *DAsT =
static_cast<T *
>(D);
1672 if (MostRecent != First) {
1674 "Not considered redeclarable?");
1676 Record.AddDeclRef(First);
1680 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1681 if (DAsT == FirstLocal) {
1685 unsigned I = Record.size();
1686 Record.push_back(0);
1688 AddFirstDeclFromEachModule(DAsT,
false);
1690 Record[I] = Record.size() - I;
1698 if (!Prev->isFromASTFile())
1703 if (LocalRedecls.empty())
1704 Record.push_back(0);
1708 Record.push_back(0);
1709 Record.AddDeclRef(FirstLocal);
1719 (void)Writer.GetDeclRef(MostRecent);
1722 Record.push_back(0);
1753 void ASTWriter::WriteDeclAbbrevs() {
1754 using namespace llvm;
1756 std::shared_ptr<BitCodeAbbrev> Abv;
1759 Abv = std::make_shared<BitCodeAbbrev>();
1762 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1763 Abv->Add(BitCodeAbbrevOp(0));
1764 Abv->Add(BitCodeAbbrevOp(0));
1765 Abv->Add(BitCodeAbbrevOp(0));
1766 Abv->Add(BitCodeAbbrevOp(0));
1767 Abv->Add(BitCodeAbbrevOp(0));
1768 Abv->Add(BitCodeAbbrevOp(0));
1769 Abv->Add(BitCodeAbbrevOp(0));
1770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1771 Abv->Add(BitCodeAbbrevOp(0));
1772 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1774 Abv->Add(BitCodeAbbrevOp(0));
1775 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1776 Abv->Add(BitCodeAbbrevOp(0));
1778 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1780 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1781 Abv->Add(BitCodeAbbrevOp(0));
1782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1784 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1785 Abv->Add(BitCodeAbbrevOp(0));
1787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1789 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1792 Abv = std::make_shared<BitCodeAbbrev>();
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(BitCodeAbbrevOp::Fixed, 2));
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));
1813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1814 Abv->Add(BitCodeAbbrevOp(0));
1815 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1817 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1818 Abv->Add(BitCodeAbbrevOp(0));
1820 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1821 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1823 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1825 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1828 Abv = std::make_shared<BitCodeAbbrev>();
1831 Abv->Add(BitCodeAbbrevOp(0));
1833 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1834 Abv->Add(BitCodeAbbrevOp(0));
1835 Abv->Add(BitCodeAbbrevOp(0));
1836 Abv->Add(BitCodeAbbrevOp(0));
1837 Abv->Add(BitCodeAbbrevOp(0));
1838 Abv->Add(BitCodeAbbrevOp(0));
1839 Abv->Add(BitCodeAbbrevOp(0));
1840 Abv->Add(BitCodeAbbrevOp(0));
1841 Abv->Add(BitCodeAbbrevOp(
AS_none));
1842 Abv->Add(BitCodeAbbrevOp(0));
1843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1845 Abv->Add(BitCodeAbbrevOp(0));
1846 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1847 Abv->Add(BitCodeAbbrevOp(0));
1849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1850 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1853 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1854 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1856 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1858 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1859 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1860 Abv->Add(BitCodeAbbrevOp(0));
1862 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1863 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1864 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1865 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1868 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
1871 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1873 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1874 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1875 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
1878 Abv = std::make_shared<BitCodeAbbrev>();
1881 Abv->Add(BitCodeAbbrevOp(0));
1883 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1884 Abv->Add(BitCodeAbbrevOp(0));
1885 Abv->Add(BitCodeAbbrevOp(0));
1886 Abv->Add(BitCodeAbbrevOp(0));
1887 Abv->Add(BitCodeAbbrevOp(0));
1888 Abv->Add(BitCodeAbbrevOp(0));
1889 Abv->Add(BitCodeAbbrevOp(0));
1890 Abv->Add(BitCodeAbbrevOp(0));
1891 Abv->Add(BitCodeAbbrevOp(
AS_none));
1892 Abv->Add(BitCodeAbbrevOp(0));
1893 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1895 Abv->Add(BitCodeAbbrevOp(0));
1896 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1897 Abv->Add(BitCodeAbbrevOp(0));
1899 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1900 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1902 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1904 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1907 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1908 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1909 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1910 Abv->Add(BitCodeAbbrevOp(0));
1912 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1913 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1914 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1920 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1922 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1924 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1926 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1929 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1930 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1931 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
1934 Abv = std::make_shared<BitCodeAbbrev>();
1937 Abv->Add(BitCodeAbbrevOp(0));
1939 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1940 Abv->Add(BitCodeAbbrevOp(0));
1941 Abv->Add(BitCodeAbbrevOp(0));
1942 Abv->Add(BitCodeAbbrevOp(0));
1943 Abv->Add(BitCodeAbbrevOp(0));
1944 Abv->Add(BitCodeAbbrevOp(0));
1945 Abv->Add(BitCodeAbbrevOp(0));
1946 Abv->Add(BitCodeAbbrevOp(0));
1947 Abv->Add(BitCodeAbbrevOp(
AS_none));
1948 Abv->Add(BitCodeAbbrevOp(0));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1951 Abv->Add(BitCodeAbbrevOp(0));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1953 Abv->Add(BitCodeAbbrevOp(0));
1955 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1957 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1958 Abv->Add(BitCodeAbbrevOp(0));
1959 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1961 Abv->Add(BitCodeAbbrevOp(0));
1962 Abv->Add(BitCodeAbbrevOp(0));
1963 Abv->Add(BitCodeAbbrevOp(0));
1964 Abv->Add(BitCodeAbbrevOp(0));
1965 Abv->Add(BitCodeAbbrevOp(0));
1966 Abv->Add(BitCodeAbbrevOp(0));
1968 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1969 Abv->Add(BitCodeAbbrevOp(0));
1970 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1971 Abv->Add(BitCodeAbbrevOp(0));
1972 Abv->Add(BitCodeAbbrevOp(0));
1973 Abv->Add(BitCodeAbbrevOp(0));
1974 Abv->Add(BitCodeAbbrevOp(0));
1976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1977 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1978 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1981 Abv = std::make_shared<BitCodeAbbrev>();
1984 Abv->Add(BitCodeAbbrevOp(0));
1986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1987 Abv->Add(BitCodeAbbrevOp(0));
1988 Abv->Add(BitCodeAbbrevOp(0));
1989 Abv->Add(BitCodeAbbrevOp(0));
1990 Abv->Add(BitCodeAbbrevOp(0));
1991 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1992 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1993 Abv->Add(BitCodeAbbrevOp(0));
1994 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1995 Abv->Add(BitCodeAbbrevOp(0));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1998 Abv->Add(BitCodeAbbrevOp(0));
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2000 Abv->Add(BitCodeAbbrevOp(0));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2003 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2005 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2006 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2007 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2010 Abv = std::make_shared<BitCodeAbbrev>();
2013 Abv->Add(BitCodeAbbrevOp(0));
2015 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2016 Abv->Add(BitCodeAbbrevOp(0));
2017 Abv->Add(BitCodeAbbrevOp(0));
2018 Abv->Add(BitCodeAbbrevOp(0));
2019 Abv->Add(BitCodeAbbrevOp(0));
2020 Abv->Add(BitCodeAbbrevOp(0));
2021 Abv->Add(BitCodeAbbrevOp(0));
2022 Abv->Add(BitCodeAbbrevOp(0));
2023 Abv->Add(BitCodeAbbrevOp(
AS_none));
2024 Abv->Add(BitCodeAbbrevOp(0));
2025 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2027 Abv->Add(BitCodeAbbrevOp(0));
2028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2029 Abv->Add(BitCodeAbbrevOp(0));
2031 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2033 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2034 Abv->Add(BitCodeAbbrevOp(0));
2035 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2037 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2038 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2039 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2040 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2041 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 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(0));
2047 Abv->Add(BitCodeAbbrevOp(0));
2048 Abv->Add(BitCodeAbbrevOp(0));
2049 Abv->Add(BitCodeAbbrevOp(0));
2050 Abv->Add(BitCodeAbbrevOp(0));
2051 Abv->Add(BitCodeAbbrevOp(0));
2052 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2053 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2054 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2056 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2057 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2058 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2061 Abv = std::make_shared<BitCodeAbbrev>();
2064 Abv->Add(BitCodeAbbrevOp(0));
2066 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2067 Abv->Add(BitCodeAbbrevOp(0));
2068 Abv->Add(BitCodeAbbrevOp(0));
2069 Abv->Add(BitCodeAbbrevOp(0));
2070 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2071 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2072 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2073 Abv->Add(BitCodeAbbrevOp(0));
2074 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2075 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2076 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2079 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2080 Abv->Add(BitCodeAbbrevOp(0));
2082 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2084 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2085 Abv->Add(BitCodeAbbrevOp(0));
2086 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2088 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2089 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2090 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2091 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2092 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2093 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2094 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2095 Abv->Add(BitCodeAbbrevOp(0));
2096 Abv->Add(BitCodeAbbrevOp(1));
2097 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2098 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2099 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2100 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2101 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2102 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2103 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2104 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2105 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2106 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2107 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2108 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2109 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2110 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2111 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2121 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2122 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2125 Abv = std::make_shared<BitCodeAbbrev>();
2129 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2130 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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, 3));
2135 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2137 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2138 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2139 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2140 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2141 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2143 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2144 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2145 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2148 Abv = std::make_shared<BitCodeAbbrev>();
2152 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2153 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2154 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2155 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2156 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2157 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2158 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2160 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2161 Abv->Add(BitCodeAbbrevOp(32));
2162 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2163 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2166 Abv = std::make_shared<BitCodeAbbrev>();
2170 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2171 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2172 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2173 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2174 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2175 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2176 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2178 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2179 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2180 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2181 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2184 Abv = std::make_shared<BitCodeAbbrev>();
2188 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2189 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2190 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2191 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2192 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2193 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2194 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2196 Abv->Add(BitCodeAbbrevOp(0));
2197 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2198 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2200 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2202 Abv = std::make_shared<BitCodeAbbrev>();
2204 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2205 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2207 Abv = std::make_shared<BitCodeAbbrev>();
2209 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2210 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2226 bool WritingModule) {
2232 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) ||
2233 D->
hasAttr<OMPDeclareTargetDeclAttr>())
2236 if (WritingModule && (isa<VarDecl>(D) || isa<ImportDecl>(D))) {
2251 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2258 assert(ID >= FirstDeclID &&
"invalid decl ID");
2271 unsigned Index = ID - FirstDeclID;
2272 if (DeclOffsets.size() == Index)
2273 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2274 else if (DeclOffsets.size() < Index) {
2276 DeclOffsets.resize(Index+1);
2277 DeclOffsets[Index].setLocation(Loc);
2278 DeclOffsets[Index].BitOffset =
Offset;
2280 llvm_unreachable(
"declarations should be emitted in ID order");
2285 associateDeclWithFile(D, ID);
2290 EagerlyDeserializedDecls.push_back(ID);
2295 Writer->ClearSwitchCaseIDs();
2298 bool ModulesCodegen =
false;
2306 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2309 if (Writer->Context->getLangOpts().ModulesCodegen) {
2312 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2314 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2319 Record->push_back(ModulesCodegen);
2321 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2322 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2323 Record->push_back(CD->getNumCtorInitializers());
2324 if (CD->getNumCtorInitializers())
2325 AddCXXCtorInitializers(
2326 llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
SourceLocation getGetterNameLoc() const
A FriendTemplateDecl record.
A NonTypeTemplateParmDecl record.
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
const TemplateArgumentLoc & getTemplateArg(unsigned I) const
Returns the nth template argument.
const Type * getTypeForDecl() const
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Represents a function declaration or definition.
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
void VisitAccessSpecDecl(AccessSpecDecl *D)
unsigned getNumTemplateArgs() const
Returns the number of explicit template arguments that were given.
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
protocol_range protocols() const
void VisitStaticAssertDecl(StaticAssertDecl *D)
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
void VisitCXXMethodDecl(CXXMethodDecl *D)
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
A (possibly-)qualified type.
const char * getDeclKindName() const
unsigned param_size() const
ObjCInterfaceDecl * getClassInterface()
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
void VisitRedeclarable(Redeclarable< T > *D)
void VisitEmptyDecl(EmptyDecl *D)
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
ObjCIvarDecl * getPropertyIvarDecl() const
bool isObjCMethodParameter() const
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)
SourceRange getBraceRange() const
An OMPThreadPrivateDecl record.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
void VisitExportDecl(ExportDecl *D)
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
Expr * getBitWidth() const
An instance of this object exists for each enum constant that is defined.
void VisitCXXRecordDecl(CXXRecordDecl *D)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Defines the SourceManager interface.
An OMPDeclareReductionDecl record.
bool hasVolatileMember() const
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
const Type * getTypeForDecl() const
bool isLocalSourceLocation(SourceLocation Loc) const
Returns true if Loc did not come from a PCH/Module.
Decl - This represents one declaration (or definition), e.g.
unsigned getNumCaptures() const
Returns the number of captured variables.
An ImplicitCastExpr record.
IdentifierInfo * getGetterId() const
A VarTemplatePartialSpecializationDecl record.
ThreadStorageClassSpecifier getTSCSpec() const
Defines the C++ template declaration subclasses.
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
bool hasWrittenPrototype() const
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
Expr * getSetterCXXAssignment() const
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
A record that stores the set of declarations that are lexically stored within a given DeclContext...
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
Represents an empty-declaration.
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record)
Expr * getOperatorDeleteThisArg() const
Declaration of a variable template.
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
Represent a C++ namespace.
A ObjCPropertyDecl record.
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
TypeSourceInfo * getDefaultArgumentInfo() const
Retrieves the default argument's source information, if any.
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getIdentifierNamespace() const
Represents a C++ constructor within a class.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
size_t param_size() const
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.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
A ClassTemplateDecl record.
A PragmaDetectMismatchDecl record.
An UnresolvedUsingTypenameDecl record.
void VisitBlockDecl(BlockDecl *D)
void VisitImplicitParamDecl(ImplicitParamDecl *D)
unsigned getDepth() const
Get the nesting depth of the template parameter.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
Represents a variable declaration or definition.
Declaration of a redeclarable template.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
An OMPCapturedExprDecl record.
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
A UsingShadowDecl record.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool hasInheritedDefaultArg() 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.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
bool isInvalidDecl() const
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
unsigned getContextParamPosition() const
protocol_range protocols() const
unsigned IsExplicitSpecified
A TemplateTemplateParmDecl record.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
Represents a parameter to a function.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
A ObjCInterfaceDecl record.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
Provides information about a dependent function-template specialization declaration.
const ObjCInterfaceDecl * getSuperClass() const
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
A CXXConstructorDecl record for an inherited constructor.
Represents a struct/union/class.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Provides common interface for the Decls that can be redeclared.
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
Represents a class template specialization, which refers to a class template with a given set of temp...
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
StringLiteral * getMessage()
SourceLocation getIvarLBraceLoc() const
Expr * getGetterCXXConstructor() const
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isInline() const
Returns true if this is an inline namespace declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
Represents a member of a struct/union/class.
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
const llvm::APSInt & getInitVal() const
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
StringRef getValue() const
InitKind getInitializerKind() const
Get initializer kind.
ObjCMethodDecl * getSetterMethodDecl() const
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
void VisitDecompositionDecl(DecompositionDecl *D)
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
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)
Represents an access specifier followed by colon ':'.
Declaration of a function specialization at template class scope.
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)...
TypeSourceInfo * getSignatureAsWritten() const
A IndirectFieldDecl record.
ArrayRef< ParmVarDecl * > parameters() const
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Represents a C++ using-declaration.
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.
SourceLocation getIvarRBraceLoc() const
ArrayRef< BindingDecl * > bindings() const
void VisitLabelDecl(LabelDecl *LD)
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
void append(InputIterator begin, InputIterator end)
void VisitClassTemplateDecl(ClassTemplateDecl *D)
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
ObjCContainerDecl - Represents a container for method declarations.
TagKind getTagKind() const
bool isReferenced() const
Whether any declaration of this entity was referenced.
void VisitTypedefDecl(TypedefDecl *D)
An AccessSpecDecl record.
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes, if any.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
void VisitUsingShadowDecl(UsingShadowDecl *D)
A ConstructorUsingShadowDecl record.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
SourceLocation getLocEnd() const LLVM_READONLY
ArrayRef< NamedDecl * > chain() const
A UsingDirecitveDecl record.
PropertyAttributeKind getPropertyAttributes() const
A DecompositionDecl record.
Represents a declaration of a type.
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or nullptr if this template w...
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
void VisitBindingDecl(BindingDecl *D)
TemplateParameterList * getTemplateParameterList(unsigned i) const
const Expr * getInitExpr() const
SourceLocation getPropertyIvarDeclLoc() const
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
A ClassTemplateSpecializationDecl record.
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
SourceLocation getExternLoc() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents an Objective-C protocol declaration.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
PropertyControl getPropertyImplementation() const
Represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
Represents a linkage specification.
QualType getReturnType() const
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
A binding in a decomposition declaration.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getAtStartLoc() const
ArgPassingKind getArgPassingRestrictions() const
bool isAnonymousStructOrUnion() const
Whether this is an anonymous struct or union.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
SourceLocation getRParenLoc() const
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
void VisitObjCContainerDecl(ObjCContainerDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
RecordDecl * getMostRecentDecl()
Represents the declaration of a typedef-name via a C++11 alias-declaration.
protocol_loc_range protocol_locs() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
Represents a ValueDecl that came out of a declarator.
QualType getPromotionType() const
Return the integer type that enumerators should promote to.
A CXXDeductionGuideDecl record.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
bool isInlineSpecified() const
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
A StaticAssertDecl record.
TypeSourceInfo * getTypeSourceInfo() const
A VarTemplateSpecializationDecl record.
static bool classofKind(Kind K)
An ObjCTypeParamDecl record.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
unsigned getFunctionScopeDepth() const
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
A ObjCCategoryImplDecl record.
unsigned getChainingSize() const
Selector getSetterName() const
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
A ObjCPropertyImplDecl record.
TypeSourceInfo * getSuperClassTInfo() const
void VisitRecordDecl(RecordDecl *D)
Declaration of a template type parameter.
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
TypeSourceInfo * getTypeSourceInfo() 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...
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D...
unsigned getNumParams() const
Represents a C++ destructor within a class.
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
A CXXConstructorDecl record.
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
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)
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
overridden_method_range overridden_methods() const
DeclContext * getDeclContext()
void VisitUsingDecl(UsingDecl *D)
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
A VarTemplateDecl record.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
EnumDecl * getMostRecentDecl()
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
A CXXDestructorDecl record.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
unsigned IsCopyDeductionCandidate
[C++17] Only used by CXXDeductionGuideDecl.
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
IdentifierInfo * getSetterId() const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
A NamespaceAliasDecl record.
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
FunctionTemplateDecl * getTemplate(unsigned I) const
Returns the i'th template candidate.
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.
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
bool isInstanceMethod() const
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
An ImplicitParamDecl record.
StringRef getName() const
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.
ImplicitParamDecl * getSelfDecl() const
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
void VisitTagDecl(TagDecl *D)
An ImportDecl recording a module import.
A ObjCCategoryDecl record.
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
CXXMethodDecl * getMostRecentDecl()
PrettyDeclStackTraceEntry - If a crash occurs in the parser while parsing something related to a decl...
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
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.
A FileScopeAsmDecl record.
void VisitMSPropertyDecl(MSPropertyDecl *D)
A ObjCCompatibleAliasDecl record.
void VisitVarTemplateDecl(VarTemplateDecl *D)
bool isNonTrivialToPrimitiveDestroy() const
void VisitTypeAliasDecl(TypeAliasDecl *D)
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
protocol_loc_range protocol_locs() const
TypeSourceInfo * getReturnTypeSourceInfo() const
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
void push_back(uint64_t N)
Minimal vector-like interface.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
SourceLocation getLocStart() const LLVM_READONLY
unsigned protocol_size() const
SourceLocation getUsingLoc() const
Return the location of the using keyword.
unsigned size_overridden_methods() const
Represents a C++ Modules TS module export declaration.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
An UnresolvedUsingValueDecl record.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Encodes a location in the source.
bool getSynthesize() const
This represents '#pragma omp declare reduction ...' directive.
A record that stores the set of declarations that are visible from a given DeclContext.
Pseudo declaration for capturing expressions.
SourceLocation getSuperClassLoc() const
void VisitObjCImplDecl(ObjCImplDecl *D)
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
SourceLocation getLocStart() const LLVM_READONLY
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
Represents the declaration of a struct/union/class/enum.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
SourceLocation getCategoryNameLoc() const
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
ObjCList - This is a simple template class used to hold various lists of decls etc, which is heavily used by the ObjC front-end.
Represents the declaration of a label.
Represents a dependent using declaration which was not marked with typename.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set...
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
SourceLocation getRParenLoc() const
Represents a static or instance method of a struct/union/class.
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
void VisitUsingPackDecl(UsingPackDecl *D)
C-style initialization with assignment.
bool isConversionFromLambda() const
bool isMemberSpecialization()
Determines whether this variable template partial specialization was a specialization of a member par...
A TemplateTypeParmDecl record.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Data that is common to all of the declarations of a given function template.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
ObjCCategoryDecl - Represents a category declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
unsigned getNumTemplates() const
Returns the number of function templates that this might be a specialization of.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
void VisitCapturedDecl(CapturedDecl *D)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Represents one property declaration in an Objective-C interface.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
A simple visitor class that helps create declaration visitors.
unsigned getODRHash()
Returns ODRHash of the function.
bool hasUninstantiatedDefaultArg() const
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
ObjCDeclQualifier getObjCDeclQualifier() const
Represents a C++11 static_assert declaration.
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
SourceLocation getRBraceLoc() const
bool hasFlexibleArrayMember() const
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
SourceLocation getIvarLBraceLoc() const
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
SourceLocation getRAngleLoc() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
protocol_range protocols() const
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
A ObjCProtocolDecl record.
ObjCDeclQualifier getObjCDeclQualifier() const
Base class for declarations which introduce a typedef-name.
A CXXConversionDecl record.
void VisitFieldDecl(FieldDecl *D)
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
const ObjCInterfaceDecl * getClassInterface() const
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Dataflow Directional Tag Classes.
void AddTemplateSpecializations(DeclTy *D)
bool isValid() const
Return true if this is a valid SourceLocation object.
An IntegerLiteral record.
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ArrayRef< Capture > captures() const
PropertyAttributeKind getPropertyAttributesAsWritten() const
The base class of all kinds of template declarations (e.g., class, function, etc.).
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
SourceLocation getAtLoc() const
void VisitNamedDecl(NamedDecl *D)
Represents a field injected from an anonymous union/struct into the parent scope. ...
A ClassTemplatePartialSpecializationDecl record.
QualType getUnderlyingType() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
DeclCode
Record codes for each kind of declaration.
const Expr * getInit() const
AccessSpecifier getAccess() const
A decomposition declaration.
bool isEmbeddedInDeclarator() const
void VisitTypeDecl(TypeDecl *D)
unsigned getNumTemplateParameters() 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.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
A LinkageSpecDecl record.
bool isNonTrivialToPrimitiveCopy() const
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
void VisitDeclaratorDecl(DeclaratorDecl *D)
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
SourceLocation getSetterNameLoc() const
const ObjCInterfaceDecl * getClassInterface() const
void VisitEnumDecl(EnumDecl *D)
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
const FunctionDecl * getOperatorDelete() const
A PragmaCommentDecl record.
void VisitNamespaceDecl(NamespaceDecl *D)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void VisitVarDecl(VarDecl *D)
Expr * getUninstantiatedDefaultArg()
protocol_loc_range protocol_locs() const
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C...
size_t param_size() const
TypeSourceInfo * getTypeSourceInfo() const
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
ImplicitParamDecl * getParam(unsigned i) const
bool isParamDestroyedInCallee() const
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void VisitFunctionDecl(FunctionDecl *D)
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool hasTypename() const
Return true if the using declaration has 'typename'.
SourceManager & getSourceManager()
bool capturesCXXThis() const
ImplementationControl getImplementationControl() const
static bool classofKind(Kind K)
SourceRange getAtEndRange() const
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
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(...).
SourceLocation getCategoryNameLoc() const
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
TypedefNameDecl * getTypedefNameForAnonDecl() const
bool isMutable() const
Determines whether this field is mutable (C++ only).
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or nullptr if there isn't on...
SourceLocation getRBraceLoc() const
Represents a C++ struct/union/class.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
An object for streaming information to a record.
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCIvarDecl * getPropertyIvarDecl() const
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)
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
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...
ImplicitParamDecl * getCmdDecl() const
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
Writes an AST file containing the contents of a translation unit.
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
CXXMethodDecl * getSpecialization() const
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
unsigned protocol_size() const
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
bool blockMissingReturnType() const
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
unsigned varlist_size() const
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void VisitFriendDecl(FriendDecl *D)
The top declaration context.
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)
ArrayRef< ParmVarDecl * > parameters() const
NamedDecl * getMostRecentDecl()
ObjCPropertyDecl * getPropertyDecl() const
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool hasObjectMember() const
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
Expr * getBinding() const
Get the expression to which this declaration is bound.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
A FunctionTemplateDecl record.
ModuleFile * getOwningModuleFile(const Decl *D)
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
A TypeAliasTemplateDecl record.
void VisitImportDecl(ImportDecl *D)
bool isStaticDataMember() const
Determines whether this is a static data member.
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
An instance of this class represents the declaration of a property member.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
ObjCMethodDecl * getGetterMethodDecl() const
This represents a decl that may have a name.
SourceLocation getLAngleLoc() const
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
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)
bool isInline() const
Whether this variable is (C++1z) inline.
AccessControl getAccessControl() const
Declaration of a friend template.
SourceLocation getIvarRBraceLoc() const
bool isPropertyAccessor() const
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Selector getGetterName() const
Represents C++ using-directive.
SourceLocation getLParenLoc() const
SourceLocation getEndOfDefinitionLoc() const
Represents a #pragma detect_mismatch line.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type)...
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
void VisitObjCMethodDecl(ObjCMethodDecl *D)
bool isFreeStanding() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
unsigned size() const
Determine the number of type parameters in this list.
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.
SourceLocation getLocation() const
const StringLiteral * getAsmString() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Represents a pack of using declarations that a single using-declarator pack-expanded into...
QualType getType() const
Return the type wrapped by this type source info.
SourceLocation getRBraceLoc() const
ArrayRef< ParmVarDecl * > parameters() const
void VisitObjCIvarDecl(ObjCIvarDecl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
This is a C++ Modules TS module interface unit.
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...